Hi
Lets have arquillian-junit-container jar on CP and this test:
@RunWith(Arquillian.class)
@RunAsClient
public class SomeTestCase
{
@Test
public void test()
{
System.out.println("test");
}
}
This test method writes out “test” here:
(E) Test
(I) TestContextHandler.createSuiteContext
(I) TestContextHandler.createClassContext
(E) TestClass
(I) TestContextHandler.createTestContext
(I) ContainerEventController.createTestContext
(O) ClientTestExecuter.execute
(E) ExecutionEvent
(O) LocalTestExecuter.execute
test
(E) TestResult
So, all is good.
Now, take the very same test, nothing has changed at all, but use arquillian-junit-standalone instead of junit-container and see the output:
(E) Test
(I) TestContextHandler.createSuiteContext
(I) TestContextHandler.createClassContext
(E) TestClass
(I) TestContextHandler.createTestContext
(I) ContainerEventController.createTestContext
(O) ClientTestExecuter.execute
(E) ExecutionEvent
(O) LocalTestExecuter.execute
test
(E) TestResult
(O) LocalTestMethodExecutor.execute
test
(E) TestResult
Why it is printed out twice when using junit-standalone? I am using Droidium container on CP in every case. It holds also for having @RunAsClient on test methods.
Firstly I spotted this when that test method has written something out to fields (username / password). In case I had junit-standalone on cp, that method was executed twice so I ended up with two names and two passwords written in textfields (namename / passwordpassword) and it was obvious that something is weird here … that method was just executed twice …