How to test JBoss deployment automatically?

4.8k views Asked by At

I have jboss application. And want to test deployment automatically. And want to add this task as a project in Hudson

My vision is based on the following stages:

  1. Put my application to JBoss(copy ears, configs, libs e.t.c)
  2. Run JBoss

    I have a Linux-machine and now our project is require JBoss 4.3.2. How can I run the JBoss and analyze results. Is my application deployed fully and successfully or not?

  3. Run some standalone tests

  4. Stop JBoss
3

There are 3 answers

0
Ondra Žižka On

Depends on what do you mean by "test deployment automatically". If you only need to test whether the deployment succeeded,

  • you can query JMX,
  • or use JBoss Fresh (alpha now).

If you want to do some CI tests,

  • then Cargo is a good tool, and works with both latest JBoss AS and EAP.
  • Also see JSFUnit if you use JSF.

To glue it all together, use Maven (my choice), Ant, or Groovy.

0
richj On

I haven't found a good way to do this with JBoss 4.x other than writing a script to run the various steps. After starting the server, wait for long enough for the JBoss services to start and deploy the application, then test that the essential components of your application are registered in JNDI.

I found some links that might help to do this with JBoss 5:

I was going to suggest that you could write your script as a Hudson plugin, but perhaps you could use this instead: JBoss JPBM Plugin for Hudson

0
mhaller On

Use Cargo for an automatic "(download server), start server, deploy application, run tests, undeploy, stop server" cycle. The Maven Cargo plugin does a good job with executing integration tests using Surefire. has support for most app servers, including JBoss 4.

Cargo provides the following Tools and APIs:

  • A Java API to start/stop/configure Java Containers and deploy modules into them.
  • A Java API to parse/create/merge Java EE Modules
  • Ant tasks, Maven 1, Maven 2 plugins.