We are trying to run JUnit - Tests against EJBs in a JBoss 3.2.3 application server (via CruiseControl and ANT - tasks). Therefore, before ANT can run the Unit Tests it has to compile, pack and deploy some .jars to jboss. It is doing this by copying the .jar - files into JBoss's deploy directory. At the moment it is waiting afterwards just a fix amount of time, before the Unit - Tests are startet, hoping that jboss deploys fast enough...
The problem is, if something goes wrong during deployment, Unit tests fail with some obscure Errors.
Now here's my question: Is there a simple way to check via an ant task, if the deployment of a Bean ended up correctly, or not?
I could imagine something like an Init - Function in the EJB, which JBoss calls by default, which is writing some file (the name of the file should be setable by ANT!?), if everything was ok while deploying. Ant could check, or even wait for the file, and go on, if it exists, or stop the build - process, if it doesnt exist.
- or is there even a simpler way?
many thanks in advance!
I use the following cactus task
to run my server side tests. It pings the testURL to determine whether the tests are ready to run. You could use a url to test whether the deployment is successful. The url could be a look up of the mbean associated with your ejb.
Hope this helps.