[jboss-svn-commits] JBoss Common SVN: r3802 - in arquillian/trunk: container-jboss-embedded and 28 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Nov 26 07:39:34 EST 2009
Author: aslak
Date: 2009-11-26 07:39:33 -0500 (Thu, 26 Nov 2009)
New Revision: 3802
Added:
arquillian/trunk/testenricher-jboss/
arquillian/trunk/testenricher-jboss/pom.xml
arquillian/trunk/testenricher-jboss/src/
arquillian/trunk/testenricher-jboss/src/main/
arquillian/trunk/testenricher-jboss/src/main/java/
arquillian/trunk/testenricher-jboss/src/main/java/org/
arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/
arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/
arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/
arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/
arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/CDIInjectionEnricher.java
arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/EJBInjectionEnricher.java
arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/JbossDeploymentAppender.java
arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/ResourceInjectionEnricher.java
arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/SecurityActions.java
arquillian/trunk/testenricher-jboss/src/main/resources/
arquillian/trunk/testenricher-jboss/src/main/resources/META-INF/
arquillian/trunk/testenricher-jboss/src/main/resources/META-INF/services/
arquillian/trunk/testenricher-jboss/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender
arquillian/trunk/testenricher-jboss/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher
arquillian/trunk/testenricher-jboss/src/test/
arquillian/trunk/testenricher-jboss/src/test/java/
arquillian/trunk/testenricher-jboss/src/test/java/org/
arquillian/trunk/testenricher-jboss/src/test/java/org/jboss/
arquillian/trunk/testenricher-jboss/src/test/java/org/jboss/arquillian/
arquillian/trunk/testenricher-jboss/src/test/java/org/jboss/arquillian/testenricher/
arquillian/trunk/testenricher-jboss/src/test/java/org/jboss/arquillian/testenricher/jboss/
arquillian/trunk/testenricher-jboss/src/test/java/org/jboss/arquillian/testenricher/jboss/EJBInjectionEnricherTestCase.java
arquillian/trunk/testenricher-jboss/src/test/java/org/jboss/arquillian/testenricher/jboss/JbossDeploymentAppenderTestCase.java
arquillian/trunk/testenricher-jboss/src/test/resources/
Removed:
arquillian/trunk/container-jboss-embedded/src/main/java/org/jboss/arquillian/jboss/EmbeddedDeploymentAppender.java
arquillian/trunk/container-jboss-embedded/src/main/java/org/jboss/arquillian/jboss/InjectionEnricher.java
arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender
arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher
arquillian/trunk/container-jboss-embedded/src/test/java/org/jboss/arquillian/jboss/EmbeddedDeploymentAppenderTestCase.java
arquillian/trunk/container-jboss-remote-51/src/main/java/org/jboss/arquillian/jboss/InjectionEnricher.java
arquillian/trunk/container-jboss-remote-51/src/main/java/org/jboss/arquillian/jboss/JbossDeploymentAppender.java
arquillian/trunk/container-jboss-remote-51/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender
arquillian/trunk/container-jboss-remote-51/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher
arquillian/trunk/container-jboss-remote-60/src/main/java/org/jboss/arquillian/jboss/InjectionEnricher.java
arquillian/trunk/container-jboss-remote-60/src/main/java/org/jboss/arquillian/jboss/JbossDeploymentAppender.java
arquillian/trunk/container-jboss-remote-60/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender
arquillian/trunk/container-jboss-remote-60/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher
Modified:
arquillian/trunk/container-jboss-embedded/pom.xml
arquillian/trunk/container-jboss-remote-51/pom.xml
arquillian/trunk/container-jboss-remote-60/pom.xml
arquillian/trunk/pom.xml
Log:
ARQ-34 Extracted Jboss TestEnrichers into a common module. CDI/Resource missing implementation.
Modified: arquillian/trunk/container-jboss-embedded/pom.xml
===================================================================
--- arquillian/trunk/container-jboss-embedded/pom.xml 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-embedded/pom.xml 2009-11-26 12:39:33 UTC (rev 3802)
@@ -43,6 +43,11 @@
<artifactId>arquillian-protocol-servlet</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-jboss-testenricher</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<!--
org.jboss.embedded
Deleted: arquillian/trunk/container-jboss-embedded/src/main/java/org/jboss/arquillian/jboss/EmbeddedDeploymentAppender.java
===================================================================
--- arquillian/trunk/container-jboss-embedded/src/main/java/org/jboss/arquillian/jboss/EmbeddedDeploymentAppender.java 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-embedded/src/main/java/org/jboss/arquillian/jboss/EmbeddedDeploymentAppender.java 2009-11-26 12:39:33 UTC (rev 3802)
@@ -1,52 +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.jboss;
-
-import org.jboss.arquillian.spi.DeploymentAppender;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.Archives;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-
-/**
- * EmbeddedDeploymentAppender
- *
- * Package the required dependencies needed by the Jboss Embedded Container plugin
- * to run in container.
- *
- * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
- * @version $Revision: $
- */
-public class EmbeddedDeploymentAppender implements DeploymentAppender
-{
-
- /* (non-Javadoc)
- * @see org.jboss.arquillian.spi.DeploymentAppender#createArchive()
- */
- @Override
- public Archive<?> createArchive()
- {
- JavaArchive archive = Archives.create("jboss-embedded-container.jar", JavaArchive.class)
- .addPackages(
- true,
- Package.getPackage("org.jboss.arquillian.jboss"))
- .addManifestResource(
- "META-INF/services/org.jboss.arquillian.spi.TestEnricher",
- "services/org.jboss.arquillian.spi.TestEnricher");
- return archive;
- }
-
-}
Deleted: 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 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-embedded/src/main/java/org/jboss/arquillian/jboss/InjectionEnricher.java 2009-11-26 12:39:33 UTC (rev 3802)
@@ -1,66 +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.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");
- }
-}
Deleted: arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender
===================================================================
--- arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender 2009-11-26 12:39:33 UTC (rev 3802)
@@ -1 +0,0 @@
-org.jboss.arquillian.jboss.EmbeddedDeploymentAppender
\ No newline at end of file
Deleted: 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 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher 2009-11-26 12:39:33 UTC (rev 3802)
@@ -1 +0,0 @@
-org.jboss.arquillian.jboss.InjectionEnricher
\ No newline at end of file
Deleted: arquillian/trunk/container-jboss-embedded/src/test/java/org/jboss/arquillian/jboss/EmbeddedDeploymentAppenderTestCase.java
===================================================================
--- arquillian/trunk/container-jboss-embedded/src/test/java/org/jboss/arquillian/jboss/EmbeddedDeploymentAppenderTestCase.java 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-embedded/src/test/java/org/jboss/arquillian/jboss/EmbeddedDeploymentAppenderTestCase.java 2009-11-26 12:39:33 UTC (rev 3802)
@@ -1,28 +0,0 @@
-package org.jboss.arquillian.jboss;
-
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.Paths;
-import org.junit.Assert;
-import org.junit.Test;
-
-
-public class EmbeddedDeploymentAppenderTestCase
-{
-
- @Test
- public void shouldGenerateDependencies() throws Exception {
-
- Archive<?> archive = new EmbeddedDeploymentAppender().createArchive();
-
- Assert.assertTrue(
- "Should have added TestEnricher SPI",
- archive.contains(Paths.create("/META-INF/services/org.jboss.arquillian.spi.TestEnricher")));
-
- Assert.assertTrue(
- "Should have added TestEnricher Impl",
- archive.contains(Paths.create("/org/jboss/arquillian/jboss/InjectionEnricher.class")));
-
- System.out.println(archive.toString(true));
-
- }
-}
Modified: arquillian/trunk/container-jboss-remote-51/pom.xml
===================================================================
--- arquillian/trunk/container-jboss-remote-51/pom.xml 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-remote-51/pom.xml 2009-11-26 12:39:33 UTC (rev 3802)
@@ -42,6 +42,11 @@
<artifactId>arquillian-protocol-servlet</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-jboss-testenricher</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<!--
org.jboss
Deleted: arquillian/trunk/container-jboss-remote-51/src/main/java/org/jboss/arquillian/jboss/InjectionEnricher.java
===================================================================
--- arquillian/trunk/container-jboss-remote-51/src/main/java/org/jboss/arquillian/jboss/InjectionEnricher.java 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-remote-51/src/main/java/org/jboss/arquillian/jboss/InjectionEnricher.java 2009-11-26 12:39:33 UTC (rev 3802)
@@ -1,68 +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.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
-{
- private static final long serialVersionUID = 1L;
-
- @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");
- }
-}
Deleted: arquillian/trunk/container-jboss-remote-51/src/main/java/org/jboss/arquillian/jboss/JbossDeploymentAppender.java
===================================================================
--- arquillian/trunk/container-jboss-remote-51/src/main/java/org/jboss/arquillian/jboss/JbossDeploymentAppender.java 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-remote-51/src/main/java/org/jboss/arquillian/jboss/JbossDeploymentAppender.java 2009-11-26 12:39:33 UTC (rev 3802)
@@ -1,52 +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.jboss;
-
-import org.jboss.arquillian.spi.DeploymentAppender;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.Archives;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-
-/**
- * EmbeddedDeploymentAppender
- *
- * Package the required dependencies needed by the Jboss Embedded Container plugin
- * to run in container.
- *
- * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
- * @version $Revision: $
- */
-public class JbossDeploymentAppender implements DeploymentAppender
-{
-
- /* (non-Javadoc)
- * @see org.jboss.arquillian.spi.DeploymentAppender#createArchive()
- */
- @Override
- public Archive<?> createArchive()
- {
- JavaArchive archive = Archives.create("jboss-embedded-container.jar", JavaArchive.class)
- .addPackages(
- true,
- Package.getPackage("org.jboss.arquillian.jboss"))
- .addManifestResource(
- "META-INF/services/org.jboss.arquillian.spi.TestEnricher",
- "services/org.jboss.arquillian.spi.TestEnricher");
- return archive;
- }
-
-}
Deleted: arquillian/trunk/container-jboss-remote-51/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender
===================================================================
--- arquillian/trunk/container-jboss-remote-51/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-remote-51/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender 2009-11-26 12:39:33 UTC (rev 3802)
@@ -1 +0,0 @@
-org.jboss.arquillian.jboss.JbossDeploymentAppender
\ No newline at end of file
Deleted: arquillian/trunk/container-jboss-remote-51/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher
===================================================================
--- arquillian/trunk/container-jboss-remote-51/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-remote-51/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher 2009-11-26 12:39:33 UTC (rev 3802)
@@ -1 +0,0 @@
-org.jboss.arquillian.jboss.InjectionEnricher
\ No newline at end of file
Modified: arquillian/trunk/container-jboss-remote-60/pom.xml
===================================================================
--- arquillian/trunk/container-jboss-remote-60/pom.xml 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-remote-60/pom.xml 2009-11-26 12:39:33 UTC (rev 3802)
@@ -42,6 +42,11 @@
<artifactId>arquillian-protocol-servlet</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-jboss-testenricher</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<!--
org.jboss
Deleted: arquillian/trunk/container-jboss-remote-60/src/main/java/org/jboss/arquillian/jboss/InjectionEnricher.java
===================================================================
--- arquillian/trunk/container-jboss-remote-60/src/main/java/org/jboss/arquillian/jboss/InjectionEnricher.java 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-remote-60/src/main/java/org/jboss/arquillian/jboss/InjectionEnricher.java 2009-11-26 12:39:33 UTC (rev 3802)
@@ -1,68 +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.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
-{
- private static final long serialVersionUID = 1L;
-
- @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");
- }
-}
Deleted: arquillian/trunk/container-jboss-remote-60/src/main/java/org/jboss/arquillian/jboss/JbossDeploymentAppender.java
===================================================================
--- arquillian/trunk/container-jboss-remote-60/src/main/java/org/jboss/arquillian/jboss/JbossDeploymentAppender.java 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-remote-60/src/main/java/org/jboss/arquillian/jboss/JbossDeploymentAppender.java 2009-11-26 12:39:33 UTC (rev 3802)
@@ -1,52 +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.jboss;
-
-import org.jboss.arquillian.spi.DeploymentAppender;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.Archives;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-
-/**
- * EmbeddedDeploymentAppender
- *
- * Package the required dependencies needed by the Jboss Embedded Container plugin
- * to run in container.
- *
- * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
- * @version $Revision: $
- */
-public class JbossDeploymentAppender implements DeploymentAppender
-{
-
- /* (non-Javadoc)
- * @see org.jboss.arquillian.spi.DeploymentAppender#createArchive()
- */
- @Override
- public Archive<?> createArchive()
- {
- JavaArchive archive = Archives.create("jboss-embedded-container.jar", JavaArchive.class)
- .addPackages(
- true,
- Package.getPackage("org.jboss.arquillian.jboss"))
- .addManifestResource(
- "META-INF/services/org.jboss.arquillian.spi.TestEnricher",
- "services/org.jboss.arquillian.spi.TestEnricher");
- return archive;
- }
-
-}
Deleted: arquillian/trunk/container-jboss-remote-60/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender
===================================================================
--- arquillian/trunk/container-jboss-remote-60/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-remote-60/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender 2009-11-26 12:39:33 UTC (rev 3802)
@@ -1 +0,0 @@
-org.jboss.arquillian.jboss.JbossDeploymentAppender
\ No newline at end of file
Deleted: arquillian/trunk/container-jboss-remote-60/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher
===================================================================
--- arquillian/trunk/container-jboss-remote-60/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/container-jboss-remote-60/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher 2009-11-26 12:39:33 UTC (rev 3802)
@@ -1 +0,0 @@
-org.jboss.arquillian.jboss.InjectionEnricher
\ No newline at end of file
Modified: arquillian/trunk/pom.xml
===================================================================
--- arquillian/trunk/pom.xml 2009-11-25 15:25:49 UTC (rev 3801)
+++ arquillian/trunk/pom.xml 2009-11-26 12:39:33 UTC (rev 3802)
@@ -51,6 +51,7 @@
<module>container-jboss-embedded</module>
<module>container-jboss-remote-51</module>
<module>container-jboss-remote-60</module>
+ <module>testenricher-jboss</module>
</modules>
</project>
Property changes on: arquillian/trunk/testenricher-jboss
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Added: arquillian/trunk/testenricher-jboss/pom.xml
===================================================================
--- arquillian/trunk/testenricher-jboss/pom.xml (rev 0)
+++ arquillian/trunk/testenricher-jboss/pom.xml 2009-11-26 12:39:33 UTC (rev 3802)
@@ -0,0 +1,60 @@
+<?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 -->
+ <parent>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-build</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+
+ <!-- Model Version -->
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- Artifact Configuration -->
+ <artifactId>arquillian-jboss-testenricher</artifactId>
+ <name>Arquillian TestEnricher Jboss AS</name>
+ <description>Jboss AS TestEnrichers for the Arquillian Project</description>
+
+
+ <!-- Properties -->
+ <properties>
+
+ <!-- Versioning -->
+
+ </properties>
+
+ <!-- Dependencies -->
+ <dependencies>
+
+ <!--
+ org.jboss.arquillian
+ -->
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-spi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-impl-base</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ <version>3.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
+
Added: arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/CDIInjectionEnricher.java
===================================================================
--- arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/CDIInjectionEnricher.java (rev 0)
+++ arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/CDIInjectionEnricher.java 2009-11-26 12:39:33 UTC (rev 3802)
@@ -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.testenricher.jboss;
+
+import org.jboss.arquillian.spi.TestEnricher;
+
+/**
+ * CDIInjectionEnricher
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class CDIInjectionEnricher implements TestEnricher
+{
+
+ @Override
+ public void enrich(Object testCase)
+ {
+ }
+}
Added: arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/EJBInjectionEnricher.java
===================================================================
--- arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/EJBInjectionEnricher.java (rev 0)
+++ arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/EJBInjectionEnricher.java 2009-11-26 12:39:33 UTC (rev 3802)
@@ -0,0 +1,78 @@
+/*
+ * 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.testenricher.jboss;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.util.List;
+
+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 EJBInjectionEnricher implements TestEnricher
+{
+
+ private static final String ANNOTATION_NAME = "javax.ejb.EJB";
+ private static final String ANNOTATION_FIELD_BEAN_INTERFACE = "beanInterface";
+ private static final String ANNOTATION_FIELD_MAPPED_NAME = "mappedName";
+
+ @Override
+ public void enrich(Object testCase)
+ {
+ if(SecurityActions.isClassPresent(ANNOTATION_NAME))
+ {
+ injectClass(testCase);
+ }
+ }
+
+ void injectClass(Object testCase)
+ {
+ try
+ {
+ @SuppressWarnings("unchecked")
+ Class<? extends Annotation> ejbAnnotation = (Class<? extends Annotation>)SecurityActions.getThreadContextClassLoader().loadClass(ANNOTATION_NAME);
+
+ List<Field> annotatedFields = SecurityActions.getFieldsWithAnnotation(
+ testCase.getClass(),
+ ejbAnnotation);
+
+ for(Field field : annotatedFields)
+ {
+ Object ejb = lookupEJB(field);
+ 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");
+ }
+}
Added: arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/JbossDeploymentAppender.java
===================================================================
--- arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/JbossDeploymentAppender.java (rev 0)
+++ arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/JbossDeploymentAppender.java 2009-11-26 12:39:33 UTC (rev 3802)
@@ -0,0 +1,52 @@
+/*
+ * 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.testenricher.jboss;
+
+import org.jboss.arquillian.spi.DeploymentAppender;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+
+/**
+ * EmbeddedDeploymentAppender
+ *
+ * Package the required dependencies needed by the Jboss Embedded Container plugin
+ * to run in container.
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class JbossDeploymentAppender implements DeploymentAppender
+{
+
+ /* (non-Javadoc)
+ * @see org.jboss.arquillian.spi.DeploymentAppender#createArchive()
+ */
+ @Override
+ public Archive<?> createArchive()
+ {
+ JavaArchive archive = Archives.create("jboss-testenrichers.jar", JavaArchive.class)
+ .addPackages(
+ true,
+ Package.getPackage("org.jboss.arquillian.testenricher.jboss"))
+ .addManifestResource(
+ "META-INF/services/org.jboss.arquillian.spi.TestEnricher",
+ "services/org.jboss.arquillian.spi.TestEnricher");
+ return archive;
+ }
+
+}
Added: arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/ResourceInjectionEnricher.java
===================================================================
--- arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/ResourceInjectionEnricher.java (rev 0)
+++ arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/ResourceInjectionEnricher.java 2009-11-26 12:39:33 UTC (rev 3802)
@@ -0,0 +1,35 @@
+/*
+ * 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.testenricher.jboss;
+
+import org.jboss.arquillian.spi.TestEnricher;
+
+/**
+ * ResourceInjectionEnricher
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class ResourceInjectionEnricher implements TestEnricher
+{
+
+ @Override
+ public void enrich(Object testCase)
+ {
+
+ }
+}
Added: arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/SecurityActions.java
===================================================================
--- arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/SecurityActions.java (rev 0)
+++ arquillian/trunk/testenricher-jboss/src/main/java/org/jboss/arquillian/testenricher/jboss/SecurityActions.java 2009-11-26 12:39:33 UTC (rev 3802)
@@ -0,0 +1,223 @@
+/*
+ * 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.testenricher.jboss;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * SecurityActions
+ *
+ * A set of privileged actions that are not to leak out
+ * of this package
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+final class SecurityActions
+{
+
+ //-------------------------------------------------------------------------------||
+ // Constructor ------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------||
+
+ /**
+ * No instantiation
+ */
+ private SecurityActions()
+ {
+ throw new UnsupportedOperationException("No instantiation");
+ }
+
+ //-------------------------------------------------------------------------------||
+ // Utility Methods --------------------------------------------------------------||
+ //-------------------------------------------------------------------------------||
+
+ /**
+ * Obtains the Thread Context ClassLoader
+ */
+ static ClassLoader getThreadContextClassLoader()
+ {
+ return AccessController.doPrivileged(GetTcclAction.INSTANCE);
+ }
+
+ /**
+ * Obtains the Constructor specified from the given Class and argument types
+ * @param clazz
+ * @param argumentTypes
+ * @return
+ * @throws NoSuchMethodException
+ */
+ static Constructor<?> getConstructor(final Class<?> clazz, final Class<?>... argumentTypes)
+ throws NoSuchMethodException
+ {
+ try
+ {
+ return AccessController.doPrivileged(new PrivilegedExceptionAction<Constructor<?>>()
+ {
+ @Override
+ public Constructor<?> run() throws NoSuchMethodException
+ {
+ return clazz.getConstructor(argumentTypes);
+ }
+ });
+ }
+ // Unwrap
+ catch (final PrivilegedActionException pae)
+ {
+ final Throwable t = pae.getCause();
+ // Rethrow
+ if (t instanceof NoSuchMethodException)
+ {
+ throw (NoSuchMethodException) t;
+ }
+ else
+ {
+ // No other checked Exception thrown by Class.getConstructor
+ try
+ {
+ throw (RuntimeException) t;
+ }
+ // Just in case we've really messed up
+ catch (final ClassCastException cce)
+ {
+ throw new RuntimeException("Obtained unchecked Exception; this code should never be reached", t);
+ }
+ }
+ }
+ }
+
+ /**
+ * Create a new instance by finding a constructor that matches the argumentTypes signature
+ * using the arguments for instantiation.
+ *
+ * @param className Full classname of class to create
+ * @param argumentTypes The constructor argument types
+ * @param arguments The constructor arguments
+ * @return a new instance
+ * @throws IllegalArgumentException if className, argumentTypes, or arguments are null
+ * @throws RuntimeException if any exceptions during creation
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ */
+ static <T> T newInstance(final String className, final Class<?>[] argumentTypes, final Object[] arguments,
+ final Class<T> expectedType)
+ {
+ if (className == null)
+ {
+ throw new IllegalArgumentException("ClassName must be specified");
+ }
+ if (argumentTypes == null)
+ {
+ throw new IllegalArgumentException("ArgumentTypes must be specified. Use empty array if no arguments");
+ }
+ if (arguments == null)
+ {
+ throw new IllegalArgumentException("Arguments must be specified. Use empty array if no arguments");
+ }
+ final Object obj;
+ try
+ {
+ final ClassLoader tccl = getThreadContextClassLoader();
+ final Class<?> implClass = Class.forName(className, false, tccl);
+ Constructor<?> constructor = getConstructor(implClass, argumentTypes);
+ obj = constructor.newInstance(arguments);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Could not create new instance of " + className
+ + ", missing package from classpath?", e);
+ }
+
+ // Cast
+ try
+ {
+ return expectedType.cast(obj);
+ }
+ catch (final ClassCastException cce)
+ {
+ // Reconstruct so we get some useful information
+ throw new ClassCastException("Incorrect expected type, " + expectedType.getName() + ", defined for "
+ + obj.getClass().getName());
+ }
+ }
+
+ public static boolean isClassPresent(String name)
+ {
+ try
+ {
+ ClassLoader classLoader = getThreadContextClassLoader();
+ classLoader.loadClass(name);
+ return true;
+ }
+ catch (ClassNotFoundException e)
+ {
+ return false;
+ }
+ }
+
+ public static List<Field> getFieldsWithAnnotation(final Class<?> source, final Class<? extends Annotation> annotationClass)
+ {
+ List<Field> declaredAccessableFields = AccessController.doPrivileged(new PrivilegedAction<List<Field>>()
+ {
+ @Override
+ public List<Field> run()
+ {
+ List<Field> foundFields = new ArrayList<Field>();
+ for(Field field : source.getDeclaredFields())
+ {
+ if(field.isAnnotationPresent(annotationClass))
+ {
+ if(!field.isAccessible())
+ {
+ field.setAccessible(true);
+ }
+ foundFields.add(field);
+ }
+ }
+ return foundFields;
+ }
+ });
+ return declaredAccessableFields;
+ }
+
+ //-------------------------------------------------------------------------------||
+ // Inner Classes ----------------------------------------------------------------||
+ //-------------------------------------------------------------------------------||
+
+ /**
+ * Single instance to get the TCCL
+ */
+ private enum GetTcclAction implements PrivilegedAction<ClassLoader> {
+ INSTANCE;
+
+ @Override
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+
+ }
+
+}
Added: arquillian/trunk/testenricher-jboss/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender
===================================================================
--- arquillian/trunk/testenricher-jboss/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender (rev 0)
+++ arquillian/trunk/testenricher-jboss/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeploymentAppender 2009-11-26 12:39:33 UTC (rev 3802)
@@ -0,0 +1 @@
+org.jboss.arquillian.testenricher.jboss.JbossDeploymentAppender
\ No newline at end of file
Added: arquillian/trunk/testenricher-jboss/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher
===================================================================
--- arquillian/trunk/testenricher-jboss/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher (rev 0)
+++ arquillian/trunk/testenricher-jboss/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher 2009-11-26 12:39:33 UTC (rev 3802)
@@ -0,0 +1,3 @@
+org.jboss.arquillian.testenricher.jboss.EJBInjectionEnricher
+org.jboss.arquillian.testenricher.jboss.ResourceInjectionEnricher
+org.jboss.arquillian.testenricher.jboss.CDIInjectionEnricher
\ No newline at end of file
Added: arquillian/trunk/testenricher-jboss/src/test/java/org/jboss/arquillian/testenricher/jboss/EJBInjectionEnricherTestCase.java
===================================================================
--- arquillian/trunk/testenricher-jboss/src/test/java/org/jboss/arquillian/testenricher/jboss/EJBInjectionEnricherTestCase.java (rev 0)
+++ arquillian/trunk/testenricher-jboss/src/test/java/org/jboss/arquillian/testenricher/jboss/EJBInjectionEnricherTestCase.java 2009-11-26 12:39:33 UTC (rev 3802)
@@ -0,0 +1,30 @@
+package org.jboss.arquillian.testenricher.jboss;
+
+import junit.framework.Assert;
+
+import org.junit.Test;
+
+
+public class EJBInjectionEnricherTestCase
+{
+
+ @Test
+ public void shouldLookupLocalEjb() throws Exception {
+ Assert.fail("not implemented");
+ }
+
+ @Test
+ public void shouldLookupRemoteEjb() throws Exception {
+ Assert.fail("not implemented");
+ }
+
+ @Test
+ public void shouldLookupEjbBasedOnBeanInterface() throws Exception {
+ Assert.fail("not implemented");
+ }
+
+ @Test
+ public void shouldLookupEjbBasedOnMappedName() throws Exception {
+ Assert.fail("not implemented");
+ }
+}
Added: arquillian/trunk/testenricher-jboss/src/test/java/org/jboss/arquillian/testenricher/jboss/JbossDeploymentAppenderTestCase.java
===================================================================
--- arquillian/trunk/testenricher-jboss/src/test/java/org/jboss/arquillian/testenricher/jboss/JbossDeploymentAppenderTestCase.java (rev 0)
+++ arquillian/trunk/testenricher-jboss/src/test/java/org/jboss/arquillian/testenricher/jboss/JbossDeploymentAppenderTestCase.java 2009-11-26 12:39:33 UTC (rev 3802)
@@ -0,0 +1,39 @@
+package org.jboss.arquillian.testenricher.jboss;
+
+import junit.framework.Assert;
+
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Paths;
+import org.junit.Test;
+
+
+public class JbossDeploymentAppenderTestCase
+{
+
+ @Test
+ public void shouldGenerateDependencies() throws Exception {
+
+ Archive<?> archive = new JbossDeploymentAppender().createArchive();
+ System.out.println(archive.toString(true));
+
+ Assert.assertTrue(
+ "Should have added TestEnricher SPI",
+ archive.contains(Paths.create("/META-INF/services/org.jboss.arquillian.spi.TestEnricher")));
+
+ Assert.assertTrue(
+ "Should have added TestEnricher EJB impl",
+ archive.contains(Paths.create("/org/jboss/arquillian/testenricher/jboss/EJBInjectionEnricher.class")));
+
+ Assert.assertTrue(
+ "Should have added TestEnricher Resource impl",
+ archive.contains(Paths.create("/org/jboss/arquillian/testenricher/jboss/ResourceInjectionEnricher.class")));
+
+ Assert.assertTrue(
+ "Should have added TestEnricher CDI impl",
+ archive.contains(Paths.create("/org/jboss/arquillian/testenricher/jboss/CDIInjectionEnricher.class")));
+
+ Assert.assertTrue(
+ "Should have added TestEnricher Impl dep",
+ archive.contains(Paths.create("/org/jboss/arquillian/testenricher/jboss/SecurityActions.class")));
+ }
+}
More information about the jboss-svn-commits
mailing list