[jboss-svn-commits] JBoss Common SVN: r4416 - in arquillian/trunk/containers/glassfish-embedded-30/src: main/java/org/jboss/arquillian/glassfish/embedded30 and 3 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat May 22 16:36:19 EDT 2010


Author: aslak
Date: 2010-05-22 16:36:16 -0400 (Sat, 22 May 2010)
New Revision: 4416

Added:
   arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/embedded30/
   arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/embedded30/GlassFishConfiguration.java
   arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/embedded30/GlassFishDeploymentAppender.java
   arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/embedded30/GlassFishEmbeddedContainer.java
   arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/embedded30/
   arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/embedded30/GlassFishEmbeddedContainerTestCase.java
   arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/embedded30/TestServlet.java
Removed:
   arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/GlassFishConfiguration.java
   arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/GlassFishDeploymentAppender.java
   arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/GlassFishEmbeddedContainer.java
   arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/GlassFishEmbeddedContainerTestCase.java
   arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/TestServlet.java
Modified:
   arquillian/trunk/containers/glassfish-embedded-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender
   arquillian/trunk/containers/glassfish-embedded-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration
   arquillian/trunk/containers/glassfish-embedded-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer
Log:
ARQ-151 Renamed package to org.jboss.arquillian.glassfish.embedded30

Deleted: arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/GlassFishConfiguration.java
===================================================================
--- arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/GlassFishConfiguration.java	2010-05-22 20:19:07 UTC (rev 4415)
+++ arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/GlassFishConfiguration.java	2010-05-22 20:36:16 UTC (rev 4416)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.arquillian.glassfish;
-
-import java.util.UUID;
-
-import org.jboss.arquillian.spi.ContainerConfiguration;
-import org.jboss.arquillian.spi.ContainerProfile;
-
-/**
- * A {@link org.jboss.arquillian.spi.ContainerConfiguration} implementation for
- * the GlassFish Embedded container.
- *
- * @author <a href="mailto:german.escobarc at gmail.com">German Escobar</a>
- * @version $Revision: $
- */
-public class GlassFishConfiguration implements ContainerConfiguration
-{
-   private int bindPort = 8080;
-   private String instanceRoot = "target/glassfish_" + UUID.randomUUID().toString();
-   private boolean autoDelete = true;
-   
-   public ContainerProfile getContainerProfile()
-   {
-      return ContainerProfile.CLIENT;
-   }
-   
-   public int getBindPort()
-   {
-      return bindPort;
-   }
-
-   public void setBindPort(int bindPort)
-   {
-      this.bindPort = bindPort;
-   }
-
-   public String getInstanceRoot() 
-   {
-      return instanceRoot;
-   }
-   
-   public void setInstanceRoot(String instanceRoot)
-   {
-      this.instanceRoot = instanceRoot;
-   }
-   
-   public boolean getAutoDelete() 
-   {
-      return autoDelete;
-   }
-   
-   public void setAutoDelete(boolean autoDelete)
-   {
-      this.autoDelete = autoDelete;
-   }
-}

Deleted: arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/GlassFishDeploymentAppender.java
===================================================================
--- arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/GlassFishDeploymentAppender.java	2010-05-22 20:19:07 UTC (rev 4415)
+++ arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/GlassFishDeploymentAppender.java	2010-05-22 20:36:16 UTC (rev 4416)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.arquillian.glassfish;
-
-import org.jboss.arquillian.spi.AuxiliaryArchiveAppender;
-import org.jboss.arquillian.spi.TestEnricher;
-import org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher;
-import org.jboss.arquillian.testenricher.ejb.EJBInjectionEnricher;
-import org.jboss.arquillian.testenricher.resource.ResourceInjectionEnricher;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-
-/**
- * 
- * Package the required dependencies needed by the GlassFish Embedded Container plugin 
- * to run in container. 
- *
- * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
- * @version $Revision: $
- */
-public class GlassFishDeploymentAppender implements AuxiliaryArchiveAppender
-{
-
-   public Archive<?> createAuxiliaryArchive()
-   {
-      JavaArchive archive = ShrinkWrap.create("arquillian-glassfish-testenrichers.jar", JavaArchive.class)
-                        .addPackages(
-                              true, 
-                              EJBInjectionEnricher.class.getPackage(),
-                              ResourceInjectionEnricher.class.getPackage(),
-                              CDIInjectionEnricher.class.getPackage())
-                        .addServiceProvider(
-                              TestEnricher.class, 
-                              EJBInjectionEnricher.class,
-                              ResourceInjectionEnricher.class,
-                              CDIInjectionEnricher.class);
-      return archive;
-   }
-
-}

Deleted: arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/GlassFishEmbeddedContainer.java
===================================================================
--- arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/GlassFishEmbeddedContainer.java	2010-05-22 20:19:07 UTC (rev 4415)
+++ arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/GlassFishEmbeddedContainer.java	2010-05-22 20:36:16 UTC (rev 4416)
@@ -1,156 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.arquillian.glassfish;
-
-import java.io.File;
-import java.net.URL;
-
-import org.glassfish.api.deployment.DeployCommandParameters;
-import org.glassfish.api.deployment.UndeployCommandParameters;
-import org.glassfish.api.embedded.ContainerBuilder;
-import org.glassfish.api.embedded.EmbeddedContainer;
-import org.glassfish.api.embedded.EmbeddedFileSystem;
-import org.glassfish.api.embedded.Server;
-import org.jboss.arquillian.protocol.servlet.ServletMethodExecutor;
-import org.jboss.arquillian.spi.Configuration;
-import org.jboss.arquillian.spi.ContainerMethodExecutor;
-import org.jboss.arquillian.spi.Context;
-import org.jboss.arquillian.spi.DeployableContainer;
-import org.jboss.arquillian.spi.DeploymentException;
-import org.jboss.arquillian.spi.LifecycleException;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.glassfish.api.ShrinkwrapReadableArchive;
-
-/**
- * GlassFishEmbeddedContainer
- *
- * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
- * @version $Revision: $
- */
-public class GlassFishEmbeddedContainer implements DeployableContainer
-{
-   private String target = "server";
-   private Server server;
-
-   private GlassFishConfiguration configuration;
-   
-   public GlassFishEmbeddedContainer()
-   {
-   }
-   
-   public void setup(Context context, Configuration configuration)
-   {
-      this.configuration = configuration.getContainerConfig(GlassFishConfiguration.class);
-      
-      final Server.Builder builder = new Server.Builder(GlassFishEmbeddedContainer.class.getName());
-
-      final EmbeddedFileSystem.Builder embeddedFsBuilder = new EmbeddedFileSystem.Builder();
-      final EmbeddedFileSystem embeddedFs = embeddedFsBuilder
-               .instanceRoot(
-                     new File(
-                           this.configuration.getInstanceRoot()))
-               .autoDelete(this.configuration.getAutoDelete())
-               .build();
-      builder.embeddedFileSystem(embeddedFs);
-      
-      server = builder.build();
-
-      server.addContainer(ContainerBuilder.Type.all);
-   }
-   
-   public void start(Context context) throws LifecycleException
-   {
-      try 
-      {
-         for(EmbeddedContainer contianer : server.getContainers()) {
-            contianer.bind(server.createPort(configuration.getBindPort()), "http");
-            contianer.start();
-         }
-      } 
-      catch (Exception e) 
-      {
-         throw new LifecycleException("Could not start container", e);
-      }
-   }
-
-   public void stop(Context context) throws LifecycleException
-   {
-      try 
-      {
-         server.stop();
-      } 
-      catch (Exception e) 
-      {
-         throw new LifecycleException("Could not stop container", e);
-      }
-   }
-
-   public ContainerMethodExecutor deploy(Context context, Archive<?> archive) throws DeploymentException
-   {
-      try 
-      {
-         DeployCommandParameters params = new DeployCommandParameters();
-         params.enabled = true;
-         params.target = target;
-         params.name = createDeploymentName(archive.getName());
-         
-         server.getDeployer().deploy(
-               archive.as(ShrinkwrapReadableArchive.class),
-               params);
-         
-      } 
-      catch (Exception e) 
-      {
-         throw new DeploymentException("Could not deploy " + archive.getName(), e);
-      }
-
-      try 
-      {
-         return new ServletMethodExecutor(
-               new URL(
-                     "http",
-                     "localhost",
-                     configuration.getBindPort(), 
-                     "/")
-               );
-      } 
-      catch (Exception e) 
-      {
-         throw new RuntimeException("Could not create ContianerMethodExecutor", e);
-      }
-   }
-
-   public void undeploy(Context context, Archive<?> archive) throws DeploymentException
-   {
-      UndeployCommandParameters params = new UndeployCommandParameters();
-      params.target = target;
-      params.name = createDeploymentName(archive.getName());
-      try 
-      {
-         server.getDeployer().undeploy(params.name, params);
-      }
-      catch (Exception e) 
-      {
-         throw new DeploymentException("Could not undeploy " + archive.getName(), e);
-      }
-   }
-   
-   private String createDeploymentName(String archiveName) 
-   {
-      return archiveName.substring(0, archiveName.lastIndexOf("."));
-   }
-}

Copied: arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/embedded30/GlassFishConfiguration.java (from rev 4389, arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/GlassFishConfiguration.java)
===================================================================
--- arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/embedded30/GlassFishConfiguration.java	                        (rev 0)
+++ arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/embedded30/GlassFishConfiguration.java	2010-05-22 20:36:16 UTC (rev 4416)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.glassfish.embedded30;
+
+import java.util.UUID;
+
+import org.jboss.arquillian.spi.ContainerConfiguration;
+import org.jboss.arquillian.spi.ContainerProfile;
+
+/**
+ * A {@link org.jboss.arquillian.spi.ContainerConfiguration} implementation for
+ * the GlassFish Embedded container.
+ *
+ * @author <a href="mailto:german.escobarc at gmail.com">German Escobar</a>
+ * @version $Revision: $
+ */
+public class GlassFishConfiguration implements ContainerConfiguration
+{
+   private int bindPort = 8080;
+   private String instanceRoot = "target/glassfish_" + UUID.randomUUID().toString();
+   private boolean autoDelete = true;
+   
+   public ContainerProfile getContainerProfile()
+   {
+      return ContainerProfile.CLIENT;
+   }
+   
+   public int getBindPort()
+   {
+      return bindPort;
+   }
+
+   public void setBindPort(int bindPort)
+   {
+      this.bindPort = bindPort;
+   }
+
+   public String getInstanceRoot() 
+   {
+      return instanceRoot;
+   }
+   
+   public void setInstanceRoot(String instanceRoot)
+   {
+      this.instanceRoot = instanceRoot;
+   }
+   
+   public boolean getAutoDelete() 
+   {
+      return autoDelete;
+   }
+   
+   public void setAutoDelete(boolean autoDelete)
+   {
+      this.autoDelete = autoDelete;
+   }
+}

Copied: arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/embedded30/GlassFishDeploymentAppender.java (from rev 4389, arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/GlassFishDeploymentAppender.java)
===================================================================
--- arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/embedded30/GlassFishDeploymentAppender.java	                        (rev 0)
+++ arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/embedded30/GlassFishDeploymentAppender.java	2010-05-22 20:36:16 UTC (rev 4416)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.glassfish.embedded30;
+
+import org.jboss.arquillian.spi.AuxiliaryArchiveAppender;
+import org.jboss.arquillian.spi.TestEnricher;
+import org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher;
+import org.jboss.arquillian.testenricher.ejb.EJBInjectionEnricher;
+import org.jboss.arquillian.testenricher.resource.ResourceInjectionEnricher;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+
+/**
+ * 
+ * Package the required dependencies needed by the GlassFish Embedded Container plugin 
+ * to run in container. 
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class GlassFishDeploymentAppender implements AuxiliaryArchiveAppender
+{
+
+   public Archive<?> createAuxiliaryArchive()
+   {
+      JavaArchive archive = ShrinkWrap.create("arquillian-glassfish-testenrichers.jar", JavaArchive.class)
+                        .addPackages(
+                              true, 
+                              EJBInjectionEnricher.class.getPackage(),
+                              ResourceInjectionEnricher.class.getPackage(),
+                              CDIInjectionEnricher.class.getPackage())
+                        .addServiceProvider(
+                              TestEnricher.class, 
+                              EJBInjectionEnricher.class,
+                              ResourceInjectionEnricher.class,
+                              CDIInjectionEnricher.class);
+      return archive;
+   }
+
+}

Copied: arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/embedded30/GlassFishEmbeddedContainer.java (from rev 4389, arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/GlassFishEmbeddedContainer.java)
===================================================================
--- arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/embedded30/GlassFishEmbeddedContainer.java	                        (rev 0)
+++ arquillian/trunk/containers/glassfish-embedded-30/src/main/java/org/jboss/arquillian/glassfish/embedded30/GlassFishEmbeddedContainer.java	2010-05-22 20:36:16 UTC (rev 4416)
@@ -0,0 +1,156 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.glassfish.embedded30;
+
+import java.io.File;
+import java.net.URL;
+
+import org.glassfish.api.deployment.DeployCommandParameters;
+import org.glassfish.api.deployment.UndeployCommandParameters;
+import org.glassfish.api.embedded.ContainerBuilder;
+import org.glassfish.api.embedded.EmbeddedContainer;
+import org.glassfish.api.embedded.EmbeddedFileSystem;
+import org.glassfish.api.embedded.Server;
+import org.jboss.arquillian.protocol.servlet.ServletMethodExecutor;
+import org.jboss.arquillian.spi.Configuration;
+import org.jboss.arquillian.spi.ContainerMethodExecutor;
+import org.jboss.arquillian.spi.Context;
+import org.jboss.arquillian.spi.DeployableContainer;
+import org.jboss.arquillian.spi.DeploymentException;
+import org.jboss.arquillian.spi.LifecycleException;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.glassfish.api.ShrinkwrapReadableArchive;
+
+/**
+ * GlassFishEmbeddedContainer
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class GlassFishEmbeddedContainer implements DeployableContainer
+{
+   private String target = "server";
+   private Server server;
+
+   private GlassFishConfiguration configuration;
+   
+   public GlassFishEmbeddedContainer()
+   {
+   }
+   
+   public void setup(Context context, Configuration configuration)
+   {
+      this.configuration = configuration.getContainerConfig(GlassFishConfiguration.class);
+      
+      final Server.Builder builder = new Server.Builder(GlassFishEmbeddedContainer.class.getName());
+
+      final EmbeddedFileSystem.Builder embeddedFsBuilder = new EmbeddedFileSystem.Builder();
+      final EmbeddedFileSystem embeddedFs = embeddedFsBuilder
+               .instanceRoot(
+                     new File(
+                           this.configuration.getInstanceRoot()))
+               .autoDelete(this.configuration.getAutoDelete())
+               .build();
+      builder.embeddedFileSystem(embeddedFs);
+      
+      server = builder.build();
+
+      server.addContainer(ContainerBuilder.Type.all);
+   }
+   
+   public void start(Context context) throws LifecycleException
+   {
+      try 
+      {
+         for(EmbeddedContainer contianer : server.getContainers()) {
+            contianer.bind(server.createPort(configuration.getBindPort()), "http");
+            contianer.start();
+         }
+      } 
+      catch (Exception e) 
+      {
+         throw new LifecycleException("Could not start container", e);
+      }
+   }
+
+   public void stop(Context context) throws LifecycleException
+   {
+      try 
+      {
+         server.stop();
+      } 
+      catch (Exception e) 
+      {
+         throw new LifecycleException("Could not stop container", e);
+      }
+   }
+
+   public ContainerMethodExecutor deploy(Context context, Archive<?> archive) throws DeploymentException
+   {
+      try 
+      {
+         DeployCommandParameters params = new DeployCommandParameters();
+         params.enabled = true;
+         params.target = target;
+         params.name = createDeploymentName(archive.getName());
+         
+         server.getDeployer().deploy(
+               archive.as(ShrinkwrapReadableArchive.class),
+               params);
+         
+      } 
+      catch (Exception e) 
+      {
+         throw new DeploymentException("Could not deploy " + archive.getName(), e);
+      }
+
+      try 
+      {
+         return new ServletMethodExecutor(
+               new URL(
+                     "http",
+                     "localhost",
+                     configuration.getBindPort(), 
+                     "/")
+               );
+      } 
+      catch (Exception e) 
+      {
+         throw new RuntimeException("Could not create ContianerMethodExecutor", e);
+      }
+   }
+
+   public void undeploy(Context context, Archive<?> archive) throws DeploymentException
+   {
+      UndeployCommandParameters params = new UndeployCommandParameters();
+      params.target = target;
+      params.name = createDeploymentName(archive.getName());
+      try 
+      {
+         server.getDeployer().undeploy(params.name, params);
+      }
+      catch (Exception e) 
+      {
+         throw new DeploymentException("Could not undeploy " + archive.getName(), e);
+      }
+   }
+   
+   private String createDeploymentName(String archiveName) 
+   {
+      return archiveName.substring(0, archiveName.lastIndexOf("."));
+   }
+}

Modified: arquillian/trunk/containers/glassfish-embedded-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender
===================================================================
--- arquillian/trunk/containers/glassfish-embedded-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender	2010-05-22 20:19:07 UTC (rev 4415)
+++ arquillian/trunk/containers/glassfish-embedded-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender	2010-05-22 20:36:16 UTC (rev 4416)
@@ -1 +1 @@
-org.jboss.arquillian.glassfish.GlassFishDeploymentAppender
\ No newline at end of file
+org.jboss.arquillian.glassfish.embedded30.GlassFishDeploymentAppender
\ No newline at end of file

Modified: arquillian/trunk/containers/glassfish-embedded-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration
===================================================================
--- arquillian/trunk/containers/glassfish-embedded-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration	2010-05-22 20:19:07 UTC (rev 4415)
+++ arquillian/trunk/containers/glassfish-embedded-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration	2010-05-22 20:36:16 UTC (rev 4416)
@@ -1 +1 @@
-org.jboss.arquillian.glassfish.GlassFishConfiguration
\ No newline at end of file
+org.jboss.arquillian.glassfish.embedded30.GlassFishConfiguration
\ No newline at end of file

Modified: arquillian/trunk/containers/glassfish-embedded-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer
===================================================================
--- arquillian/trunk/containers/glassfish-embedded-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer	2010-05-22 20:19:07 UTC (rev 4415)
+++ arquillian/trunk/containers/glassfish-embedded-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer	2010-05-22 20:36:16 UTC (rev 4416)
@@ -1 +1 @@
-org.jboss.arquillian.glassfish.GlassFishEmbeddedContainer
\ No newline at end of file
+org.jboss.arquillian.glassfish.embedded30.GlassFishEmbeddedContainer
\ No newline at end of file

Deleted: arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/GlassFishEmbeddedContainerTestCase.java
===================================================================
--- arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/GlassFishEmbeddedContainerTestCase.java	2010-05-22 20:19:07 UTC (rev 4415)
+++ arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/GlassFishEmbeddedContainerTestCase.java	2010-05-22 20:36:16 UTC (rev 4416)
@@ -1,93 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.arquillian.glassfish;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.logging.Logger;
-
-import org.jboss.arquillian.api.Deployment;
-import org.jboss.arquillian.api.RunMode;
-import org.jboss.arquillian.api.RunModeType;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-
-/**
- * GlassFishEmbeddedContainerTestCase
- *
- * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
- * @version $Revision: $
- */
- at RunWith(Arquillian.class)
- at RunMode(RunModeType.LOCAL)
-public class GlassFishEmbeddedContainerTestCase 
-{
-
-   /**
-    * Logger
-    */
-   private static final Logger log = Logger.getLogger(GlassFishEmbeddedContainerTestCase.class.getName());
-   
-   /**
-    * Deployment for the test
-    * @return
-    */
-   @Deployment
-   public static WebArchive getDeployment()
-   {
-      final WebArchive war = ShrinkWrap.create("test.war", WebArchive.class).addClass(TestServlet.class);
-      log.info(war.toString(true));
-      return war;
-
-   }
-
-
-   @Test
-   public void shouldBeAbleToDeployWebArchive() throws Exception
-   {
-      String body = readAllAndClose(new URL("http://localhost:8080/test/Test").openStream());
-      
-      Assert.assertEquals(
-            "Verify that the servlet was deployed and returns expected result",
-            "hello",
-            body);
-   }
-   
-   private String readAllAndClose(InputStream is) throws Exception 
-   {
-      ByteArrayOutputStream out = new ByteArrayOutputStream();
-      try
-      {
-         int read;
-         while( (read = is.read()) != -1)
-         {
-            out.write(read);
-         }
-      }
-      finally 
-      {
-         try { is.close(); } catch (Exception e) { }
-      }
-      return out.toString();
-   }
-}

Deleted: arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/TestServlet.java
===================================================================
--- arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/TestServlet.java	2010-05-22 20:19:07 UTC (rev 4415)
+++ arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/TestServlet.java	2010-05-22 20:36:16 UTC (rev 4416)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.arquillian.glassfish;
-
-import java.io.IOException;
-
-import javax.servlet.ServletException;
-import javax.servlet.annotation.WebServlet;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * TestServlet
- *
- * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
- * @version $Revision: $
- */
- at WebServlet(urlPatterns = "/Test")
-public class TestServlet extends HttpServlet
-{
-   private static final long serialVersionUID = 1L;
-
-   @Override
-   protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
-   {
-      response.getWriter().append("hello");
-   }
-}

Copied: arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/embedded30/GlassFishEmbeddedContainerTestCase.java (from rev 4389, arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/GlassFishEmbeddedContainerTestCase.java)
===================================================================
--- arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/embedded30/GlassFishEmbeddedContainerTestCase.java	                        (rev 0)
+++ arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/embedded30/GlassFishEmbeddedContainerTestCase.java	2010-05-22 20:36:16 UTC (rev 4416)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.glassfish.embedded30;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.logging.Logger;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.api.RunMode;
+import org.jboss.arquillian.api.RunModeType;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+/**
+ * GlassFishEmbeddedContainerTestCase
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+ at RunWith(Arquillian.class)
+ at RunMode(RunModeType.LOCAL)
+public class GlassFishEmbeddedContainerTestCase 
+{
+
+   /**
+    * Logger
+    */
+   private static final Logger log = Logger.getLogger(GlassFishEmbeddedContainerTestCase.class.getName());
+   
+   /**
+    * Deployment for the test
+    * @return
+    */
+   @Deployment
+   public static WebArchive getDeployment()
+   {
+      final WebArchive war = ShrinkWrap.create("test.war", WebArchive.class).addClass(TestServlet.class);
+      log.info(war.toString(true));
+      return war;
+
+   }
+
+
+   @Test
+   public void shouldBeAbleToDeployWebArchive() throws Exception
+   {
+      String body = readAllAndClose(new URL("http://localhost:8080/test/Test").openStream());
+      
+      Assert.assertEquals(
+            "Verify that the servlet was deployed and returns expected result",
+            "hello",
+            body);
+   }
+   
+   private String readAllAndClose(InputStream is) throws Exception 
+   {
+      ByteArrayOutputStream out = new ByteArrayOutputStream();
+      try
+      {
+         int read;
+         while( (read = is.read()) != -1)
+         {
+            out.write(read);
+         }
+      }
+      finally 
+      {
+         try { is.close(); } catch (Exception e) { }
+      }
+      return out.toString();
+   }
+}

Copied: arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/embedded30/TestServlet.java (from rev 4389, arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/TestServlet.java)
===================================================================
--- arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/embedded30/TestServlet.java	                        (rev 0)
+++ arquillian/trunk/containers/glassfish-embedded-30/src/test/java/org/jboss/arquillian/glassfish/embedded30/TestServlet.java	2010-05-22 20:36:16 UTC (rev 4416)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.glassfish.embedded30;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * TestServlet
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+ at WebServlet(urlPatterns = "/Test")
+public class TestServlet extends HttpServlet
+{
+   private static final long serialVersionUID = 1L;
+
+   @Override
+   protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+   {
+      response.getWriter().append("hello");
+   }
+}



More information about the jboss-svn-commits mailing list