-
Bug
-
Resolution: Done
-
Major
-
7.0.0.Alpha4
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)