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.
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.
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.
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..
It does. Removing @Run (or, equivalently, setting it to IN_CONTAINER) successfully runs the multithreaded test in the container.