3 Replies Latest reply on May 5, 2006 2:25 AM by jc7442

    Embedded EJB3 & classes

    jc7442

      I'm trying to explore how to use the embeddable EJB3 for my unit test. My tests are performed using JUnit. Build is done using maven. In maven lifecycle, classes are compiled, then unit tests are perfomred (using classes), jar is build and finally it is possible to execute integration tests.

      Problem is that unit tests are performed before the jar build. It uses .class in build directory. EJB3StandaloneBootstrap.scanClasspath scans for jar files, not for classes.

      Is is possible to register .class (or better a build directory containing .class) in the bootstrap ?


      Thanks

        • 1. Re: Embedded EJB3 & classes
          bdecoste

          I've created a JIRA task for this issue:

          http://jira.jboss.com/jira/browse/EJBTHREE-552

          • 2. Re: Embedded EJB3 & classes
            bdecoste

            You can use directories to deploy to embedded EJB3. Here is an code example. Note that the standalone directory in the example is the parent directory of the deployment directory (i.e. standalone would contain a test subdirectory that would contain the deployment: META-INF, classes, etc.

            URL deployDir = new URL("file:/C:/eclipse/workspace/jboss-head/ejb3/output/test-lib/embeddable/standalone");
             EJB3StandaloneDeployer deployer = new EJB3StandaloneDeployer();
             deployer.setKernel(EJB3StandaloneBootstrap.getKernel());
             deployer.setJndiProperties(getInitialContextProperties());
             deployer.setDefaultPersistenceProperties(getDefaultPersistenceProperties());
             deployer.getDeployDirs().add(deployDir);


            • 3. Re: Embedded EJB3 & classes
              jc7442

              Thanks, in fact it works fine with classes. I had a problem in my classpath.

              I'm sorry !!