3 Replies Latest reply on May 10, 2010 11:43 PM by dan.j.allen

    Remote Weblogic container support kick-off

    dan.j.allen

      The SPI you need to implement to support a remote Weblogic container, or any container for that matter, is:

       

       

      Here's the signature of that interface:

       

      public interface DeployableContainer
      {
         void setup(Context context, Configuration configuration);
         void start(Context context) throws LifecycleException;
         ContainerMethodExecutor deploy(Context context, Archive<?> archive)
               throws DeploymentException;
         void undeploy(Context context, Archive<?> archive)
               throws DeploymentException;
         void stop(Context context) throws LifecycleException;
      }
      

       

      You can use the remote JBoss AS implementation as a reference:

       

      The JBoss AS remote container binds to port 9000 to communicate with the ProfileService, from which a proxy to the JBoss AS deployment manager is obtained. (This is similar to interacting with the t3 service on Weblogic). The ShrinkWrap archive is then converted to a Zip stream and streamed to the server.

       

      For completeness, I'll reference a blog which documents the Weblogic Maven plugin configuration as a starting point. Arquillian is built with Maven, so there will need to be instructions on how to wire Maven up to the Weblogic client JARs.

       

       

      Let's workout where the weblogic container module goes later. Until it's ready to be put in the mainline, I suggest sticking it into a github account or equivalent. I recommend building against Arquillian trunk until Alpha2 is released.

        • 1. Re: Remote Weblogic container support kick-off
          dan.j.allen

          Created JIRA to track progress: ARQ-138

          • 2. Re: Remote Weblogic container support kick-off
            dan.j.allen

            I forgot to mention that you also need to implement the configuration SPI:

             

            org.jboss.arquillian.spi.ContainerConfiguration

             

            And of course you need to declare your service classes in the META-INF/services directory:

             

            META-INF/services/org.jboss.arquillian.spi.DeployableContainer
            META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration
            

             

            Hopefully some documentation for how to implement a container will come out of this effort

            • 3. Re: Remote Weblogic container support kick-off
              dan.j.allen

              To provide some more info on how to do a container implementation...

               

              When implementing the ContainerConfiguration SPI, the only thing you really need in there is to return ContainerProfile.CLIENT (this defines the internal configuration of the Arquillian engine). Other things you may want to add to this class are configurable things like connection information etc. Keep it a simple JavaBean and it will be configurable through the Arquillian xml configuration file. At the moment a implementation of this SPI is needed for Arquillian to run at all. (It fails with a NullPointerException if not).

               

              The next thing would be the TestEnrichers SPI, this is for handling in-container EJB/Resource/CDI injection into the TestCase. The default implementations might work fine for WebLogic, and you then only need to provide a implementation of the AuxiliaryArchiveAppender SPI to package up the enricher classes. Look at the JBoss example for how to do that in ShrinkWrap.