Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
1.0.0.Alpha4
-
None
Description
I have a simple bean and test class. testFoo will always be called an extra time with every test. When it wants to do testFoo it will call testFoo twice. When it wants to do testBar it will call testFoo and then testBar. Both result with failure in assertEquals(0, myFieldBean.getCounter())
Full Maven project attached as a jar.
public class MyBean {
private int counter = 0;
public int getCounter()
}
@RunWith(Arquillian.class)
public class FooBarTest
{
@Inject MyBean myFieldBean;
public FooBarTest()
{ System.out.println("Called FooBarTest constructor"); } @Test @Inject
public void testFoo(MyBean myBean)
@Test
public void testBar()
}
Output is:
16:42:44,892 INFO [STDOUT] Called FooBarTest constructor
16:42:44,904 INFO [STDOUT] Called testFoo
16:42:44,905 INFO [STDOUT] myBean=org.jboss.aqbug.MyBean@2a5772
16:42:44,907 INFO [STDOUT] myFieldBean=org.jboss.aqbug.MyBean@1d3018e
16:42:44,915 INFO [STDOUT] Called testFoo
16:42:44,917 INFO [STDOUT] myBean=org.jboss.aqbug.MyBean@11821
16:42:44,918 INFO [STDOUT] myFieldBean=org.jboss.aqbug.MyBean@1d3018e
16:42:44,965 INFO [STDOUT] Called FooBarTest constructor
16:42:44,974 INFO [STDOUT] Called testFoo
16:42:44,977 INFO [STDOUT] myBean=org.jboss.aqbug.MyBean@12b4d3
16:42:44,978 INFO [STDOUT] myFieldBean=org.jboss.aqbug.MyBean@1d9604
16:42:45,036 INFO [STDOUT] Called testBar
16:42:45,037 INFO [STDOUT] myFieldBean=org.jboss.aqbug.MyBean@1d9604