0 Replies Latest reply: Oct 1, 2010 11:25 AM by Samuel Santos RSS

Scan classpath with JBoss Embedded AS

Samuel Santos Newbie

Embedded JBoss has a very handy feature which allows you to deploy your entire classpath into its bootstrap instance:

 

if (!Bootstrap.getInstance().isStarted()) {
    Bootstrap.getInstance().bootstrap();
    Bootstrap.getInstance().scanClasspath("classes");
}

 

The main downside for me was its inability to use JAAS domain policies.

 

However, Embedded JBoss has been retired in favor of the new JBoss Embedded AS.
JBoss Embedded AS allows the deployment of four object types: URL, File, Deployable and Archive.
Unfortunately, sometimes you need to override your resources from src/main/resources with the ones from src/test/resources and Bootstrap.getInstance().scanClasspath(String path) used to work perfectly fine.
Not to mention that if your project has a high number of dependencies it would be transparent with Bootstrap.getInstance().scanClasspath(String path), and appears to be really hard, if not impossible, to achieve that with the new model.
ShrinkWrap and Arquillian projects do look very promising, but I haven't yet figured out how they can help me with this issue.

 

Embeddable EJB 3.0 and Embedded JBoss worked for me until now, but since they are both retired, which JBoss project can I use to do my integration tests?

 

Our test life cycle usually includes:

  1. Start an Embedded JBoss server;
  2. Deploy the entire classpath (which includes dependencies and resources from src/test/resources folder);
  3. Run TestNG tests;
  4. Shutdown the Embedded JBoss server.

 

Thanks for your time,
Samuel Santos