We've recently started using JUnit with Arquillian Alpha5 on a remote JBoss AS 6 to test our JPA DAO beans, using CDI injection. All the test classes inherit a @Deployment method from a common superclass. It's working brilliantly, allowing us to test our database queries more easily than ever before - so thanks!
The thing is, we'd like to run all the tests in one go, and we've now got almost 300 test classes. We can do this with our current setup, but it results in each test class being wrapped in its own test.war, which is deployed on the remote server, the tests executed, and then the war undeployed. As we progress through the test classes (on the same instance of the server), the deploy and undeploy steps take longer and longer, until we're waiting over 10 minutes for a test class to finish it's run cycle. The tests themselves aren't the issue, it's just the deploy/undeploy time.
Because of this, we'd ideally like to put all these test classes in one test.war, so we don't suffer the hot-deploy overhead. I've seen from other posts on here that this functionality is not currently available, but will be coming down the line. So, for use until then, I've been trying a workaround, whereby we have one test class, marked to be run with Arquillian, with one annotated test method. This method then programmattically finds all the 'real' test classes, finds their annotated @Test methods, and attempts to run them using Java Reflection (method.invoke). Quite fairly, this doesn't currently work, because the 'real' test methods refer to injected beans which haven't been enriched by Arquillian, because only the 'collecting' test class is known to/run by it.
So, is there any way in which the Arquillian classes which do the enrichment in the normal lifecycle can be called from within a test, which will be run on the server, so I can enrich the test classes before I invoke their methods? We don't need the deploy steps, purely the enrichment, but I couldn't find a way in at that stage via the API.
Secondly, have you encountered the hot-deploy slowdown yourselves, and can you suggest any other workarounds for it? I'm not sure we're at the point where bringing a new server up each time would be quicker overall.
Finally, is there a date for when a release containing the 'multiple test classes, one deployment' functionality will be released?
Hope you can help, thanks!