0 Replies Latest reply on May 15, 2013 6:03 AM by tjuerge

    Using Arquillian for integration testing a JEE 5 EAR (with EJB 3.0 session beans) and the corresponding EJB client JAR

    tjuerge

      I'm  looking for a "light-weight" solution to implement integration tests of artifacts of a Maven build (an JEE 5 EAR with a Spring application behind a EJB 3.0 session facade and a another JAR with with the corresponding Spring EJB remoting client) which are deployed to WebLogic 10.3.

      Now I'm wondering if Arquillian with an embedded EJB container like OpenEJB is the right tool for this job?

       

      I took the following approach to start testing with Arquillian 1.0.3.Final, ShrinkWrap 2.0.0-beta-3, OpenEJB 4.5.2:

       

      @RunWith(Arquillian.class)
      @RunAsClient
      public class Jee5Test {
      
          @ArquillianResource
          private Context context;
      
          @Deployment(testable = false)
          public static Archive<?> deploy() {
              EnterpriseArchive ear = Maven.resolver().loadPomFromFile("pom.xml").resolve("com.acme:remote-service:ear:?").withoutTransitivity().asSingle(EnterpriseArchive.class);
              return ear;
          }
      
          @Test
          public void lookupRemoteService() throws NamingException {
              assertNotNull(context);
              assertNotNull(context.lookup("MyServiceRemote");
          }
      }
      

       

      Regarding this approach I have the following questions:

       

      1. Despite of declaring this test class with @RunAsClient the test class is registered with embedded container as a (managed) bean. In my scenario no incontainer test is needed. So how can I get rid of this deployment of the test class a a bean?

       

      2. The EJB 3.0 session beans (decorated with the EJB annotations) in the EJB module (no "ejb-jar.xml" defined here -> only EJB module reference in "META-INF/application.xml") are not deployed. It seems that Arquillians OpenEJBArchiveProcessor isn't supporting JEE 5 EARs because the deployment descriptor "META-INF/application.xml" isn't evaluated. Is there any other way to deploy a JEE 5 EAR with an embedded EJB module declared in the deployment descriptor "META-INF/application.xml"?

       

      3. To support deployment of WebLogics custom EAR format (shared libraries in "APP-INF/lib" and shared classes/resources in "APP-INF/classes") we need a different aproach as the one implemented in OpenEJBArchiveProcessor. Can this be achieved by fidlling around with the EAR by using ShrinkWrap or do we have to come up with a full-blown Arquillian extension based on the stuff in "org.apache.openejb.arquillian.openejb.*"?

       

       

      Is anyone using Arquillian for integration testing JEE 5 EARs with an embedded container?

       

      Thanks in advance.

      /Torsten