-
Bug
-
Resolution: Unresolved
-
Critical
-
None
-
None
-
None
-
None
EJBs are not injected correctly to a test case if they come from different applications.
For instance following code:
@EJB(mappedName = "java:global/test-app1/HelloBean") private Hello hello1; @EJB(mappedName = "java:global/test-app2/HelloBean") private Hello hello2; @Deployment(name = "DEP1") public static JavaArchive deploymentApp1() throws IllegalArgumentException, IOException { return createJar("test-app1.jar"); } @Deployment(name = "DEP2") public static JavaArchive deploymentApp2() throws IllegalArgumentException, IOException { return createJar("test-app2.jar"); } @Test @OperateOnDeployment("DEP1") public void test1() throws Exception { assertNotNull(hello1); } @Test @OperateOnDeployment("DEP2") public void test2() throws Exception { assertNotNull(hello2); }
Then one of the tests fails and one passes (sometime test1, sometime test2).