Trying out Arquillian as part of some GateIn testing. GateIn (www.jboss.org/gatein) is a portal server, which is a web application running on top of JBossAS and it also integrates itself into the application server (for things like detecting when new web archives are deployed, etc). Its more complex than a normal webapplication would usually be.
A typical test sequence would be something like
1) configure and start the server (usually this is created from scratch each time as we don't want a previous test run to contaminate the server setup).
2) deploy a test portal setup (ie what we want to test). May be more than one archive.
3) run tests. This may include deploying/undeploying test portlets (war). We may want to deploy and undeploy multiple wars during a test.
5) stop server
Arquillian seems really cool in the way the tests are run on the server (which allows for use to gain easy access to our portal services to test). But it seems a bit limiting right now for us: create single archive, deploy archive and tests to server, run tests.
Right now I can use cargo to create a new server setup, configure the server, and deploy my test portal archives. Then use Arquillian to deploy a single test portlet archive and run tests (in this case I wouldn't be running the tests on this archive directly but on the portal services, which would access the archive). This would work ok for some of our simple tests.
[actually, I can't even use Arquillian to deploy a test portlet since it doesn't currently allow for in_container war deployables for AS 5. I need cargo to deploy this too and then use a dummy jar deployable since Arquillian has a requirement that something has to be deployed.]
A few suggestions that would make Arquillian easier for us:
- have the deployed test archive deploy separately from the archive which contains the tests (kindof like as_client but the archive which contains the tests is also be deployed on the server. This would also get around the war deployables not being able to be deployed in_container). I might like to be able to test the archive itself, not the combined archive and tests.
- deployment lifecycle support. Being able to deploy and undeploy multiple archives independently of each other during the tests.
- better server setup support. I have seen a few jiras about adding additional files and archives to the server, but it would be nice to have something like create a new clean server each time for test. Since I can use cargo to do this right now its not a big problem.
- being able to inject a microcontainer bean into the test
- being able to keep the test archives around after the test. If I am creating a test and its failing, I might want to check and see if there is something strange with the archive. I wouldn't want to do this all the time, but a flag to enable this option would be nice. Currently I put a delay in my test and then copy it to another folder before it gets deleted.
Any thoughts on feedback on this? Sorry if I missed a feature that already exists or is planned, or if I am suggesting something beyond the scope of what Arquillian wants to prove.
I guess I should look into how extensible Arquillain is and how difficult it would be to add these features to our tests.