2 Replies Latest reply on May 8, 2007 4:24 PM by Bill Burke

    Deployment into embedded container

    Dirk Estievenart Newbie

      Why do the examples use such a cumbersome way to deploy the archive?

       private static void deploy()
       {
       jar = AssembledContextFactory.getInstance().create("ejbTestCase.jar");
       jar.addClass(Customer.class);
       jar.addClass(CustomerDAOBean.class);
       jar.addClass(CustomerDAOLocal.class);
       jar.addClass(CustomerDAORemote.class);
       jar.mkdir("META-INF").addResource("tutorial-persistence.xml", "persistence.xml");
       try
       {
       Bootstrap.getInstance().deploy(jar);
       }
       catch (DeploymentException e)
       {
       throw new RuntimeException("Unable to deploy", e);
       }
       }
      


      I copy the jar file under test to the deploy dir in my ant script. That seems to work well and IMO is much simpler.
      Furthermore I'm afraid it might endanger the reliablility of your tests if the distributed jar differs from the jar you build inside the test.