Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-4513

ProgrammaticCacheContainerTest.testSmallCache always fails on JDK8

    XMLWordPrintable

Details

    Description

      CDI listeners are implemented via an adapter class that extends AbstractAdapter<T extends Event>. For CacheStartedEvent, the base class defines a void fire(T payload) method, and the adapter overrides it as void fire(CacheStartedEvent payload).

      It appears that in JDK8 both these methods are returned by Class.getMethods(), and the CDI listener ends up being called twice:

      16:42:44,810 ERROR (testng-ProgrammaticCacheContainerTest:) [UnitTestTestNGListener] Test testSmallCache(org.infinispan.cdi.test.cachemanager.embedded.programmatic.ProgrammaticCacheContainerTest) failed.
      java.lang.AssertionError: expected [1] but found [2]
      	at org.testng.Assert.fail(Assert.java:94)
      	at org.testng.Assert.failNotEquals(Assert.java:494)
      	at org.testng.Assert.assertEquals(Assert.java:123)
      	at org.testng.Assert.assertEquals(Assert.java:370)
      	at org.testng.Assert.assertEquals(Assert.java:380)
      	at org.infinispan.cdi.test.cachemanager.embedded.programmatic.ProgrammaticCacheContainerTest.testSmallCache(ProgrammaticCacheContainerTest.java:39)
      

      Attachments

        Activity

          People

            wburns@redhat.com Will Burns
            dberinde@redhat.com Dan Berindei (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: