[jboss-svn-commits] JBoss Common SVN: r4513 - in arquillian/trunk/containers: glassfish-remote-30 and 51 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sat Jun 12 14:53:49 EDT 2010
Author: dan.j.allen
Date: 2010-06-12 14:53:47 -0400 (Sat, 12 Jun 2010)
New Revision: 4513
Added:
arquillian/trunk/containers/glassfish-remote-30/
arquillian/trunk/containers/glassfish-remote-30/pom.xml
arquillian/trunk/containers/glassfish-remote-30/src/
arquillian/trunk/containers/glassfish-remote-30/src/main/
arquillian/trunk/containers/glassfish-remote-30/src/main/java/
arquillian/trunk/containers/glassfish-remote-30/src/main/java/org/
arquillian/trunk/containers/glassfish-remote-30/src/main/java/org/jboss/
arquillian/trunk/containers/glassfish-remote-30/src/main/java/org/jboss/arquillian/
arquillian/trunk/containers/glassfish-remote-30/src/main/java/org/jboss/arquillian/container/
arquillian/trunk/containers/glassfish-remote-30/src/main/java/org/jboss/arquillian/container/glassfish/
arquillian/trunk/containers/glassfish-remote-30/src/main/java/org/jboss/arquillian/container/glassfish/remote30/
arquillian/trunk/containers/glassfish-remote-30/src/main/java/org/jboss/arquillian/container/glassfish/remote30/GlassFishJSR88Configuration.java
arquillian/trunk/containers/glassfish-remote-30/src/main/java/org/jboss/arquillian/container/glassfish/remote30/GlassFishJSR88RemoteContainer.java
arquillian/trunk/containers/glassfish-remote-30/src/main/resources/
arquillian/trunk/containers/glassfish-remote-30/src/main/resources/META-INF/
arquillian/trunk/containers/glassfish-remote-30/src/main/resources/META-INF/services/
arquillian/trunk/containers/glassfish-remote-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender
arquillian/trunk/containers/glassfish-remote-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration
arquillian/trunk/containers/glassfish-remote-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer
arquillian/trunk/containers/glassfish-remote-30/src/main/resources/org/
arquillian/trunk/containers/glassfish-remote-30/src/main/resources/org/jboss/
arquillian/trunk/containers/glassfish-remote-30/src/main/resources/org/jboss/arquillian/
arquillian/trunk/containers/glassfish-remote-30/src/main/resources/org/jboss/arquillian/container/
arquillian/trunk/containers/glassfish-remote-30/src/main/resources/org/jboss/arquillian/container/glassfish/
arquillian/trunk/containers/glassfish-remote-30/src/main/resources/org/jboss/arquillian/container/glassfish/remote30/
arquillian/trunk/containers/glassfish-remote-30/src/main/resources/org/jboss/arquillian/container/glassfish/remote30/sun-web.xml
arquillian/trunk/containers/glassfish-remote-30/src/main/resources/org/jboss/arquillian/container/glassfish/remote30/web.xml
arquillian/trunk/containers/glassfish-remote-30/src/test/
arquillian/trunk/containers/glassfish-remote-30/src/test/java/
arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/
arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/
arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/
arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/
arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/
arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/
arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GlassFishJSR88RemoteContainerEARTestCase.java
arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GlassFishJSR88RemoteContainerTestSuite.java
arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GlassFishJSR88RemoteContainerWARTestCase.java
arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/Greeter.java
arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GreeterServlet.java
arquillian/trunk/containers/glassfish-remote-30/src/test/resources/
arquillian/trunk/containers/glassfish-remote-30/src/test/resources/application.xml
arquillian/trunk/containers/jsr88/
arquillian/trunk/containers/jsr88/pom.xml
arquillian/trunk/containers/jsr88/src/
arquillian/trunk/containers/jsr88/src/main/
arquillian/trunk/containers/jsr88/src/main/java/
arquillian/trunk/containers/jsr88/src/main/java/org/
arquillian/trunk/containers/jsr88/src/main/java/org/jboss/
arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/
arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/
arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/
arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/EE5DeploymentAppender.java
arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/EE6DeploymentAppender.java
arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88Configuration.java
arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88DeploymentListener.java
arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88ModuleTypeMapper.java
arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainer.java
arquillian/trunk/containers/jsr88/src/main/resources/
arquillian/trunk/containers/jsr88/src/main/resources/META-INF/
arquillian/trunk/containers/jsr88/src/main/resources/META-INF/services/
arquillian/trunk/containers/jsr88/src/main/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender
arquillian/trunk/containers/jsr88/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration
arquillian/trunk/containers/jsr88/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer
arquillian/trunk/containers/jsr88/src/test/
arquillian/trunk/containers/jsr88/src/test/java/
arquillian/trunk/containers/jsr88/src/test/java/org/
arquillian/trunk/containers/jsr88/src/test/java/org/jboss/
arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/
arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/
arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/
arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/Greeter.java
arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/GreeterServlet.java
arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88ModuleTypeMapperTestCase.java
arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainerEARTestCase.java
arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainerTestSuite.java
arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainerWARTestCase.java
arquillian/trunk/containers/jsr88/src/test/resources-glassfish/
arquillian/trunk/containers/jsr88/src/test/resources-glassfish/arquillian.xml
arquillian/trunk/containers/jsr88/src/test/resources-jbossas/
arquillian/trunk/containers/jsr88/src/test/resources-jbossas/arquillian.xml
arquillian/trunk/containers/jsr88/src/test/resources/
arquillian/trunk/containers/jsr88/src/test/resources/META-INF/
arquillian/trunk/containers/jsr88/src/test/resources/META-INF/services/
arquillian/trunk/containers/jsr88/src/test/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender
arquillian/trunk/containers/jsr88/src/test/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration
arquillian/trunk/containers/jsr88/src/test/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer
arquillian/trunk/containers/jsr88/src/test/resources/application.xml
arquillian/trunk/containers/jsr88/src/test/resources/web.xml
Log:
ARQ-156
Property changes on: arquillian/trunk/containers/glassfish-remote-30
___________________________________________________________________
Name: svn:ignore
+ target
Added: arquillian/trunk/containers/glassfish-remote-30/pom.xml
===================================================================
--- arquillian/trunk/containers/glassfish-remote-30/pom.xml (rev 0)
+++ arquillian/trunk/containers/glassfish-remote-30/pom.xml 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-build</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../build/pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-glassfish-remote-30</artifactId>
+ <name>Arquillian GlassFish 3.0 Remote Container (JSR 88)</name>
+ <description>GlassFish 3.0 Remote Container integration (JSR 88) for the Arquillian Project</description>
+
+ <properties>
+ <version.glassfish>3.0.1-b19</version.glassfish>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-jsr88</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.spec.javax.enterprise.deploy</groupId>
+ <artifactId>jboss-jad-api_1.2_spec</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.deployment</groupId>
+ <artifactId>deployment-client</artifactId>
+ <version>${version.glassfish}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-api</artifactId>
+ <version>3.1.0</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-impl-base</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-impl-base</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-junit</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <!-- enable tests when GlassFish is setup on Hudson server -->
+ <skip>true</skip>
+ <includes>
+ <include>**/*TestSuite.java</include>
+ </includes>
+ <systemPropertyVariables>
+ <glassfish.install.dir>${env.GLASSFISH_HOME}</glassfish.install.dir>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Added: arquillian/trunk/containers/glassfish-remote-30/src/main/java/org/jboss/arquillian/container/glassfish/remote30/GlassFishJSR88Configuration.java
===================================================================
--- arquillian/trunk/containers/glassfish-remote-30/src/main/java/org/jboss/arquillian/container/glassfish/remote30/GlassFishJSR88Configuration.java (rev 0)
+++ arquillian/trunk/containers/glassfish-remote-30/src/main/java/org/jboss/arquillian/container/glassfish/remote30/GlassFishJSR88Configuration.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,39 @@
+/*
+ * 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.container.glassfish.remote30;
+
+import org.jboss.arquillian.container.jsr88.JSR88Configuration;
+
+/**
+ * This class extends the {@link JSR88Configuration} to provide the
+ * deployment URI and factory class defaults for the GlassFish container.
+ *
+ * @author Dan Allen
+ * @author Iskandar Salim
+ */
+public class GlassFishJSR88Configuration extends JSR88Configuration
+{
+ public static final String GLASSFISH_JSR88_DEFAULT_DEPLOYMENT_URI = "deployer:Sun:AppServer::localhost:4848";
+ public static final String GLASSFISH_JSR88_DEPLOYMENT_FACTORY_CLASS = "org.glassfish.deployapi.SunDeploymentFactory";
+
+ @Override
+ protected void setDefaults()
+ {
+ setDeploymentUri(GLASSFISH_JSR88_DEFAULT_DEPLOYMENT_URI);
+ setDeploymentFactoryClass(GLASSFISH_JSR88_DEPLOYMENT_FACTORY_CLASS);
+ }
+}
Added: arquillian/trunk/containers/glassfish-remote-30/src/main/java/org/jboss/arquillian/container/glassfish/remote30/GlassFishJSR88RemoteContainer.java
===================================================================
--- arquillian/trunk/containers/glassfish-remote-30/src/main/java/org/jboss/arquillian/container/glassfish/remote30/GlassFishJSR88RemoteContainer.java (rev 0)
+++ arquillian/trunk/containers/glassfish-remote-30/src/main/java/org/jboss/arquillian/container/glassfish/remote30/GlassFishJSR88RemoteContainer.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,66 @@
+/*
+ * 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.container.glassfish.remote30;
+
+import org.jboss.arquillian.spi.ContainerConfiguration;
+import org.jboss.arquillian.container.jsr88.JSR88RemoteContainer;
+import org.jboss.arquillian.spi.ContainerMethodExecutor;
+import org.jboss.arquillian.spi.Context;
+import org.jboss.arquillian.spi.DeploymentException;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ArchivePath;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+/**
+ * An extension of the {@link JSR88RemoteContainer} for GlassFish
+ *
+ * <p>This class simply provides the {@link GlassFishJSR88Configuration} as
+ * an override.</p>
+ *
+ * @author Dan Allen
+ * @author Iskandar Salim
+ */
+public class GlassFishJSR88RemoteContainer extends JSR88RemoteContainer
+{
+ @Override
+ public Class<? extends ContainerConfiguration> getContainerConfigurationClass()
+ {
+ return GlassFishJSR88Configuration.class;
+ }
+
+ @Override
+ public ContainerMethodExecutor deploy(Context context, Archive<?> archive) throws DeploymentException {
+ if (archive instanceof WebArchive)
+ {
+ //ArchivePath webXmlPath = ArchivePaths.create("/WEB-INF/web.xml");
+ //if (!archive.contains(webXmlPath))
+ //{
+ // // sets the module name to "test"
+ // ((WebArchive) archive).setWebXML("org/jboss/arquillian/container/glassfish/remote30/web.xml");
+ //}
+ ArchivePath sunWebXmlPath = ArchivePaths.create("/WEB-INF/sun-web.xml");
+ if (!archive.contains(sunWebXmlPath))
+ {
+ // sets the module name to "test"
+ ((WebArchive) archive).addWebResource("org/jboss/arquillian/container/glassfish/remote30/sun-web.xml", "sun-web.xml");
+ }
+ }
+ return super.deploy(context, archive);
+ }
+
+}
Added: arquillian/trunk/containers/glassfish-remote-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender
===================================================================
--- arquillian/trunk/containers/glassfish-remote-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender (rev 0)
+++ arquillian/trunk/containers/glassfish-remote-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1 @@
+org.jboss.arquillian.container.jsr88.EE6DeploymentAppender
Added: arquillian/trunk/containers/glassfish-remote-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration
===================================================================
--- arquillian/trunk/containers/glassfish-remote-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration (rev 0)
+++ arquillian/trunk/containers/glassfish-remote-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1 @@
+org.jboss.arquillian.container.glassfish.remote30.GlassFishJSR88Configuration
Added: arquillian/trunk/containers/glassfish-remote-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer
===================================================================
--- arquillian/trunk/containers/glassfish-remote-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer (rev 0)
+++ arquillian/trunk/containers/glassfish-remote-30/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1 @@
+org.jboss.arquillian.container.glassfish.remote30.GlassFishJSR88RemoteContainer
Added: arquillian/trunk/containers/glassfish-remote-30/src/main/resources/org/jboss/arquillian/container/glassfish/remote30/sun-web.xml
===================================================================
--- arquillian/trunk/containers/glassfish-remote-30/src/main/resources/org/jboss/arquillian/container/glassfish/remote30/sun-web.xml (rev 0)
+++ arquillian/trunk/containers/glassfish-remote-30/src/main/resources/org/jboss/arquillian/container/glassfish/remote30/sun-web.xml 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
+<sun-web-app error-url="">
+ <context-root>/test</context-root>
+ <class-loader delegate="true"/>
+</sun-web-app>
Added: arquillian/trunk/containers/glassfish-remote-30/src/main/resources/org/jboss/arquillian/container/glassfish/remote30/web.xml
===================================================================
--- arquillian/trunk/containers/glassfish-remote-30/src/main/resources/org/jboss/arquillian/container/glassfish/remote30/web.xml (rev 0)
+++ arquillian/trunk/containers/glassfish-remote-30/src/main/resources/org/jboss/arquillian/container/glassfish/remote30/web.xml 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="3.0"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+ <!-- JSR-88 derives the name of the distributed archive from the module-name element -->
+ <module-name>test</module-name>
+</web-app>
Added: arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GlassFishJSR88RemoteContainerEARTestCase.java
===================================================================
--- arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GlassFishJSR88RemoteContainerEARTestCase.java (rev 0)
+++ arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GlassFishJSR88RemoteContainerEARTestCase.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,106 @@
+/*
+ * 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.container.glassfish.jsr88;
+
+import static org.jboss.arquillian.api.RunModeType.AS_CLIENT;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.servlet.annotation.WebServlet;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.api.Run;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ArchivePath;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Verifies that the an Arquillian test can be run in client
+ * mode with a the JSR 88 Remote container for GlassFish.
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ * @author Dan Allen
+ */
+ at RunWith(Arquillian.class)
+ at Run(AS_CLIENT)
+public class GlassFishJSR88RemoteContainerEARTestCase
+{
+ /**
+ * Logger
+ */
+ private static final Logger log = Logger.getLogger(GlassFishJSR88RemoteContainerEARTestCase.class.getName());
+
+ /**
+ * Deployment for the test
+ * @return
+ */
+ @Deployment
+ public static Archive<?> getTestArchive()
+ {
+ ArchivePath root = ArchivePaths.create("/");
+ final WebArchive war = ShrinkWrap.create("test.war", WebArchive.class)
+ .addClasses(GreeterServlet.class);
+ final JavaArchive ejb = ShrinkWrap.create("test.jar", JavaArchive.class)
+ .addClass(Greeter.class);
+ final EnterpriseArchive ear = ShrinkWrap.create("test.ear", EnterpriseArchive.class)
+ .setApplicationXML("application.xml")
+ .add(war, root)
+ .add(ejb, root);
+ log.info(ear.toString(true));
+ return ear;
+ }
+
+ @Test
+ public void shouldBeAbleToDeployWebArchive() throws Exception
+ {
+ String servletPath = GreeterServlet.class.getAnnotation(WebServlet.class).urlPatterns()[0];
+ String body = readAllAndClose(new URL("http://localhost:8080/test" + servletPath).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();
+ }
+}
Added: arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GlassFishJSR88RemoteContainerTestSuite.java
===================================================================
--- arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GlassFishJSR88RemoteContainerTestSuite.java (rev 0)
+++ arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GlassFishJSR88RemoteContainerTestSuite.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,70 @@
+/*
+ * 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.container.glassfish.jsr88;
+
+import java.io.File;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ * A JUnit 4 test suite that manages the lifecycle of a locally-installed
+ * GlassFish instance in order to test the JSR 88 deployment.
+ *
+ * <p>This class relies on the system property glassfish.install.dir
+ * to point to a valid installation of GlassFish v3.</p>
+ *
+ * @author Dan Allen
+ */
+ at RunWith(Suite.class)
+ at SuiteClasses({
+ GlassFishJSR88RemoteContainerWARTestCase.class,
+ GlassFishJSR88RemoteContainerEARTestCase.class})
+public class GlassFishJSR88RemoteContainerTestSuite
+{
+ @BeforeClass
+ public static void startContainer() throws Exception
+ {
+ Runtime.getRuntime().exec(new String[] {
+ getAsadminCommand(),
+ "start-domain",
+ "tests"}).waitFor();
+ }
+
+ @AfterClass
+ public static void stopContainer() throws Exception
+ {
+ Runtime.getRuntime().exec(new String[] {
+ getAsadminCommand(),
+ "stop-domain",
+ "tests"}).waitFor();
+ }
+
+ public static String getAsadminCommand()
+ {
+ File asadminFile = new File(System.getProperty("glassfish.install.dir") +
+ File.separator + "bin" + File.separator + "asadmin");
+ if (!asadminFile.exists() || !asadminFile.isFile())
+ {
+ Assert.fail("Path to asadmin command is invalid: " + asadminFile.getAbsolutePath());
+ }
+ return asadminFile.getAbsolutePath();
+ }
+}
Added: arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GlassFishJSR88RemoteContainerWARTestCase.java
===================================================================
--- arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GlassFishJSR88RemoteContainerWARTestCase.java (rev 0)
+++ arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GlassFishJSR88RemoteContainerWARTestCase.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,95 @@
+/*
+ * 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.container.glassfish.jsr88;
+
+import static org.jboss.arquillian.api.RunModeType.AS_CLIENT;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.servlet.annotation.WebServlet;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.api.Run;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.Archive;
+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;
+
+/**
+ * Verifies that the an Arquillian test can be run in client
+ * mode with a the JSR 88 Remote container for GlassFish.
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ * @author Dan Allen
+ */
+ at RunWith(Arquillian.class)
+ at Run(AS_CLIENT)
+public class GlassFishJSR88RemoteContainerWARTestCase
+{
+ /**
+ * Logger
+ */
+ private static final Logger log = Logger.getLogger(GlassFishJSR88RemoteContainerWARTestCase.class.getName());
+
+ /**
+ * Deployment for the test
+ * @return
+ */
+ @Deployment
+ public static Archive<?> getTestArchive()
+ {
+ final WebArchive war = ShrinkWrap.create("test.war", WebArchive.class)
+ .addClasses(GreeterServlet.class, Greeter.class);
+ log.info(war.toString(true));
+ return war;
+ }
+
+ @Test
+ public void shouldBeAbleToDeployWebArchive() throws Exception
+ {
+ String servletPath = GreeterServlet.class.getAnnotation(WebServlet.class).urlPatterns()[0];
+ String body = readAllAndClose(new URL("http://localhost:8080/test" + servletPath).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();
+ }
+}
Added: arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/Greeter.java
===================================================================
--- arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/Greeter.java (rev 0)
+++ arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/Greeter.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,28 @@
+/*
+ * 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.container.glassfish.jsr88;
+
+import javax.ejb.Stateless;
+
+ at Stateless
+public class Greeter
+{
+ public String greet()
+ {
+ return "hello";
+ }
+}
Added: arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GreeterServlet.java
===================================================================
--- arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GreeterServlet.java (rev 0)
+++ arquillian/trunk/containers/glassfish-remote-30/src/test/java/org/jboss/arquillian/container/glassfish/jsr88/GreeterServlet.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,45 @@
+/*
+ * 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.container.glassfish.jsr88;
+
+import java.io.IOException;
+import javax.ejb.EJB;
+
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * GreeterServlet
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ */
+ at WebServlet(urlPatterns = "/Greeter")
+public class GreeterServlet extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ @EJB private Greeter greeter;
+
+ @Override
+ protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ {
+ response.getWriter().append(greeter.greet());
+ }
+}
Added: arquillian/trunk/containers/glassfish-remote-30/src/test/resources/application.xml
===================================================================
--- arquillian/trunk/containers/glassfish-remote-30/src/test/resources/application.xml (rev 0)
+++ arquillian/trunk/containers/glassfish-remote-30/src/test/resources/application.xml 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
+ version="5">
+ <module>
+ <web>
+ <web-uri>test.war</web-uri>
+ <context-root>/test</context-root>
+ </web>
+ </module>
+ <module>
+ <ejb>test.jar</ejb>
+ </module>
+</application>
Property changes on: arquillian/trunk/containers/jsr88
___________________________________________________________________
Name: svn:ignore
+ target
Added: arquillian/trunk/containers/jsr88/pom.xml
===================================================================
--- arquillian/trunk/containers/jsr88/pom.xml (rev 0)
+++ arquillian/trunk/containers/jsr88/pom.xml 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-build</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../build/pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-jsr88</artifactId>
+ <name>Arquillian JSR 88-compliant Remote Container</name>
+ <description>JSR 88-compliant Remote Container integration for the Arquillian Project</description>
+
+ <properties>
+ <version.glassfish>3.0.1-b19</version.glassfish>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-spi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.protocol</groupId>
+ <artifactId>arquillian-protocol-servlet-ee6</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.packager</groupId>
+ <artifactId>arquillian-packager-javaee</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.testenricher</groupId>
+ <artifactId>arquillian-testenricher-cdi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.testenricher</groupId>
+ <artifactId>arquillian-testenricher-ejb</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.testenricher</groupId>
+ <artifactId>arquillian-testenricher-resource</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.spec.javax.enterprise.deploy</groupId>
+ <artifactId>jboss-jad-api_1.2_spec</artifactId>
+ <version>1.0.0.Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-api</artifactId>
+ <version>3.1.0</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.spec.javax.servlet</groupId>
+ <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <version>1.0.0.Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-impl-base</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-impl-base</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-junit</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+
+ <profile>
+ <id>glassfish-client</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.glassfish.deployment</groupId>
+ <artifactId>deployment-client</artifactId>
+ <version>${version.glassfish}</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources-glassfish</directory>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <!-- enable tests when GlassFish is setup on Hudson server -->
+ <skip>true</skip>
+ <includes>
+ <include>**/*TestSuite.java</include>
+ </includes>
+ <systemPropertyVariables>
+ <glassfish.install.dir>${env.GLASSFISH_HOME}</glassfish.install.dir>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- Doesn't work yet. Deployment times out. -->
+ <!--
+ <profile>
+ <id>jbossas-client</id>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-deployment</artifactId>
+ <version>6.0.0.M1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources-jbossas</directory>
+ </testResource>
+ </testResources>
+ </build>
+ </profile>
+ -->
+
+ </profiles>
+</project>
Added: arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/EE5DeploymentAppender.java
===================================================================
--- arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/EE5DeploymentAppender.java (rev 0)
+++ arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/EE5DeploymentAppender.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,49 @@
+/*
+ * 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.container.jsr88;
+
+import org.jboss.arquillian.spi.AuxiliaryArchiveAppender;
+import org.jboss.arquillian.spi.TestEnricher;
+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 JSR 88 container plugin
+ * to run in container.
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @author Dan Allen
+ */
+public class EE5DeploymentAppender implements AuxiliaryArchiveAppender
+{
+ public Archive<?> createAuxiliaryArchive()
+ {
+ JavaArchive archive = ShrinkWrap.create("arquillian-ee5-container-testenrichers.jar", JavaArchive.class)
+ .addPackages(
+ true,
+ EJBInjectionEnricher.class.getPackage(),
+ ResourceInjectionEnricher.class.getPackage())
+ .addServiceProvider(
+ TestEnricher.class,
+ EJBInjectionEnricher.class,
+ ResourceInjectionEnricher.class);
+ return archive;
+ }
+}
Added: arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/EE6DeploymentAppender.java
===================================================================
--- arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/EE6DeploymentAppender.java (rev 0)
+++ arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/EE6DeploymentAppender.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,52 @@
+/*
+ * 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.container.jsr88;
+
+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 JSR 88 container plugin
+ * to run in container.
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @author Dan Allen
+ */
+public class EE6DeploymentAppender implements AuxiliaryArchiveAppender
+{
+ public Archive<?> createAuxiliaryArchive()
+ {
+ JavaArchive archive = ShrinkWrap.create("arquillian-ee6-container-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;
+ }
+}
Added: arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88Configuration.java
===================================================================
--- arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88Configuration.java (rev 0)
+++ arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88Configuration.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,124 @@
+/*
+ * 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.container.jsr88;
+
+import org.jboss.arquillian.spi.ContainerConfiguration;
+import org.jboss.arquillian.spi.ContainerProfile;
+
+/**
+ * A {@link org.jboss.arquillian.spi.ContainerConfiguration} implementation for
+ * a JSR 88-compliant container. The required configuration settings are the
+ * deployment URI and the deployment factory class.
+ *
+ * @author Dan Allen
+ * @author Iskandar Salim
+ * @see http://jcp.org/en/jsr/detail?id=88
+ */
+public class JSR88Configuration implements ContainerConfiguration
+{
+ private int remoteServerHttpPort = 8080;
+ private String remoteServerAddress = "localhost";
+ private String deploymentUri = "";
+ private String deploymentUsername = "";
+ private String deploymentPassword = "";
+ private String deploymentFactoryClass = "";
+ private int deploymentTimeoutSeconds = 5;
+
+ public JSR88Configuration()
+ {
+ setDefaults();
+ }
+
+ protected void setDefaults()
+ {
+ }
+
+ public ContainerProfile getContainerProfile()
+ {
+ return ContainerProfile.CLIENT;
+ }
+
+ public int getRemoteServerHttpPort()
+ {
+ return remoteServerHttpPort;
+ }
+
+ public void setRemoteServerHttpPort(int remoteServerHttpPort)
+ {
+ this.remoteServerHttpPort = remoteServerHttpPort;
+ }
+
+ public String getRemoteServerAddress()
+ {
+ return remoteServerAddress;
+ }
+
+ public void setRemoteServerAddress(String remoteServerAddress)
+ {
+ this.remoteServerAddress = remoteServerAddress;
+ }
+
+ public String getDeploymentFactoryClass()
+ {
+ return deploymentFactoryClass;
+ }
+
+ public void setDeploymentFactoryClass(String deploymentFactoryClass)
+ {
+ this.deploymentFactoryClass = deploymentFactoryClass;
+ }
+
+ public String getDeploymentPassword()
+ {
+ return deploymentPassword;
+ }
+
+ public void setDeploymentPassword(String deploymentPassword)
+ {
+ this.deploymentPassword = deploymentPassword;
+ }
+
+ public String getDeploymentUri()
+ {
+ return deploymentUri;
+ }
+
+ public void setDeploymentUri(String deploymentUri)
+ {
+ this.deploymentUri = deploymentUri;
+ }
+
+ public String getDeploymentUsername()
+ {
+ return deploymentUsername;
+ }
+
+ public void setDeploymentUsername(String deploymentUsername)
+ {
+ this.deploymentUsername = deploymentUsername;
+ }
+
+ public int getDeploymentTimeoutSeconds()
+ {
+ return deploymentTimeoutSeconds;
+ }
+
+ public void setDeploymentTimeoutSeconds(int deploymentTimeoutSeconds)
+ {
+ this.deploymentTimeoutSeconds = deploymentTimeoutSeconds;
+ }
+}
Added: arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88DeploymentListener.java
===================================================================
--- arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88DeploymentListener.java (rev 0)
+++ arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88DeploymentListener.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,85 @@
+/*
+ * 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.container.jsr88;
+
+import java.util.logging.Logger;
+import javax.enterprise.deploy.shared.CommandType;
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.status.DeploymentStatus;
+import javax.enterprise.deploy.spi.status.ProgressEvent;
+import javax.enterprise.deploy.spi.status.ProgressListener;
+import javax.enterprise.deploy.spi.status.ProgressObject;
+
+/**
+ * Listens for JSR 88 deployment events to update the deployed state
+ * of the module.
+ *
+ * <p>During distribution (deployment), this listener observes the completed
+ * operation and subsequently starts the module, marking the module as
+ * started when the start operation is complete.</p>
+ *
+ * <p>During undeployment, this listener observes the completed operation
+ * and marks the module as not started.</p>
+ *
+ * @author Dan Allen
+ * @author Iskandar Salim
+ */
+class JSR88DeploymentListener implements ProgressListener
+{
+ private static final Logger log = Logger.getLogger(JSR88RemoteContainer.class.getName());
+
+ private JSR88RemoteContainer container;
+ private TargetModuleID[] ids;
+ private CommandType type;
+
+ JSR88DeploymentListener(JSR88RemoteContainer container, TargetModuleID[] moduleIds, CommandType type)
+ {
+ this.container = container;
+ this.ids = moduleIds;
+ this.type = type;
+ }
+
+ @Override
+ public void handleProgressEvent(ProgressEvent event)
+ {
+ DeploymentStatus status = event.getDeploymentStatus();
+ log.info(status.getMessage());
+ if (status.isCompleted())
+ {
+ if (type.equals(CommandType.DISTRIBUTE))
+ {
+ ProgressObject startProgress = container.getDeploymentManager().start(ids);
+ startProgress.addProgressListener(new ProgressListener()
+ {
+ @Override
+ public void handleProgressEvent(ProgressEvent startEvent)
+ {
+ log.info(startEvent.getDeploymentStatus().getMessage());
+ if (startEvent.getDeploymentStatus().isCompleted())
+ {
+ container.moduleStarted(true);
+ }
+ }
+ });
+ }
+ else if (type.equals(CommandType.UNDEPLOY))
+ {
+ container.moduleStarted(false);
+ }
+ }
+ }
+}
Added: arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88ModuleTypeMapper.java
===================================================================
--- arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88ModuleTypeMapper.java (rev 0)
+++ arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88ModuleTypeMapper.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,52 @@
+/*
+ * 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.container.jsr88;
+
+import javax.enterprise.deploy.shared.ModuleType;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+/**
+ * A mapper that determines the JSR 88 {@link ModuleType} of a ShrinkWrap archive.
+ *
+ * @author Dan Allen
+ */
+public class JSR88ModuleTypeMapper
+{
+ public JSR88ModuleTypeMapper()
+ {
+ }
+
+ public ModuleType getModuleType(Archive<?> archive)
+ {
+ if (archive instanceof WebArchive)
+ {
+ return ModuleType.WAR;
+ }
+ if (archive instanceof EnterpriseArchive)
+ {
+ return ModuleType.EAR;
+ }
+ if (archive instanceof ResourceAdapterArchive)
+ {
+ return ModuleType.RAR;
+ }
+ return ModuleType.EJB;
+ }
+}
Added: arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainer.java
===================================================================
--- arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainer.java (rev 0)
+++ arquillian/trunk/containers/jsr88/src/main/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainer.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,360 @@
+/*
+ * 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.container.jsr88;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.enterprise.deploy.shared.CommandType;
+import javax.enterprise.deploy.shared.factories.DeploymentFactoryManager;
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.factories.DeploymentFactory;
+import javax.enterprise.deploy.spi.status.ProgressObject;
+
+import org.jboss.arquillian.protocol.servlet.ServletMethodExecutor;
+import org.jboss.arquillian.spi.Configuration;
+import org.jboss.arquillian.spi.ContainerConfiguration;
+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.api.ArchivePath;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+
+/**
+ * A container implementation for a JSR 88-compliant container.
+ *
+ * <p>This class distributes (deploys) and undeploys ShrinkWrap
+ * archives using the JSR-88 {@link DeploymentManager}. A connection
+ * to the container is established during the start method and
+ * released in the stop method. The deploy and undeploy methods use
+ * {@link DeploymentManager#distribute(Target[], ModuleType, InputStream, InputStream)} and
+ * {@link DeploymentManager#undeploy(TargetModuleID[])}, respectively.</p>
+ *
+ * <p>You can use this container implementation either through configuration
+ * or extension. To use it via configuration, assign the deployment URI and
+ * deployment factory class for the target container to the {@link JSR88Configuration}
+ * object using the Arquillian configuration file (arquillian.xml). Alternatively,
+ * you can choose to extend the {@link JSR88Configuration} to assign defaults for
+ * these values. You should also specify the configuration class by overriding the
+ * {@link JSR88CompliantRemoteContainer#getContainerConfigurationClass()}
+ * method.</p>
+ *
+ * <p>JSR 88 deploys the archive using an {@link InputStream}. The deployed
+ * archive is assigned a random name. You can specify a custom name for
+ * a war in the <code>module-name</code> element of the module deployment
+ * descriptor (web.xml).</p>
+ *
+ * @author Dan Allen
+ * @author Iskandar Salim
+ * @see org.glassfish.admin.cli.resources.AddResources
+ */
+public class JSR88RemoteContainer implements DeployableContainer
+{
+ public static final String HTTP_PROTOCOL = "http";
+ public static final ArchivePath MODULE_ID_STORE_PATH = ArchivePaths.create(".jsr88-module-id");
+
+ private static final CyclicBarrier PROGRESS_BARRIER = new CyclicBarrier(2);
+
+ private static final Logger log = Logger.getLogger(JSR88RemoteContainer.class.getName());
+
+ private JSR88ModuleTypeMapper moduleTypeMapper;
+ private DeploymentManager deploymentManager;
+ private boolean moduleStarted = false;
+
+ private JSR88Configuration containerConfig;
+
+ public JSR88RemoteContainer()
+ {
+ moduleTypeMapper = new JSR88ModuleTypeMapper();
+ }
+
+ public void setup(Context context, Configuration arquillianConfig)
+ {
+ // I'm doing something wrong w/ the generics to require a cast
+ containerConfig = (JSR88Configuration) arquillianConfig.getContainerConfig(getContainerConfigurationClass());
+ }
+
+ public void start(Context context) throws LifecycleException
+ {
+ try
+ {
+ initDeploymentManager(containerConfig.getDeploymentFactoryClass(),
+ containerConfig.getDeploymentUri(),
+ containerConfig.getDeploymentUsername(),
+ containerConfig.getDeploymentPassword());
+ }
+ catch (Exception e)
+ {
+ throw new LifecycleException("Could not connect to container", e);
+ }
+ }
+
+ public void stop(Context context) throws LifecycleException
+ {
+ try
+ {
+ releaseDeploymentManager();
+ }
+ catch (Exception e)
+ {
+ throw new LifecycleException("Could not release deployment manager", e);
+ }
+ }
+
+ public ContainerMethodExecutor deploy(Context context, Archive<?> archive) throws DeploymentException
+ {
+ if (deploymentManager == null)
+ {
+ throw new DeploymentException("Could not deploy since deployment manager was not loaded");
+ }
+
+ String moduleId = null;
+ try {
+ PROGRESS_BARRIER.reset();
+ resetModuleStatus();
+ ProgressObject progress = deploymentManager.distribute(
+ deploymentManager.getTargets(), moduleTypeMapper.getModuleType(archive),
+ archive.as(ZipExporter.class).exportZip(), null);
+ // QUESTION when is getResultTargetModuleIDs() > 0?
+ progress.addProgressListener(new JSR88DeploymentListener(this, progress.getResultTargetModuleIDs(), CommandType.DISTRIBUTE));
+ waitForModuleToStart();
+ moduleId = progress.getResultTargetModuleIDs()[0].getModuleID();
+ storeModuleIdInArchive(archive, moduleId);
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Could not deploy archive", e);
+ }
+
+ if (moduleId == null)
+ {
+ throw new DeploymentException("Could not determine module id, likely because module did not deploy");
+ }
+
+ try
+ {
+ // FIXME pass moduleId to ServletMethodExecutor since we can't guarantee anymore it's /test
+ return new ServletMethodExecutor(
+ new URL(
+ HTTP_PROTOCOL,
+ containerConfig.getRemoteServerAddress(),
+ containerConfig.getRemoteServerHttpPort(),
+ "/")
+ );
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Could not create ContainerMethodExecutor", e);
+ }
+ }
+
+ public void undeploy(Context context, Archive<?> archive) throws DeploymentException
+ {
+ if (!moduleStarted)
+ {
+ log.info("Skipping undeploy since module is not deployed");
+ return;
+ }
+
+ if (deploymentManager == null)
+ {
+ throw new DeploymentException("Could not undeploy since deployment manager was not loaded");
+ }
+
+ try
+ {
+ PROGRESS_BARRIER.reset();
+ String moduleId = null;
+ try
+ {
+ moduleId = retrieveModuleIdFromArchive(archive);
+ }
+ catch (IOException ioe)
+ {
+ log.log(Level.INFO, "Skipping undeploy since module ID could not be determined", ioe);
+ return;
+ }
+
+ TargetModuleID[] availableModuleIDs = deploymentManager.getAvailableModules(
+ moduleTypeMapper.getModuleType(archive), getDeploymentManager().getTargets());
+ TargetModuleID targetModuleID = null;
+ for (TargetModuleID candidate : availableModuleIDs)
+ {
+ if (candidate.getModuleID().equals(moduleId))
+ {
+ targetModuleID = candidate;
+ break;
+ }
+ }
+
+ if (targetModuleID != null)
+ {
+ TargetModuleID[] targetModuleIDs = { targetModuleID };
+ ProgressObject progress = deploymentManager.undeploy(targetModuleIDs);
+ progress.addProgressListener(new JSR88DeploymentListener(this, targetModuleIDs, CommandType.UNDEPLOY));
+ waitForModuleToUndeploy();
+ }
+ else
+ {
+ resetModuleStatus();
+ log.info("Undeploy skipped since could not locate module in list of deployed modules");
+ }
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Could not undeploy module", e);
+ }
+ }
+
+ public Class<? extends ContainerConfiguration> getContainerConfigurationClass()
+ {
+ return JSR88Configuration.class;
+ }
+
+ public DeploymentManager getDeploymentManager()
+ {
+ return deploymentManager;
+ }
+
+ protected DeploymentManager initDeploymentManager(String factoryClass, String uri, String username, String password) throws Exception
+ {
+ if (deploymentManager == null)
+ {
+ DeploymentFactoryManager dfm = DeploymentFactoryManager.getInstance();
+ dfm.registerDeploymentFactory(
+ (DeploymentFactory) Class.forName(factoryClass).newInstance());
+ deploymentManager =
+ dfm.getDeploymentManager(uri, username, password);
+ }
+ return deploymentManager;
+ }
+
+ protected void releaseDeploymentManager()
+ {
+ if (deploymentManager != null)
+ {
+ deploymentManager.release();
+ }
+ }
+
+ public boolean isModuleStarted()
+ {
+ return moduleStarted;
+ }
+
+ void moduleStarted(boolean status)
+ {
+ moduleStarted = status;
+ if (PROGRESS_BARRIER.getNumberWaiting() > 0)
+ {
+ try
+ {
+ PROGRESS_BARRIER.await();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Failed to report module as " + (status ? "started" : "shutdown"), e);
+ }
+ }
+ }
+
+ protected void resetModuleStatus()
+ {
+ moduleStarted = false;
+ }
+
+ private void waitForModuleToStart()
+ {
+ if (!moduleStarted)
+ {
+ try
+ {
+ PROGRESS_BARRIER.await(containerConfig.getDeploymentTimeoutSeconds(), TimeUnit.SECONDS);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Module startup was interrupted or timed out", e);
+ }
+ }
+ }
+
+ private void waitForModuleToUndeploy()
+ {
+ if (moduleStarted)
+ {
+ try
+ {
+ PROGRESS_BARRIER.await(containerConfig.getDeploymentTimeoutSeconds(), TimeUnit.SECONDS);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Module undeployment was interrupted or timed out", e);
+ }
+ }
+ }
+
+ private void storeModuleIdInArchive(Archive<?> archive, String moduleId)
+ {
+ archive.add(new StringAsset(moduleId), MODULE_ID_STORE_PATH);
+ }
+
+ private String retrieveModuleIdFromArchive(Archive<?> archive) throws IOException
+ {
+ if (!archive.contains(MODULE_ID_STORE_PATH)) {
+ throw new IOException("Module ID store file not found in archive");
+ }
+
+ String moduleId = new BufferedReader(new InputStreamReader(
+ archive.get(MODULE_ID_STORE_PATH).getAsset().openStream(), "UTF-8")).readLine();
+
+ if (moduleId == null || moduleId.trim().length() == 0) {
+ throw new IOException("Module ID store file was empty");
+ }
+ archive.delete(MODULE_ID_STORE_PATH);
+
+ return moduleId.trim();
+ }
+
+ // required as StringAsset is in ShrinkWrap impl-base
+ static class StringAsset implements Asset
+ {
+ private String content;
+
+ StringAsset(String content)
+ {
+ this.content = content;
+ }
+
+ public InputStream openStream()
+ {
+ return new ByteArrayInputStream(content.getBytes());
+ }
+ }
+}
Added: arquillian/trunk/containers/jsr88/src/main/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender
===================================================================
--- arquillian/trunk/containers/jsr88/src/main/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender (rev 0)
+++ arquillian/trunk/containers/jsr88/src/main/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,2 @@
+# Defining the DeployableContainer here locks the JSR 88 support into a specific EE version
+#org.jboss.arquillian.container.jsr88.EE6DeploymentAppender
Added: arquillian/trunk/containers/jsr88/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration
===================================================================
--- arquillian/trunk/containers/jsr88/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration (rev 0)
+++ arquillian/trunk/containers/jsr88/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,2 @@
+# Defining the DeployableContainer here breaks container extension because Arquillian forbids multiple implementations
+#org.jboss.arquillian.container.jsr88.JSR88Configuration
Added: arquillian/trunk/containers/jsr88/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer
===================================================================
--- arquillian/trunk/containers/jsr88/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer (rev 0)
+++ arquillian/trunk/containers/jsr88/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,2 @@
+# Defining the DeployableContainer here breaks container extension because Arquillian forbids multiple implementations
+#org.jboss.arquillian.container.jsr88.JSR88RemoteContainer
Added: arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/Greeter.java
===================================================================
--- arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/Greeter.java (rev 0)
+++ arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/Greeter.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,28 @@
+/*
+ * 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.container.jsr88;
+
+import javax.ejb.Stateless;
+
+ at Stateless
+public class Greeter
+{
+ public String greet()
+ {
+ return "hello";
+ }
+}
Added: arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/GreeterServlet.java
===================================================================
--- arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/GreeterServlet.java (rev 0)
+++ arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/GreeterServlet.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,45 @@
+/*
+ * 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.container.jsr88;
+
+import java.io.IOException;
+import javax.ejb.EJB;
+
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * GreeterServlet
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ */
+ at WebServlet(urlPatterns = "/Greeter")
+public class GreeterServlet extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ @EJB private Greeter greeter;
+
+ @Override
+ protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ {
+ response.getWriter().append(greeter.greet());
+ }
+}
Added: arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88ModuleTypeMapperTestCase.java
===================================================================
--- arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88ModuleTypeMapperTestCase.java (rev 0)
+++ arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88ModuleTypeMapperTestCase.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,79 @@
+/*
+ * 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.container.jsr88;
+
+import javax.enterprise.deploy.shared.ModuleType;
+import static org.junit.Assert.*;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+
+/**
+ * A test that verifies the {@link JSR88ModuleTypeMapper} returns
+ * the correct JSR 88 {@link ModuleType} of a ShrinkWrap archive.
+ *
+ * @author Dan Allen
+ */
+public class JSR88ModuleTypeMapperTestCase
+{
+ @Test
+ public void testWARModuleType()
+ {
+ Archive<?> archive = ShrinkWrap.create("test.war", WebArchive.class);
+ assertSame(ModuleType.WAR, getMapper().getModuleType(archive));
+ }
+
+ @Test
+ public void testEARModuleType()
+ {
+ Archive<?> archive = ShrinkWrap.create("test.ear", EnterpriseArchive.class);
+ assertSame(ModuleType.EAR, getMapper().getModuleType(archive));
+ }
+
+ @Test
+ public void testEJBModuleType()
+ {
+ Archive<?> archive = ShrinkWrap.create("test.jar", JavaArchive.class);
+ assertSame(ModuleType.EJB, getMapper().getModuleType(archive));
+ }
+
+ @Test
+ public void testRARModuleType()
+ {
+ Archive<?> archive = ShrinkWrap.create("test.rar", ResourceAdapterArchive.class);
+ assertSame(ModuleType.RAR, getMapper().getModuleType(archive));
+ }
+
+ @Test
+ public void testSequentialUsage()
+ {
+ JSR88ModuleTypeMapper mapper = getMapper();
+ Archive<?> rar = ShrinkWrap.create("test.rar", ResourceAdapterArchive.class);
+ assertSame(ModuleType.RAR, mapper.getModuleType(rar));
+ Archive<?> war = ShrinkWrap.create("test.war", WebArchive.class);
+ assertSame(ModuleType.WAR, mapper.getModuleType(war));
+ }
+
+ private JSR88ModuleTypeMapper getMapper()
+ {
+ return new JSR88ModuleTypeMapper();
+ }
+}
Added: arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainerEARTestCase.java
===================================================================
--- arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainerEARTestCase.java (rev 0)
+++ arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainerEARTestCase.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,107 @@
+/*
+ * 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.container.jsr88;
+
+import static org.jboss.arquillian.api.RunModeType.AS_CLIENT;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.servlet.annotation.WebServlet;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.api.Run;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ArchivePath;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+/**
+ * Verifies that the an Arquillian test can be run in client
+ * mode with a the JSR 88 Remote container for GlassFish.
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ * @author Dan Allen
+ */
+ at RunWith(Arquillian.class)
+ at Run(AS_CLIENT)
+public class JSR88RemoteContainerEARTestCase
+{
+ /**
+ * Logger
+ */
+ private static final Logger log = Logger.getLogger(JSR88RemoteContainerEARTestCase.class.getName());
+
+ /**
+ * Deployment for the test
+ * @return
+ */
+ @Deployment
+ public static Archive<?> getTestArchive()
+ {
+ ArchivePath root = ArchivePaths.create("/");
+ final WebArchive war = ShrinkWrap.create("test.war", WebArchive.class)
+ .addClasses(GreeterServlet.class);
+ final JavaArchive ejb = ShrinkWrap.create("test.jar", JavaArchive.class)
+ .addClass(Greeter.class);
+ final EnterpriseArchive ear = ShrinkWrap.create("test.ear", EnterpriseArchive.class)
+ .setApplicationXML("application.xml")
+ .add(war, root)
+ .add(ejb, root);
+ log.info(ear.toString(true));
+ return ear;
+ }
+
+ @Test
+ public void shouldBeAbleToDeployWebArchive() throws Exception
+ {
+ String servletPath = GreeterServlet.class.getAnnotation(WebServlet.class).urlPatterns()[0];
+ String body = readAllAndClose(new URL("http://localhost:8080/test" + servletPath).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();
+ }
+}
Added: arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainerTestSuite.java
===================================================================
--- arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainerTestSuite.java (rev 0)
+++ arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainerTestSuite.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,70 @@
+/*
+ * 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.container.jsr88;
+
+import java.io.File;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ * A JUnit 4 test suite that manages the lifecycle of a locally-installed
+ * GlassFish instance in order to test the JSR 88 deployment.
+ *
+ * <p>This class relies on the system property glassfish.install.dir
+ * to point to a valid installation of GlassFish v3.</p>
+ *
+ * @author Dan Allen
+ */
+ at RunWith(Suite.class)
+ at SuiteClasses({
+ JSR88RemoteContainerWARTestCase.class,
+ JSR88RemoteContainerEARTestCase.class})
+public class JSR88RemoteContainerTestSuite
+{
+ @BeforeClass
+ public static void startContainer() throws Exception
+ {
+ Runtime.getRuntime().exec(new String[] {
+ getAsadminCommand(),
+ "start-domain",
+ "tests"}).waitFor();
+ }
+
+ @AfterClass
+ public static void stopContainer() throws Exception
+ {
+ Runtime.getRuntime().exec(new String[] {
+ getAsadminCommand(),
+ "stop-domain",
+ "tests"}).waitFor();
+ }
+
+ public static String getAsadminCommand()
+ {
+ File asadminFile = new File(System.getProperty("glassfish.install.dir") +
+ File.separator + "bin" + File.separator + "asadmin");
+ if (!asadminFile.exists() || !asadminFile.isFile())
+ {
+ Assert.fail("Path to asadmin command is invalid: " + asadminFile.getAbsolutePath());
+ }
+ return asadminFile.getAbsolutePath();
+ }
+}
Added: arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainerWARTestCase.java
===================================================================
--- arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainerWARTestCase.java (rev 0)
+++ arquillian/trunk/containers/jsr88/src/test/java/org/jboss/arquillian/container/jsr88/JSR88RemoteContainerWARTestCase.java 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,97 @@
+/*
+ * 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.container.jsr88;
+
+import static org.jboss.arquillian.api.RunModeType.AS_CLIENT;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.servlet.annotation.WebServlet;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.api.Run;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.Archive;
+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;
+
+
+/**
+ * Verifies that the an Arquillian test can be run in client
+ * mode with a the JSR 88 Remote container for GlassFish.
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ * @author Dan Allen
+ */
+ at RunWith(Arquillian.class)
+ at Run(AS_CLIENT)
+public class JSR88RemoteContainerWARTestCase
+{
+ /**
+ * Logger
+ */
+ private static final Logger log = Logger.getLogger(JSR88RemoteContainerWARTestCase.class.getName());
+
+ /**
+ * Deployment for the test
+ * @return
+ */
+ @Deployment
+ public static Archive<?> getTestArchive()
+ {
+ final WebArchive war = ShrinkWrap.create("test.war", WebArchive.class)
+ .addClasses(GreeterServlet.class, Greeter.class)
+ .setWebXML("web.xml");
+ log.info(war.toString(true));
+ return war;
+ }
+
+ @Test
+ public void shouldBeAbleToDeployWebArchive() throws Exception
+ {
+ String servletPath = GreeterServlet.class.getAnnotation(WebServlet.class).urlPatterns()[0];
+ String body = readAllAndClose(new URL("http://localhost:8080/test" + servletPath).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();
+ }
+}
Added: arquillian/trunk/containers/jsr88/src/test/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender
===================================================================
--- arquillian/trunk/containers/jsr88/src/test/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender (rev 0)
+++ arquillian/trunk/containers/jsr88/src/test/resources/META-INF/services/org.jboss.arquillian.spi.AuxiliaryArchiveAppender 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1 @@
+org.jboss.arquillian.container.jsr88.EE6DeploymentAppender
Added: arquillian/trunk/containers/jsr88/src/test/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration
===================================================================
--- arquillian/trunk/containers/jsr88/src/test/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration (rev 0)
+++ arquillian/trunk/containers/jsr88/src/test/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1 @@
+org.jboss.arquillian.container.jsr88.JSR88Configuration
Added: arquillian/trunk/containers/jsr88/src/test/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer
===================================================================
--- arquillian/trunk/containers/jsr88/src/test/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer (rev 0)
+++ arquillian/trunk/containers/jsr88/src/test/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1 @@
+org.jboss.arquillian.container.jsr88.JSR88RemoteContainer
Added: arquillian/trunk/containers/jsr88/src/test/resources/application.xml
===================================================================
--- arquillian/trunk/containers/jsr88/src/test/resources/application.xml (rev 0)
+++ arquillian/trunk/containers/jsr88/src/test/resources/application.xml 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application version="5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd">
+ <module>
+ <web>
+ <web-uri>test.war</web-uri>
+ <context-root>/test</context-root>
+ </web>
+ </module>
+ <module>
+ <ejb>test.jar</ejb>
+ </module>
+</application>
Added: arquillian/trunk/containers/jsr88/src/test/resources/web.xml
===================================================================
--- arquillian/trunk/containers/jsr88/src/test/resources/web.xml (rev 0)
+++ arquillian/trunk/containers/jsr88/src/test/resources/web.xml 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="3.0"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+ <!-- JSR-88 derives the name of the distributed archive from the module-name element -->
+ <module-name>test</module-name>
+</web-app>
Added: arquillian/trunk/containers/jsr88/src/test/resources-glassfish/arquillian.xml
===================================================================
--- arquillian/trunk/containers/jsr88/src/test/resources-glassfish/arquillian.xml (rev 0)
+++ arquillian/trunk/containers/jsr88/src/test/resources-glassfish/arquillian.xml 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,10 @@
+<arquillian xmlns="http://jboss.com/arquillian"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:jsr88="urn:arq:org.jboss.arquillian.container.jsr88">
+
+ <jsr88:container>
+ <jsr88:deploymentUri>deployer:Sun:AppServer::localhost:4848</jsr88:deploymentUri>
+ <jsr88:deploymentFactoryClass>org.glassfish.deployapi.SunDeploymentFactory</jsr88:deploymentFactoryClass>
+ </jsr88:container>
+
+</arquillian>
Added: arquillian/trunk/containers/jsr88/src/test/resources-jbossas/arquillian.xml
===================================================================
--- arquillian/trunk/containers/jsr88/src/test/resources-jbossas/arquillian.xml (rev 0)
+++ arquillian/trunk/containers/jsr88/src/test/resources-jbossas/arquillian.xml 2010-06-12 18:53:47 UTC (rev 4513)
@@ -0,0 +1,10 @@
+<arquillian xmlns="http://jboss.com/arquillian"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:jsr88="urn:arq:org.jboss.arquillian.container.jsr88">
+
+ <jsr88:container>
+ <jsr88:deploymentUri>http://org.jboss.deployment/jsr88</jsr88:deploymentUri>
+ <jsr88:deploymentFactoryClass>org.jboss.deployment.spi.factories.DeploymentFactoryImpl</jsr88:deploymentFactoryClass>
+ </jsr88:container>
+
+</arquillian>
More information about the jboss-svn-commits
mailing list