-
1. Re: Testing parallel operations
aslak Dec 16, 2010 10:57 AM (in response to digitalstain)In Alpha4, you can use the AS_CLIENT runmode (@Run(AS_CLIENT)), in this case Arquillian will not do incontainer testing but only act as a client. You can then lookup your ejb remote and do manual Threading inside the @Test method. Alpha4 can not be run via TestNGs parallel support.
In the next version we should have a fix for this, so you can use the TestFrameworks Parallel support and launch multiple parallel test executions against a incontainer testcase.
-
2. Re: Testing parallel operations
digitalstain Dec 16, 2010 1:12 PM (in response to aslak)Thank you very much, that worked very well.
One thing that is not immediately obvious, at least to me, is that when the @Test method that spawns the threads exits, the test.jar application is undeployed and everything still running will fail. Obviously the solution is to use synchronization, possibly a Barrier, which will ensure that the "main" method will exit only after all testing threads are done. Other than that, it worked like a charm.
cheers,
CG
-
3. Re: Testing parallel operations
aslak Dec 16, 2010 6:15 PM (in response to digitalstain)Cool, glad it's working!
Undeployment will happen in the AfterClass lifecycle, but yes. The same rules as any other place apply for Threading in the test case.. you need to join/sync/use barriers to keep the creating thread alive so the children can do their job, else it will just exit.
-
4. Re: Testing parallel operations
aslak Dec 16, 2010 8:47 PM (in response to aslak)Come to think of it, not sure why i 'insisted' on AS_CLIENT run mode for threading. Manual Threading incontainer should work just as well..
-
5. Re: Testing parallel operations
digitalstain Dec 17, 2010 4:16 AM (in response to aslak)It does. Removing @Run (or, equivalently, setting it to IN_CONTAINER) successfully runs the multithreaded test in the container.