[jboss-svn-commits] JBoss Common SVN: r3732 - in arquillian/trunk: api and 18 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Nov 16 06:39:04 EST 2009
Author: aslak
Date: 2009-11-16 06:39:03 -0500 (Mon, 16 Nov 2009)
New Revision: 3732
Added:
arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Deployment.java
arquillian/trunk/container-jboss-embedded/src/main/java/org/jboss/arquillian/jboss/InjectionEnricher.java
arquillian/trunk/container-jboss-embedded/src/main/java/org/jboss/arquillian/jboss/JbossEmbeddedContainer.java
arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/
arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/services/
arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer
arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/ArchiveGenerator.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/Deployer.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ContainerController.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ContainerDeployer.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/Controlable.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/DeployableContainers.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ForceRestartController.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/NoContainerController.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/TestEnrichers.java
arquillian/trunk/junit/src/main/resources/org/
arquillian/trunk/junit/src/main/resources/org/jboss/
arquillian/trunk/junit/src/main/resources/org/jboss/arquillian/
arquillian/trunk/junit/src/main/resources/org/jboss/arquillian/junit/
arquillian/trunk/junit/src/main/resources/org/jboss/arquillian/junit/test-web.xml
arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/LifecycleException.java
arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/TestEnricher.java
arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/TestMethodExecutor.java
arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/TestResult.java
Removed:
arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/ArchiveGenerator.java
arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Controlable.java
arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Deployer.java
arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Deployment.java
arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/TestMethodExecutor.java
arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/TestResult.java
arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/container/
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/JbossEmbeddedContainer.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ContainerController.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ContainerDeployer.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ForceRestartController.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/NoContainerController.java
Modified:
arquillian/trunk/api/pom.xml
arquillian/trunk/build/pom.xml
arquillian/trunk/demo/pom.xml
arquillian/trunk/impl-base/pom.xml
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/DeployableTest.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/DeployableTestBuilder.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/NullArtifactGenerator.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/ServletMethodExecutor.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/TestResultImpl.java
arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/UserCreatedArchiveGenerator.java
arquillian/trunk/junit/pom.xml
arquillian/trunk/junit/src/main/java/org/jboss/arquillian/junit/Arquillian.java
arquillian/trunk/junit/src/main/java/org/jboss/arquillian/junit/ServletTestRunner.java
arquillian/trunk/pom.xml
arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/DeployableContainer.java
Log:
ARQ-5 ARQ-6 ARQ-8 ARQ-17
- Upgraded to ShrinkWrap alpha-2
- Extracted api/impl to spi
- Added Jboss Embedded Container impl
- Added dynamic loading of DeployableContainer / TestEnricher
- Updated demo poms to match new struct
Modified: arquillian/trunk/api/pom.xml
===================================================================
--- arquillian/trunk/api/pom.xml 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/api/pom.xml 2009-11-16 11:39:03 UTC (rev 3732)
@@ -29,21 +29,9 @@
<!-- Dependencies -->
<dependencies>
<dependency>
- <groupId>org.jboss.tmpdpl</groupId>
- <artifactId>tmpdpl-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.tmpdpl</groupId>
- <artifactId>tmpdpl-api-shrinkwrap</artifactId>
- </dependency>
- <dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.jboss.shrinkwrap</groupId>
- <artifactId>shrinkwrap-impl-base</artifactId>
- </dependency>
</dependencies>
</project>
Deleted: arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/ArchiveGenerator.java
===================================================================
--- arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/ArchiveGenerator.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/ArchiveGenerator.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -1,32 +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.api;
-
-import org.jboss.shrinkwrap.api.Archive;
-
-/**
- * ArchiveGenerator
- *
- * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
- * @version $Revision: $
- */
-public interface ArchiveGenerator
-{
- // Packaging SPI
- Archive<?> generateArchive(Class<?> testCase);
-
-}
Deleted: arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Controlable.java
===================================================================
--- arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Controlable.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Controlable.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -1,32 +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.api;
-
-// TODO: throws ControllerException
-/**
- * Controlable
- *
- * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
- * @version $Revision: $
- */
-public interface Controlable
-{
- void start() throws Exception;
-
- void stop() throws Exception;
-
-}
Deleted: arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Deployer.java
===================================================================
--- arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Deployer.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Deployer.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -1,34 +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.api;
-
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.tmpdpl.api.container.DeploymentException;
-
-/**
- * Deployer
- *
- * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
- * @version $Revision: $
- */
-public interface Deployer
-{
-
- void deploy(Archive<?> archive) throws DeploymentException;
- void undeploy(Archive<?> archive) throws DeploymentException;
-
-}
Deleted: arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Deployment.java
===================================================================
--- arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Deployment.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Deployment.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -1,37 +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.api;
-
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Deployment
- *
- * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
- * @version $Revision: $
- */
- at Documented
- at Retention(RUNTIME)
- at Target(ElementType.METHOD)
-public @interface Deployment {
-
-}
Copied: arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Deployment.java (from rev 3710, arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Deployment.java)
===================================================================
--- arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Deployment.java (rev 0)
+++ arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Deployment.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,37 @@
+/*
+ * 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.api;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Deployment
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+ at Documented
+ at Retention(RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface Deployment {
+
+}
Deleted: arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/TestMethodExecutor.java
===================================================================
--- arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/TestMethodExecutor.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/TestMethodExecutor.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -1,33 +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.api;
-
-import java.lang.reflect.Method;
-
-/**
- * TestMethodExecutor
- *
- * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
- * @version $Revision: $
- */
-public interface TestMethodExecutor
-{
- Method getMethod();
- Object getInstance();
- void invoke() throws Throwable;
-
-}
Deleted: arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/TestResult.java
===================================================================
--- arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/TestResult.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/TestResult.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -1,63 +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.api;
-
-import java.io.Serializable;
-
-/**
- * A test result which may be serialized for communicate between client and
- * server
- *
- * @author Pete Muir
- *
- */
-public interface TestResult extends Serializable
-{
-
- /**
- * The test status
- * @author Pete Muir
- *
- */
- public enum Status
- {
- /**
- * The test passed
- */
- PASSED,
- /**
- * The test failed
- */
- FAILED,
- /**
- * The test was skipped due to some deployment problem
- */
- SKIPPED;
- }
-
- /**
- * Get the status of this test
- */
- public Status getStatus();
-
- /**
- * If the test failed, the exception that was thrown. It does not need to be
- * the root cause.
- */
- public Throwable getThrowable();
-
-}
\ No newline at end of file
Modified: arquillian/trunk/build/pom.xml
===================================================================
--- arquillian/trunk/build/pom.xml 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/build/pom.xml 2009-11-16 11:39:03 UTC (rev 3732)
@@ -28,9 +28,9 @@
<!-- Versioning -->
<version.junit_junit>4.6</version.junit_junit>
- <version.tmpdpl_tmpdpl>0.1.1-SNAPSHOT</version.tmpdpl_tmpdpl>
- <version.shrinkwrap_shrinkwrap>1.0.0-SNAPSHOT</version.shrinkwrap_shrinkwrap>
- <version.jboss_embedded>0.1.0-SNAPSHOT</version.jboss_embedded>
+ <version.shrinkwrap_shrinkwrap>1.0.0-alpha-2</version.shrinkwrap_shrinkwrap>
+ <version.jboss_embedded>0.1.0-SNAPSHOT</version.jboss_embedded>
+ <version.servlet_api>2.5</version.servlet_api>
</properties>
@@ -145,21 +145,6 @@
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>org.jboss.tmpdpl</groupId>
- <artifactId>tmpdpl-api</artifactId>
- <version>${version.tmpdpl_tmpdpl}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.tmpdpl</groupId>
- <artifactId>tmpdpl-api-shrinkwrap</artifactId>
- <version>${version.tmpdpl_tmpdpl}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.tmpdpl</groupId>
- <artifactId>tmpdpl-api-shrinkwrap</artifactId>
- <version>${version.tmpdpl_tmpdpl}</version>
- </dependency>
- <dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api</artifactId>
<version>${version.shrinkwrap_shrinkwrap}</version>
@@ -176,6 +161,11 @@
<type>jar</type>
<version>${version.jboss_embedded}</version>
</dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${version.servlet_api}</version>
+ </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Added: arquillian/trunk/container-jboss-embedded/src/main/java/org/jboss/arquillian/jboss/InjectionEnricher.java
===================================================================
--- arquillian/trunk/container-jboss-embedded/src/main/java/org/jboss/arquillian/jboss/InjectionEnricher.java (rev 0)
+++ arquillian/trunk/container-jboss-embedded/src/main/java/org/jboss/arquillian/jboss/InjectionEnricher.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,66 @@
+/*
+ * 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.jboss;
+
+import java.lang.reflect.Field;
+
+import javax.ejb.EJB;
+import javax.naming.InitialContext;
+
+import org.jboss.arquillian.spi.TestEnricher;
+
+/**
+ * InjectionEnricher
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class InjectionEnricher implements TestEnricher
+{
+ @Override
+ public void enrich(Object testCase)
+ {
+ injectClass(testCase);
+ }
+
+ void injectClass(Object testCase)
+ {
+ try
+ {
+ for(Field field : testCase.getClass().getDeclaredFields())
+ {
+ if(field.isAnnotationPresent(EJB.class))
+ {
+ Object ejb = lookupEJB(field);
+ field.setAccessible(true);
+ field.set(testCase, ejb);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Could not inject members", e);
+ }
+ }
+
+ private Object lookupEJB(Field field) throws Exception
+ {
+ // TODO: figure out test context ?
+ InitialContext context = new InitialContext();
+ return context.lookup("test/" + field.getType().getSimpleName() + "Bean/local");
+ }
+}
Copied: arquillian/trunk/container-jboss-embedded/src/main/java/org/jboss/arquillian/jboss/JbossEmbeddedContainer.java (from rev 3711, arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/JbossEmbeddedContainer.java)
===================================================================
--- arquillian/trunk/container-jboss-embedded/src/main/java/org/jboss/arquillian/jboss/JbossEmbeddedContainer.java (rev 0)
+++ arquillian/trunk/container-jboss-embedded/src/main/java/org/jboss/arquillian/jboss/JbossEmbeddedContainer.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -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.jboss;
+
+import org.jboss.arquillian.spi.DeployableContainer;
+import org.jboss.arquillian.spi.DeploymentException;
+import org.jboss.arquillian.spi.LifecycleException;
+import org.jboss.embedded.api.server.JBossASEmbeddedServer;
+import org.jboss.embedded.core.server.JBossASEmbeddedServerImpl;
+import org.jboss.shrinkwrap.api.Archive;
+
+/**
+ * JbossEmbeddedContainer
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class JbossEmbeddedContainer implements DeployableContainer
+{
+ private JBossASEmbeddedServer server;
+
+ public JbossEmbeddedContainer()
+ {
+ server = new JBossASEmbeddedServerImpl();
+ server.getConfiguration().bindAddress("localhost");
+ }
+
+ @Override
+ public void start() throws LifecycleException
+ {
+ try
+ {
+ server.start();
+ }
+ catch (Exception e)
+ {
+ throw new LifecycleException("Could not start container", e);
+ }
+ }
+
+ @Override
+ public void stop() throws LifecycleException
+ {
+ try
+ {
+ server.stop();
+ }
+ catch (Exception e)
+ {
+ throw new LifecycleException("Could not stop container", e);
+ }
+ }
+
+ @Override
+ public void deploy(Archive<?> archive) throws DeploymentException
+ {
+ try
+ {
+ server.deploy(archive);
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Could not deploy to container", e);
+ }
+ }
+
+ @Override
+ public void undeploy(Archive<?> archive) throws DeploymentException
+ {
+ try
+ {
+ server.undeploy(archive);
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Could not undeploy from container", e);
+ }
+ }
+}
Added: arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer
===================================================================
--- arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer (rev 0)
+++ arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1 @@
+org.jboss.arquillian.jboss.JbossEmbeddedContainer
\ No newline at end of file
Added: arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher
===================================================================
--- arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher (rev 0)
+++ arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1 @@
+org.jboss.arquillian.jboss.InjectionEnricher
\ No newline at end of file
Modified: arquillian/trunk/demo/pom.xml
===================================================================
--- arquillian/trunk/demo/pom.xml 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/demo/pom.xml 2009-11-16 11:39:03 UTC (rev 3732)
@@ -26,15 +26,19 @@
<dependencies>
<dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ <version>3.0</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-junit</artifactId>
<version>${version.org.jboss.arquillian_arquillian}</version>
</dependency>
<dependency>
- <groupId>org.jboss.embedded</groupId>
- <artifactId>jboss-embedded-assembly</artifactId>
- <version>${version.org.jboss.embedded_embedded}</version>
- <classifier>launcher</classifier>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-jboss-embedded</artifactId>
+ <version>${version.org.jboss.arquillian_arquillian}</version>
</dependency>
<dependency>
Modified: arquillian/trunk/impl-base/pom.xml
===================================================================
--- arquillian/trunk/impl-base/pom.xml 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/impl-base/pom.xml 2009-11-16 11:39:03 UTC (rev 3732)
@@ -32,7 +32,7 @@
<dependencies>
<!--
- org.jboss.shrinkwrap
+ org.jboss.arquillian
-->
<dependency>
<groupId>org.jboss.arquillian</groupId>
@@ -40,11 +40,16 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.jboss.embedded</groupId>
- <artifactId>jboss-embedded-assembly</artifactId>
- <classifier>launcher</classifier>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-spi</artifactId>
+ <version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+
<!--
External Projects
-->
Copied: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/ArchiveGenerator.java (from rev 3710, arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/ArchiveGenerator.java)
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/ArchiveGenerator.java (rev 0)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/ArchiveGenerator.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,32 @@
+/*
+ * 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.impl;
+
+import org.jboss.shrinkwrap.api.Archive;
+
+/**
+ * ArchiveGenerator
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public interface ArchiveGenerator
+{
+ // Packaging SPI
+ Archive<?> generateArchive(Class<?> testCase);
+
+}
Modified: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/DeployableTest.java
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/DeployableTest.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/DeployableTest.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -16,16 +16,11 @@
*/
package org.jboss.arquillian.impl;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
import java.lang.reflect.Method;
-import javax.naming.InitialContext;
-
-import org.jboss.arquillian.api.ArchiveGenerator;
-import org.jboss.arquillian.api.Controlable;
-import org.jboss.arquillian.api.Deployer;
-import org.jboss.arquillian.api.TestMethodExecutor;
+import org.jboss.arquillian.impl.container.Controlable;
+import org.jboss.arquillian.impl.container.TestEnrichers;
+import org.jboss.arquillian.spi.TestMethodExecutor;
import org.jboss.shrinkwrap.api.Archive;
/**
@@ -98,33 +93,9 @@
void injectClass(Object testCase)
{
- try
- {
- Class<? extends Annotation> ejbAnnotationClass = (Class<? extends Annotation>)Thread.currentThread()
- .getContextClassLoader().loadClass("javax.ejb.EJB");
-
- for(Field field : testCase.getClass().getDeclaredFields())
- {
- if(field.isAnnotationPresent(ejbAnnotationClass))
- {
- Object ejb = lookupEJB(field);
- field.setAccessible(true);
- field.set(testCase, ejb);
- }
- }
- }
- catch (Exception e)
- {
- throw new RuntimeException("Could not inject members", e);
- }
+ TestEnrichers.enrich(testCase);
}
- private Object lookupEJB(Field field) throws Exception
- {
- InitialContext context = new InitialContext();
- return context.lookup("test/" + field.getType().getSimpleName() + "Bean/local");
- }
-
void invokeMethod(Method testMethod, Class<?> testCase)
{
}
Modified: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/DeployableTestBuilder.java
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/DeployableTestBuilder.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/DeployableTestBuilder.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -18,10 +18,14 @@
import javax.security.auth.login.Configuration;
-import org.jboss.arquillian.api.Controlable;
-import org.jboss.arquillian.api.Deployer;
+import org.jboss.arquillian.impl.container.ContainerController;
+import org.jboss.arquillian.impl.container.ContainerDeployer;
+import org.jboss.arquillian.impl.container.Controlable;
+import org.jboss.arquillian.impl.container.DeployableContainers;
+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.tmpdpl.api.container.DeploymentException;
/**
* DeployableTestBuilder
@@ -41,14 +45,14 @@
if(DeployableTest.isInContainer())
{
- controller = new MockContainer();
- deployer = new MockContainer();
+ controller = new InContainerContainer();
+ deployer = new InContainerContainer();
}
else
{
- JbossEmbeddedContainer container = new JbossEmbeddedContainer();
- controller = container;
- deployer = container;
+ DeployableContainer container = DeployableContainers.load();
+ controller = new ContainerController(container);
+ deployer = new ContainerDeployer(container);
}
return new DeployableTest(
@@ -57,15 +61,15 @@
);
}
- private static class MockContainer implements Controlable, Deployer
+ private static class InContainerContainer implements Controlable, Deployer
{
@Override
- public void start() throws Exception
+ public void start() throws LifecycleException
{
}
@Override
- public void stop() throws Exception
+ public void stop() throws LifecycleException
{
}
Copied: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/Deployer.java (from rev 3710, arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Deployer.java)
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/Deployer.java (rev 0)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/Deployer.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,34 @@
+/*
+ * 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.impl;
+
+import org.jboss.arquillian.spi.DeploymentException;
+import org.jboss.shrinkwrap.api.Archive;
+
+/**
+ * Deployer
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public interface Deployer
+{
+
+ void deploy(Archive<?> archive) throws DeploymentException;
+ void undeploy(Archive<?> archive) throws DeploymentException;
+
+}
Deleted: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/JbossEmbeddedContainer.java
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/JbossEmbeddedContainer.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/JbossEmbeddedContainer.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -1,65 +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.impl;
-
-import org.jboss.arquillian.api.Controlable;
-import org.jboss.arquillian.api.Deployer;
-import org.jboss.embedded.api.server.JBossASEmbeddedServer;
-import org.jboss.embedded.core.server.JBossASEmbeddedServerImpl;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.tmpdpl.api.container.DeploymentException;
-
-/**
- * JbossEmbeddedContainer
- *
- * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
- * @version $Revision: $
- */
-public class JbossEmbeddedContainer implements Controlable, Deployer
-{
- private JBossASEmbeddedServer server;
-
- public JbossEmbeddedContainer()
- {
- server = new JBossASEmbeddedServerImpl();
- server.getConfiguration().bindAddress("localhost");
- }
-
- @Override
- public void start() throws Exception
- {
- server.start();
- }
-
- @Override
- public void stop() throws Exception
- {
- server.shutdown();
- }
-
- @Override
- public void deploy(Archive<?> archive) throws DeploymentException
- {
- server.deploy(archive);
- }
-
- @Override
- public void undeploy(Archive<?> archive) throws DeploymentException
- {
- server.undeploy(archive);
- }
-}
Modified: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/NullArtifactGenerator.java
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/NullArtifactGenerator.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/NullArtifactGenerator.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -16,7 +16,6 @@
*/
package org.jboss.arquillian.impl;
-import org.jboss.arquillian.api.ArchiveGenerator;
import org.jboss.shrinkwrap.api.Archive;
/**
Modified: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/ServletMethodExecutor.java
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/ServletMethodExecutor.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/ServletMethodExecutor.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -23,8 +23,8 @@
import java.net.URL;
import java.net.URLConnection;
-import org.jboss.arquillian.api.TestMethodExecutor;
-import org.jboss.arquillian.api.TestResult;
+import org.jboss.arquillian.spi.TestMethodExecutor;
+import org.jboss.arquillian.spi.TestResult;
/**
* ServletMethodExecutor
Modified: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/TestResultImpl.java
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/TestResultImpl.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/TestResultImpl.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -16,7 +16,7 @@
*/
package org.jboss.arquillian.impl;
-import org.jboss.arquillian.api.TestResult;
+import org.jboss.arquillian.spi.TestResult;
/**
* TestResultImpl
Modified: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/UserCreatedArchiveGenerator.java
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/UserCreatedArchiveGenerator.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/UserCreatedArchiveGenerator.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -18,7 +18,6 @@
import java.lang.reflect.Method;
-import org.jboss.arquillian.api.ArchiveGenerator;
import org.jboss.arquillian.api.Deployment;
import org.jboss.shrinkwrap.api.Archive;
Copied: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container (from rev 3684, arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/container)
Deleted: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ContainerController.java
===================================================================
--- arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/container/ContainerController.java 2009-11-13 12:47:53 UTC (rev 3684)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ContainerController.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -1,24 +0,0 @@
-package org.jboss.arquillian.api.container;
-
-import org.jboss.arquillian.api.Controlable;
-import org.jboss.tmpdpl.api.shrinkwrap.container.ArchiveContainer;
-
-public class ContainerController implements Controlable
-{
- private ArchiveContainer container;
-
- public ContainerController(ArchiveContainer containers)
- {
- this.container = containers;
- }
-
- public void start() throws Exception
- {
- //container.setup();
- }
-
- public void stop() throws Exception
- {
- //container.cleanup();
- }
-}
Copied: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ContainerController.java (from rev 3710, arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/container/ContainerController.java)
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ContainerController.java (rev 0)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ContainerController.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,47 @@
+/*
+ * 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.impl.container;
+
+import org.jboss.arquillian.spi.DeployableContainer;
+import org.jboss.arquillian.spi.LifecycleException;
+
+
+/**
+ * ContainerController
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class ContainerController implements Controlable
+{
+ private DeployableContainer container;
+
+ public ContainerController(DeployableContainer container)
+ {
+ this.container = container;
+ }
+
+ public void start() throws LifecycleException
+ {
+ container.start();
+ }
+
+ public void stop() throws LifecycleException
+ {
+ container.stop();
+ }
+}
Deleted: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ContainerDeployer.java
===================================================================
--- arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/container/ContainerDeployer.java 2009-11-13 12:47:53 UTC (rev 3684)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ContainerDeployer.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -1,48 +0,0 @@
-package org.jboss.arquillian.api.container;
-
-import org.jboss.arquillian.api.Deployer;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.tmpdpl.api.container.DeploymentException;
-import org.jboss.tmpdpl.api.shrinkwrap.container.ArchiveContainer;
-
-public class ContainerDeployer implements Deployer
-{
- private ArchiveContainer container;
-
- public ContainerDeployer(ArchiveContainer container)
- {
- this.container = container;
- }
-
- public void deploy(Archive<?> archive) throws DeploymentException
- {
- if(archive == null)
- {
- throw new IllegalArgumentException("Can not deploy null artifact");
- }
- try
- {
- container.deploy(archive);
- }
- catch (Exception e)
- {
- throw new DeploymentException("Could not deploy artifact " + archive.getName(), e);
- }
- }
-
- public void undeploy(Archive<?> archive) throws DeploymentException
- {
- if(archive == null)
- {
- throw new IllegalArgumentException("Can not undeploy null artifact");
- }
- try
- {
- container.undeploy(archive);
- }
- catch (Exception e)
- {
- throw new DeploymentException("Could not undeploy artifact " + archive.getName(), e);
- }
- }
-}
Copied: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ContainerDeployer.java (from rev 3710, arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/container/ContainerDeployer.java)
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ContainerDeployer.java (rev 0)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ContainerDeployer.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,56 @@
+/*
+ * 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.impl.container;
+
+import org.jboss.arquillian.impl.Deployer;
+import org.jboss.arquillian.spi.DeployableContainer;
+import org.jboss.arquillian.spi.DeploymentException;
+import org.jboss.shrinkwrap.api.Archive;
+
+/**
+ * ContainerDeployer
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class ContainerDeployer implements Deployer
+{
+ private DeployableContainer container;
+
+ public ContainerDeployer(DeployableContainer container)
+ {
+ this.container = container;
+ }
+
+ public void deploy(Archive<?> archive) throws DeploymentException
+ {
+ if(archive == null)
+ {
+ throw new IllegalArgumentException("Can not deploy null artifact");
+ }
+ container.deploy(archive);
+ }
+
+ public void undeploy(Archive<?> archive) throws DeploymentException
+ {
+ if(archive == null)
+ {
+ throw new IllegalArgumentException("Can not undeploy null artifact");
+ }
+ container.undeploy(archive);
+ }
+}
Copied: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/Controlable.java (from rev 3710, arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/Controlable.java)
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/Controlable.java (rev 0)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/Controlable.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,33 @@
+/*
+ * 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.impl.container;
+
+import org.jboss.arquillian.spi.LifecycleException;
+
+/**
+ * Controlable
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public interface Controlable
+{
+ void start() throws LifecycleException;
+
+ void stop() throws LifecycleException;
+
+}
Added: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/DeployableContainers.java
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/DeployableContainers.java (rev 0)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/DeployableContainers.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,61 @@
+/*
+ * 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.impl.container;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ServiceLoader;
+
+import org.jboss.arquillian.spi.DeployableContainer;
+
+/**
+ * DeployableContainers
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class DeployableContainers
+{
+
+ private DeployableContainers() {}
+
+ public static DeployableContainer load()
+ {
+ ServiceLoader<DeployableContainer> containerLoader = ServiceLoader.load(DeployableContainer.class);
+ List<DeployableContainer> containers = toList(containerLoader.iterator());
+ if(containers.size() == 0)
+ {
+ throw new RuntimeException("No containers found");
+ }
+ if(containers.size() > 1)
+ {
+ throw new RuntimeException("More the one container found, check classpath");
+ }
+ return containers.get(0);
+ }
+
+ private static <T> List<T> toList(Iterator<T> iterator)
+ {
+ List<T> list = new ArrayList<T>();
+ while(iterator.hasNext())
+ {
+ list.add(iterator.next());
+ }
+ return list;
+ }
+}
Deleted: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ForceRestartController.java
===================================================================
--- arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/container/ForceRestartController.java 2009-11-13 12:47:53 UTC (rev 3684)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ForceRestartController.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -1,29 +0,0 @@
-package org.jboss.arquillian.api.container;
-
-import org.jboss.arquillian.api.Controlable;
-import org.jboss.tmpdpl.api.shrinkwrap.container.ArchiveContainer;
-
-public class ForceRestartController implements Controlable
-{
- private ArchiveContainer container;
-
- public ForceRestartController(ArchiveContainer containers)
- {
- this.container = containers;
- }
-
- public void start() throws Exception
- {
- try {
- //container.cleanup();
- } catch (Exception e) {
- // no-op
- }
- //container.setup();
- }
-
- public void stop() throws Exception
- {
- //container.cleanup();
- }
-}
Copied: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ForceRestartController.java (from rev 3710, arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/container/ForceRestartController.java)
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ForceRestartController.java (rev 0)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/ForceRestartController.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,51 @@
+/*
+ * 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.impl.container;
+
+import org.jboss.arquillian.spi.DeployableContainer;
+import org.jboss.arquillian.spi.LifecycleException;
+
+/**
+ * ForceRestartController
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class ForceRestartController implements Controlable
+{
+ private DeployableContainer container;
+
+ public ForceRestartController(DeployableContainer container)
+ {
+ this.container = container;
+ }
+
+ public void start() throws LifecycleException
+ {
+ try {
+ container.stop();
+ } catch (LifecycleException e) {
+ // no-op
+ }
+ container.start();
+ }
+
+ public void stop() throws LifecycleException
+ {
+ container.stop();
+ }
+}
Deleted: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/NoContainerController.java
===================================================================
--- arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/container/NoContainerController.java 2009-11-13 12:47:53 UTC (rev 3684)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/NoContainerController.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -1,19 +0,0 @@
-package org.jboss.arquillian.api.container;
-
-import org.jboss.arquillian.api.Controlable;
-import org.jboss.tmpdpl.api.shrinkwrap.container.ArchiveContainer;
-
-public class NoContainerController implements Controlable
-{
- public NoContainerController(ArchiveContainer container)
- {
- }
-
- public void start() throws Exception
- {
- }
-
- public void stop() throws Exception
- {
- }
-}
Copied: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/NoContainerController.java (from rev 3710, arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/container/NoContainerController.java)
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/NoContainerController.java (rev 0)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/NoContainerController.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,41 @@
+/*
+ * 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.impl.container;
+
+import org.jboss.arquillian.spi.DeployableContainer;
+import org.jboss.arquillian.spi.LifecycleException;
+
+/**
+ * NoContainerController
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class NoContainerController implements Controlable
+{
+ public NoContainerController(DeployableContainer container)
+ {
+ }
+
+ public void start() throws LifecycleException
+ {
+ }
+
+ public void stop() throws LifecycleException
+ {
+ }
+}
Added: arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/TestEnrichers.java
===================================================================
--- arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/TestEnrichers.java (rev 0)
+++ arquillian/trunk/impl-base/src/main/java/org/jboss/arquillian/impl/container/TestEnrichers.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,41 @@
+/*
+ * 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.impl.container;
+
+import java.util.ServiceLoader;
+
+import org.jboss.arquillian.spi.TestEnricher;
+
+/**
+ * TestEnrichers
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class TestEnrichers
+{
+ private TestEnrichers() {}
+
+ public static void enrich(Object testCase)
+ {
+ ServiceLoader<TestEnricher> serviceLoader = ServiceLoader.load(TestEnricher.class);
+ for(TestEnricher enricher : serviceLoader)
+ {
+ enricher.enrich(testCase);
+ }
+ }
+}
Modified: arquillian/trunk/junit/pom.xml
===================================================================
--- arquillian/trunk/junit/pom.xml 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/junit/pom.xml 2009-11-16 11:39:03 UTC (rev 3732)
@@ -30,14 +30,23 @@
<dependencies>
<!--
- org.jboss.shrinkwrap
+ org.jboss.arquillian
-->
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-impl-base</artifactId>
<version>${project.version}</version>
</dependency>
+
<!--
+ org.jboss.shrinkwrap
+ -->
+ <dependency>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-impl-base</artifactId>
+ </dependency>
+
+ <!--
External Projects
-->
<dependency>
Modified: arquillian/trunk/junit/src/main/java/org/jboss/arquillian/junit/Arquillian.java
===================================================================
--- arquillian/trunk/junit/src/main/java/org/jboss/arquillian/junit/Arquillian.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/junit/src/main/java/org/jboss/arquillian/junit/Arquillian.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -17,17 +17,14 @@
package org.jboss.arquillian.junit;
import java.lang.reflect.Method;
-
import java.util.Arrays;
import java.util.List;
-import org.jboss.arquillian.api.TestMethodExecutor;
import org.jboss.arquillian.impl.DeployableTest;
import org.jboss.arquillian.impl.DeployableTestBuilder;
-import org.jboss.arquillian.impl.runner.servlet.InContainerListener;
+import org.jboss.arquillian.spi.TestMethodExecutor;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.Archives;
-import org.jboss.shrinkwrap.api.descriptor.WebArchiveDescriptor;
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
@@ -63,22 +60,21 @@
{
throw new InitializationError(Arrays.asList((Throwable)e));
}
- }
- Runtime.getRuntime().addShutdownHook(new Thread() {
- @Override
- public void run()
- {
- try
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ @Override
+ public void run()
{
- deployableTest.getContainerController().stop();
- }
- catch (Exception e)
- {
- // TODO: stops container, but complains about wrong state ?
- //throw new RuntimeException("Could not stop contianer", e);
+ try
+ {
+ deployableTest.getContainerController().stop();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Could not stop container", e);
+ }
}
- }
- });
+ });
+ }
}
@@ -107,12 +103,10 @@
true,
Package.getPackage("org.junit"),
Package.getPackage("org.jboss.arquillian.api"),
+ Package.getPackage("org.jboss.arquillian.spi"),
Package.getPackage("org.jboss.arquillian.impl"),
Package.getPackage("org.jboss.arquillian.junit"));
-
- webArchive.as(WebArchiveDescriptor.class)
- .addListener(InContainerListener.class)
- .addServlet(ServletTestRunner.class, "/*");
+ webArchive.setWebXML("org/jboss/arquillian/junit/test-web.xml");
}
if(archive instanceof JavaArchive) {
EnterpriseArchive ear = Archives.create("test.ear", EnterpriseArchive.class);
@@ -126,10 +120,8 @@
Package.getPackage("org.jboss.arquillian.junit"))
.addClass(Arquillian.this.getTestClass().getJavaClass());
- war.as(WebArchiveDescriptor.class)
- .addListener(InContainerListener.class)
- .addServlet(ServletTestRunner.class, "/*");
-
+ war.setWebXML("org/jboss/arquillian/junit/test-web.xml");
+
ear.addModule(war)
.addModule(archive);
Modified: arquillian/trunk/junit/src/main/java/org/jboss/arquillian/junit/ServletTestRunner.java
===================================================================
--- arquillian/trunk/junit/src/main/java/org/jboss/arquillian/junit/ServletTestRunner.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/junit/src/main/java/org/jboss/arquillian/junit/ServletTestRunner.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -25,9 +25,9 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.jboss.arquillian.api.TestResult;
-import org.jboss.arquillian.api.TestResult.Status;
import org.jboss.arquillian.impl.TestResultImpl;
+import org.jboss.arquillian.spi.TestResult;
+import org.jboss.arquillian.spi.TestResult.Status;
import org.junit.runner.JUnitCore;
import org.junit.runner.Request;
import org.junit.runner.Result;
Added: arquillian/trunk/junit/src/main/resources/org/jboss/arquillian/junit/test-web.xml
===================================================================
--- arquillian/trunk/junit/src/main/resources/org/jboss/arquillian/junit/test-web.xml (rev 0)
+++ arquillian/trunk/junit/src/main/resources/org/jboss/arquillian/junit/test-web.xml 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<web-app version="2.4">
+ <display-name>Arquillian</display-name>
+ <listener>
+ <listener-class>org.jboss.arquillian.impl.runner.servlet.InContainerListener</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>ServletTestRunner</servlet-name>
+ <servlet-class>org.jboss.arquillian.junit.ServletTestRunner</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>ServletTestRunner</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
Modified: arquillian/trunk/pom.xml
===================================================================
--- arquillian/trunk/pom.xml 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/pom.xml 2009-11-16 11:39:03 UTC (rev 3732)
@@ -43,9 +43,11 @@
<!-- Aggregate Modules -->
<modules>
<module>api</module>
+ <module>spi</module>
<module>build</module>
<module>impl-base</module>
<module>junit</module>
+ <module>container-jboss-embedded</module>
</modules>
</project>
Modified: arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/DeployableContainer.java
===================================================================
--- arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/DeployableContainer.java 2009-11-16 11:26:12 UTC (rev 3731)
+++ arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/DeployableContainer.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -27,9 +27,9 @@
public interface DeployableContainer
{
- void start();
+ void start() throws LifecycleException;
- void stop();
+ void stop() throws LifecycleException;
void deploy(Archive<?> archive) throws DeploymentException;
Added: arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/LifecycleException.java
===================================================================
--- arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/LifecycleException.java (rev 0)
+++ arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/LifecycleException.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,39 @@
+/*
+ * 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.spi;
+
+/**
+ * LifecycleException
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class LifecycleException extends Exception
+{
+ private static final long serialVersionUID = 1L;
+
+ public LifecycleException(String message)
+ {
+ super(message);
+ }
+
+ public LifecycleException(String message, Exception cause)
+ {
+ super(message, cause);
+ }
+
+}
Added: arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/TestEnricher.java
===================================================================
--- arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/TestEnricher.java (rev 0)
+++ arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/TestEnricher.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,28 @@
+/*
+ * 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.spi;
+
+/**
+ * TestEnricher
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public interface TestEnricher
+{
+ void enrich(Object testCase);
+}
Copied: arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/TestMethodExecutor.java (from rev 3710, arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/TestMethodExecutor.java)
===================================================================
--- arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/TestMethodExecutor.java (rev 0)
+++ arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/TestMethodExecutor.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,33 @@
+/*
+ * 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.spi;
+
+import java.lang.reflect.Method;
+
+/**
+ * TestMethodExecutor
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public interface TestMethodExecutor
+{
+ Method getMethod();
+ Object getInstance();
+ void invoke() throws Throwable;
+
+}
Copied: arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/TestResult.java (from rev 3710, arquillian/trunk/api/src/main/java/org/jboss/arquillian/api/TestResult.java)
===================================================================
--- arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/TestResult.java (rev 0)
+++ arquillian/trunk/spi/src/main/java/org/jboss/arquillian/spi/TestResult.java 2009-11-16 11:39:03 UTC (rev 3732)
@@ -0,0 +1,63 @@
+/*
+ * 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.spi;
+
+import java.io.Serializable;
+
+/**
+ * A test result which may be serialized for communicate between client and
+ * server
+ *
+ * @author Pete Muir
+ *
+ */
+public interface TestResult extends Serializable
+{
+
+ /**
+ * The test status
+ * @author Pete Muir
+ *
+ */
+ public enum Status
+ {
+ /**
+ * The test passed
+ */
+ PASSED,
+ /**
+ * The test failed
+ */
+ FAILED,
+ /**
+ * The test was skipped due to some deployment problem
+ */
+ SKIPPED;
+ }
+
+ /**
+ * Get the status of this test
+ */
+ public Status getStatus();
+
+ /**
+ * If the test failed, the exception that was thrown. It does not need to be
+ * the root cause.
+ */
+ public Throwable getThrowable();
+
+}
\ No newline at end of file
More information about the jboss-svn-commits
mailing list