tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgallim...@apache.org
Subject svn commit: r1178974 [3/4] - in /openejb/trunk/arquillian-tomee/arquillian-tomee-tests: ./ src/test/java/org/apache/openejb/arquillian/tests/ src/test/java/org/apache/openejb/arquillian/tests/cdiinject/ src/test/java/org/apache/openejb/arquillian/tests...
Date Tue, 04 Oct 2011 21:56:59 GMT
Copied: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerpersistence/ServletListenerPersistenceInjectionTest.java (from r1178936, openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletListenerPersistenceInjectionTest.java)
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerpersistence/ServletListenerPersistenceInjectionTest.java?p2=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerpersistence/ServletListenerPersistenceInjectionTest.java&p1=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletListenerPersistenceInjectionTest.java&r1=1178936&r2=1178974&rev=1178974&view=diff
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletListenerPersistenceInjectionTest.java (original)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerpersistence/ServletListenerPersistenceInjectionTest.java Tue Oct  4 21:56:55 2011
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.openejb.arquillian.tests;
+package org.apache.openejb.arquillian.tests.listenerpersistence;
 
 import org.jboss.arquillian.api.Deployment;
 import org.jboss.arquillian.junit.Arquillian;
@@ -28,14 +28,8 @@ import org.jboss.shrinkwrap.descriptor.a
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import javax.annotation.Resource;
 import javax.persistence.*;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-import javax.servlet.ServletException;
 import javax.servlet.http.*;
-import javax.transaction.UserTransaction;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -98,6 +92,7 @@ public class ServletListenerPersistenceI
                 .addClass(PersistenceServletSessionListener.class)
                 .addClass(ServletToCheckListener.class)
                 .addClass(Address.class)
+                .addClass(ContextAttributeName.class)
                 .addAsManifestResource("persistence.xml", ArchivePaths.create("persistence.xml"))
                 .setWebXML(new StringAsset(descriptor.exportAsString()))
                 .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
@@ -107,171 +102,6 @@ public class ServletListenerPersistenceI
         return archive;
     }
 
-    public static enum ContextAttributeName {
-        KEY_EntityManagerFactory,
-        KEY_EntityManager,
-        KEY_Transaction,;
-    }
-
-    public static class ServletToCheckListener extends HttpServlet {
-
-        @Override
-        public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-            final ServletContext ctxt = req.getServletContext();
-            for (ContextAttributeName s : ContextAttributeName.values()) {
-                resp.getOutputStream().println("Context: " + ctxt.getAttribute(s.name()));
-            }
-
-            final HttpSession session = req.getSession();
-            for (ContextAttributeName s : ContextAttributeName.values()) {
-                resp.getOutputStream().println("Session: " + session.getAttribute(s.name()));
-            }
-        }
-    }
-
-    public static class PersistenceServletContextListener implements ServletContextListener {
-
-        @Resource
-        private UserTransaction transaction;
-
-        @PersistenceUnit
-        private EntityManagerFactory entityMgrFactory;
-
-        @PersistenceContext
-        private EntityManager entityManager;
-
-        public void contextInitialized(ServletContextEvent event) {
-            final ServletContext context = event.getServletContext();
-
-            if (transaction != null) {
-                try {
-                    transaction.begin();
-                    transaction.commit();
-                    context.setAttribute(ContextAttributeName.KEY_Transaction.name(), "Transaction injection successful");
-                } catch (Exception ex) {
-                    ex.printStackTrace();
-                }
-            }
-            if (entityManager != null) {
-                Address a = new Address();
-                try {
-                    entityManager.contains(a);
-                    context.setAttribute(ContextAttributeName.KEY_EntityManager.name(), "Transaction manager injection successful");
-                } catch (Exception ex) {
-                    ex.printStackTrace();
-                }
-            }
-            if (entityMgrFactory != null) {
-                Address a = new Address();
-                try {
-                    EntityManager em = entityMgrFactory.createEntityManager();
-                    em.contains(a);
-                    context.setAttribute(ContextAttributeName.KEY_EntityManagerFactory.name(), "Transaction manager factory injection successful");
-                } catch (Exception ex) {
-                    ex.printStackTrace();
-                }
-            }
-
-
-        }
-
-        public void contextDestroyed(ServletContextEvent event) {
-        }
-
-    }
-
-    public static class PersistenceServletSessionListener implements HttpSessionListener {
-
-        @Resource
-        private UserTransaction transaction;
-
-        @PersistenceUnit
-        private EntityManagerFactory entityMgrFactory;
-
-        @PersistenceContext
-        private EntityManager entityManager;
-
-        public void sessionCreated(HttpSessionEvent event) {
-            final HttpSession context = event.getSession();
-
-            if (transaction != null) {
-                try {
-                    transaction.begin();
-                    transaction.commit();
-                    context.setAttribute(ContextAttributeName.KEY_Transaction.name(), "Transaction injection successful");
-                } catch (Exception ex) {
-                    ex.printStackTrace();
-                }
-            }
-            if (entityManager != null) {
-                Address a = new Address();
-                try {
-                    entityManager.contains(a);
-                    context.setAttribute(ContextAttributeName.KEY_EntityManager.name(), "Transaction manager injection successful");
-                } catch (Exception ex) {
-                    ex.printStackTrace();
-                }
-            }
-            if (entityMgrFactory != null) {
-                Address a = new Address();
-                try {
-                    EntityManager em = entityMgrFactory.createEntityManager();
-                    em.contains(a);
-                    context.setAttribute(ContextAttributeName.KEY_EntityManagerFactory.name(), "Transaction manager factory injection successful");
-                } catch (Exception ex) {
-                    ex.printStackTrace();
-                }
-            }
-
-
-        }
-
-        public void sessionDestroyed(HttpSessionEvent event) {
-        }
-
-    }
-
-    @Entity
-    public static class Address {
-        public String getStreet() {
-            return street;
-        }
-
-        public void setStreet(String street) {
-            this.street = street;
-        }
-
-        public String getCity() {
-            return city;
-        }
-
-        public void setCity(String city) {
-            this.city = city;
-        }
-
-        public String getState() {
-            return state;
-        }
-
-        public void setState(String state) {
-            this.state = state;
-        }
-
-        public String getZip() {
-            return zip;
-        }
-
-        public void setZip(String zip) {
-            this.zip = zip;
-        }
-
-        private String street = "123 Lakeview St.", city = "Paradise", state = "ZZ", zip = "00000";
-
-        public String toString() {
-            return "Street: " + street + ", City: " + city + ", State: " + state + ", Zip: " + zip;
-        }
-    }
-
     private void validateTest(String expectedOutput) throws IOException {
         final InputStream is = new URL("http://localhost:9080/" + TEST_NAME + "/" + TEST_NAME).openStream();
         final ByteArrayOutputStream os = new ByteArrayOutputStream();

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerpersistence/ServletToCheckListener.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerpersistence/ServletToCheckListener.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerpersistence/ServletToCheckListener.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerpersistence/ServletToCheckListener.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,26 @@
+package org.apache.openejb.arquillian.tests.listenerpersistence;
+
+import java.io.IOException;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+public class ServletToCheckListener extends HttpServlet {
+
+    @Override
+    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        final ServletContext ctxt = req.getServletContext();
+        for (ContextAttributeName s : ContextAttributeName.values()) {
+            resp.getOutputStream().println("Context: " + ctxt.getAttribute(s.name()));
+        }
+
+        final HttpSession session = req.getSession();
+        for (ContextAttributeName s : ContextAttributeName.values()) {
+            resp.getOutputStream().println("Session: " + session.getAttribute(s.name()));
+        }
+    }
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/CompanyRemote.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/CompanyRemote.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/CompanyRemote.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/CompanyRemote.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,8 @@
+package org.apache.openejb.arquillian.tests.listenerremote;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface CompanyRemote {
+    public String employ(String employeeName);
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/ContextAttributeName.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/ContextAttributeName.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/ContextAttributeName.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/ContextAttributeName.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,5 @@
+package org.apache.openejb.arquillian.tests.listenerremote;
+
+public enum ContextAttributeName {
+    KEY_Remote,;
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/DefaultCompany.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/DefaultCompany.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/DefaultCompany.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/DefaultCompany.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,14 @@
+package org.apache.openejb.arquillian.tests.listenerremote;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class DefaultCompany implements CompanyRemote {
+
+    private final String name = "TomEE Software Inc.";
+
+    public String employ(String employeeName) {
+        return employeeName + " is employed at " + name;
+    }
+
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/RemoteServletContextListener.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/RemoteServletContextListener.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/RemoteServletContextListener.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/RemoteServletContextListener.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,26 @@
+package org.apache.openejb.arquillian.tests.listenerremote;
+
+import javax.ejb.EJB;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+
+public class RemoteServletContextListener implements ServletContextListener {
+
+    @EJB
+    private CompanyRemote remoteCompany;
+
+    public void contextInitialized(ServletContextEvent event) {
+        final String name = "OpenEJB";
+        final ServletContext context = event.getServletContext();
+
+        if (remoteCompany != null) {
+            context.setAttribute(ContextAttributeName.KEY_Remote.name(), "Remote: " + remoteCompany.employ(name));
+        }
+    }
+
+    public void contextDestroyed(ServletContextEvent event) {
+    }
+
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/RemoteServletSessionListener.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/RemoteServletSessionListener.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/RemoteServletSessionListener.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/RemoteServletSessionListener.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,26 @@
+package org.apache.openejb.arquillian.tests.listenerremote;
+
+import javax.ejb.EJB;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+
+public class RemoteServletSessionListener implements HttpSessionListener {
+
+    @EJB
+    private CompanyRemote remoteCompany;
+
+    public void sessionCreated(HttpSessionEvent event) {
+        final String name = "OpenEJB";
+        final HttpSession context = event.getSession();
+
+        if (remoteCompany != null) {
+            context.setAttribute(ContextAttributeName.KEY_Remote.name(), "Remote: " + remoteCompany.employ(name));
+        }
+    }
+
+    public void sessionDestroyed(HttpSessionEvent event) {
+    }
+
+}
\ No newline at end of file

Copied: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/ServletListenerEjbRemoteTest.java (from r1178936, openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletListenerEjbRemoteTest.java)
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/ServletListenerEjbRemoteTest.java?p2=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/ServletListenerEjbRemoteTest.java&p1=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletListenerEjbRemoteTest.java&r1=1178936&r2=1178974&rev=1178974&view=diff
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletListenerEjbRemoteTest.java (original)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/ServletListenerEjbRemoteTest.java Tue Oct  4 21:56:55 2011
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.openejb.arquillian.tests;
+package org.apache.openejb.arquillian.tests.listenerremote;
 
 import org.jboss.arquillian.api.Deployment;
 import org.jboss.arquillian.junit.Arquillian;
@@ -28,13 +28,6 @@ import org.jboss.shrinkwrap.descriptor.a
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import javax.ejb.EJB;
-import javax.ejb.Remote;
-import javax.ejb.Stateless;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-import javax.servlet.ServletException;
 import javax.servlet.http.*;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -75,6 +68,7 @@ public class ServletListenerEjbRemoteTes
                 .addClass(ServletToCheckListener.class)
                 .addClass(CompanyRemote.class)
                 .addClass(DefaultCompany.class)
+                .addClass(ContextAttributeName.class)
                 .setWebXML(new StringAsset(descriptor.exportAsString()))
                 .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
 
@@ -83,80 +77,6 @@ public class ServletListenerEjbRemoteTes
         return archive;
     }
 
-    public static enum ContextAttributeName {
-        KEY_Remote,;
-    }
-
-    public static class ServletToCheckListener extends HttpServlet {
-
-        @Override
-        public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-            final ServletContext ctxt = req.getServletContext();
-            for (ContextAttributeName s : ContextAttributeName.values()) {
-                resp.getOutputStream().println("Context: " + ctxt.getAttribute(s.name()));
-            }
-
-            final HttpSession session = req.getSession();
-            for (ContextAttributeName s : ContextAttributeName.values()) {
-                resp.getOutputStream().println("Session: " + session.getAttribute(s.name()));
-            }
-        }
-    }
-
-    public static class RemoteServletContextListener implements ServletContextListener {
-
-        @EJB
-        private CompanyRemote remoteCompany;
-
-        public void contextInitialized(ServletContextEvent event) {
-            final String name = "OpenEJB";
-            final ServletContext context = event.getServletContext();
-
-            if (remoteCompany != null) {
-                context.setAttribute(ContextAttributeName.KEY_Remote.name(), "Remote: " + remoteCompany.employ(name));
-            }
-        }
-
-        public void contextDestroyed(ServletContextEvent event) {
-        }
-
-    }
-
-    public static class RemoteServletSessionListener implements HttpSessionListener {
-
-        @EJB
-        private CompanyRemote remoteCompany;
-
-        public void sessionCreated(HttpSessionEvent event) {
-            final String name = "OpenEJB";
-            final HttpSession context = event.getSession();
-
-            if (remoteCompany != null) {
-                context.setAttribute(ContextAttributeName.KEY_Remote.name(), "Remote: " + remoteCompany.employ(name));
-            }
-        }
-
-        public void sessionDestroyed(HttpSessionEvent event) {
-        }
-
-    }
-
-    @Remote
-    public static interface CompanyRemote {
-        public String employ(String employeeName);
-    }
-
-    @Stateless
-    public static class DefaultCompany implements CompanyRemote {
-
-        private final String name = "TomEE Software Inc.";
-
-        public String employ(String employeeName) {
-            return employeeName + " is employed at " + name;
-        }
-
-    }
-
     private void validateTest(String expectedOutput) throws IOException {
         final InputStream is = new URL("http://localhost:9080/" + TEST_NAME + "/" + TEST_NAME).openStream();
         final ByteArrayOutputStream os = new ByteArrayOutputStream();

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/ServletToCheckListener.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/ServletToCheckListener.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/ServletToCheckListener.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/listenerremote/ServletToCheckListener.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,26 @@
+package org.apache.openejb.arquillian.tests.listenerremote;
+
+import java.io.IOException;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+public class ServletToCheckListener extends HttpServlet {
+
+    @Override
+    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        final ServletContext ctxt = req.getServletContext();
+        for (ContextAttributeName s : ContextAttributeName.values()) {
+            resp.getOutputStream().println("Context: " + ctxt.getAttribute(s.name()));
+        }
+
+        final HttpSession session = req.getSession();
+        for (ContextAttributeName s : ContextAttributeName.values()) {
+            resp.getOutputStream().println("Session: " + session.getAttribute(s.name()));
+        }
+    }
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/Company.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/Company.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/Company.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/Company.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,4 @@
+package org.apache.openejb.arquillian.tests.localinject;
+
+public interface Company {
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/CompanyLocal.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/CompanyLocal.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/CompanyLocal.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/CompanyLocal.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,8 @@
+package org.apache.openejb.arquillian.tests.localinject;
+
+import javax.ejb.Local;
+
+@Local
+public interface CompanyLocal extends Company {
+    public String employ(String employeeName);
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/DefaultCompany.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/DefaultCompany.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/DefaultCompany.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/DefaultCompany.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,14 @@
+package org.apache.openejb.arquillian.tests.localinject;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class DefaultCompany implements CompanyLocal {
+
+    private final String name = "TomEE Software Inc.";
+
+    public String employ(String employeeName) {
+        return employeeName + " is employed at " + name;
+    }
+
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/OtherCompany.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/OtherCompany.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/OtherCompany.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/OtherCompany.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,14 @@
+package org.apache.openejb.arquillian.tests.localinject;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class OtherCompany implements CompanyLocal {
+
+    private final String name = "Other Software Inc.";
+
+    public String employ(String employeeName) {
+        return employeeName + " is employed at " + name;
+    }
+
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/PojoServlet.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/PojoServlet.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/PojoServlet.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/PojoServlet.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,35 @@
+package org.apache.openejb.arquillian.tests.localinject;
+
+import java.io.IOException;
+
+import javax.ejb.EJB;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+
+public class PojoServlet extends HttpServlet {
+
+    @EJB(beanName = "DefaultCompany")
+    private CompanyLocal localCompany;
+
+    @EJB
+    private SuperMarket market;
+
+    @Override
+    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        String name = req.getParameter("name");
+        if (StringUtils.isEmpty(name)) {
+            name = "OpenEJB";
+        }
+
+        if (localCompany != null) {
+            resp.getOutputStream().println("Local: " + localCompany.employ(name));
+        }
+        if (market != null) {
+            resp.getOutputStream().println(market.shop(name));
+        }
+    }
+}
\ No newline at end of file

Copied: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/ServletEjbLocalInjectionTest.java (from r1178936, openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletEjbLocalInjectionTest.java)
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/ServletEjbLocalInjectionTest.java?p2=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/ServletEjbLocalInjectionTest.java&p1=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletEjbLocalInjectionTest.java&r1=1178936&r2=1178974&rev=1178974&view=diff
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletEjbLocalInjectionTest.java (original)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/ServletEjbLocalInjectionTest.java Tue Oct  4 21:56:55 2011
@@ -14,9 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.openejb.arquillian.tests;
+package org.apache.openejb.arquillian.tests.localinject;
 
-import org.apache.commons.lang.StringUtils;
 import org.jboss.arquillian.api.Deployment;
 import org.jboss.arquillian.junit.Arquillian;
 import org.jboss.shrinkwrap.api.ArchivePaths;
@@ -32,15 +31,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.annotation.Resource;
-import javax.ejb.EJB;
-import javax.ejb.Local;
-import javax.ejb.LocalBean;
-import javax.ejb.Stateless;
 import javax.inject.Inject;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -84,72 +75,6 @@ public class ServletEjbLocalInjectionTes
         return archive;
     }
 
-    public static class PojoServlet extends HttpServlet {
-
-        @EJB(beanName = "DefaultCompany")
-        private CompanyLocal localCompany;
-
-        @EJB
-        private SuperMarket market;
-
-        @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-            String name = req.getParameter("name");
-            if (StringUtils.isEmpty(name)) {
-                name = "OpenEJB";
-            }
-
-            if (localCompany != null) {
-                resp.getOutputStream().println("Local: " + localCompany.employ(name));
-            }
-            if (market != null) {
-                resp.getOutputStream().println(market.shop(name));
-            }
-        }
-    }
-
-    public static interface Company {
-    }
-
-    @Local
-    public static interface CompanyLocal extends Company {
-        public String employ(String employeeName);
-    }
-
-    @Stateless
-    public static class DefaultCompany implements CompanyLocal {
-
-        private final String name = "TomEE Software Inc.";
-
-        public String employ(String employeeName) {
-            return employeeName + " is employed at " + name;
-        }
-
-    }
-
-    @Stateless
-    public static class OtherCompany implements CompanyLocal {
-
-        private final String name = "Other Software Inc.";
-
-        public String employ(String employeeName) {
-            return employeeName + " is employed at " + name;
-        }
-
-    }
-
-    @Stateless
-    @LocalBean
-    public static class SuperMarket {
-
-        private final String name = "Apache Marketplace";
-
-        public String shop(String employeeName) {
-            return employeeName + " shops at " + name;
-        }
-
-    }
-
     private void validateTest(String expectedOutput) throws IOException {
         final InputStream is = new URL("http://localhost:9080/" + TEST_NAME + "/" + TEST_NAME).openStream();
         final ByteArrayOutputStream os = new ByteArrayOutputStream();

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/SuperMarket.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/SuperMarket.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/SuperMarket.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/localinject/SuperMarket.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,16 @@
+package org.apache.openejb.arquillian.tests.localinject;
+
+import javax.ejb.LocalBean;
+import javax.ejb.Stateless;
+
+@Stateless
+@LocalBean
+public class SuperMarket {
+
+    private final String name = "Apache Marketplace";
+
+    public String shop(String employeeName) {
+        return employeeName + " shops at " + name;
+    }
+
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/Environment.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/Environment.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/Environment.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/Environment.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,20 @@
+package org.apache.openejb.arquillian.tests.modulename;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface Environment {
+    String getReturnEmail();
+
+    Integer getConnectionPool();
+
+    Long getStartCount();
+
+    Short getInitSize();
+
+    Byte getTotalQuantity();
+
+    Boolean getEnableEmail();
+
+    Character getOptionDefault();
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/Green.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/Green.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/Green.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/Green.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,78 @@
+package org.apache.openejb.arquillian.tests.modulename;
+
+import javax.annotation.Resource;
+import javax.inject.Inject;
+
+
+public class Green implements Environment {
+
+    @Resource(name = "returnEmail")
+    private String returnEmail;
+
+    @Resource(name = "connectionPool")
+    private Integer connectionPool;
+
+    @Resource(name = "startCount")
+    private Long startCount;
+
+    @Resource(name = "initSize")
+    private Short initSize;
+
+    @Resource(name = "totalQuantity")
+    private Byte totalQuantity;
+
+    @Resource(name = "enableEmail")
+    private Boolean enableEmail;
+
+    @Resource(name = "optionDefault")
+    private Character optionDefault;
+
+    @Inject
+    public Green() {
+    }
+
+    public Green(String returnEmail, Integer connectionPool, Long startCount, Short initSize, Byte totalQuantity, Boolean enableEmail, Character optionDefault) {
+        this.returnEmail = returnEmail;
+        this.connectionPool = connectionPool;
+        this.startCount = startCount;
+        this.initSize = initSize;
+        this.totalQuantity = totalQuantity;
+        this.enableEmail = enableEmail;
+        this.optionDefault = optionDefault;
+    }
+
+    @Override
+    public String getReturnEmail() {
+        return returnEmail;
+    }
+
+    @Override
+    public Integer getConnectionPool() {
+        return connectionPool;
+    }
+
+    @Override
+    public Long getStartCount() {
+        return startCount;
+    }
+
+    @Override
+    public Short getInitSize() {
+        return initSize;
+    }
+
+    @Override
+    public Byte getTotalQuantity() {
+        return totalQuantity;
+    }
+
+    @Override
+    public Boolean getEnableEmail() {
+        return enableEmail;
+    }
+
+    @Override
+    public Character getOptionDefault() {
+        return optionDefault;
+    }
+}
\ No newline at end of file

Copied: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/ModuleNameInjectionTest.java (from r1178525, openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ModuleNameInjectionTest.java)
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/ModuleNameInjectionTest.java?p2=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/ModuleNameInjectionTest.java&p1=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ModuleNameInjectionTest.java&r1=1178525&r2=1178974&rev=1178974&view=diff
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ModuleNameInjectionTest.java (original)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/ModuleNameInjectionTest.java Tue Oct  4 21:56:55 2011
@@ -14,30 +14,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.openejb.arquillian.tests;
+package org.apache.openejb.arquillian.tests.modulename;
 
+import org.apache.openejb.arquillian.tests.TestRun;
+import org.apache.openejb.arquillian.tests.TestSetup;
 import org.jboss.arquillian.api.Deployment;
 import org.jboss.arquillian.junit.Arquillian;
 import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.jboss.shrinkwrap.descriptor.api.Node;
 import org.jboss.shrinkwrap.descriptor.api.spec.servlet.web.WebAppDescriptor;
-import org.jboss.shrinkwrap.descriptor.spi.NodeProvider;
-import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import javax.annotation.Resource;
-import javax.ejb.EJB;
-import javax.ejb.LocalBean;
-import javax.ejb.Singleton;
-import javax.inject.Inject;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import java.io.IOException;
 
 @RunWith(Arquillian.class)
 public class ModuleNameInjectionTest extends TestSetup {
@@ -61,269 +48,12 @@ public class ModuleNameInjectionTest ext
 
     @Deployment(testable = false)
     public static WebArchive getArchive() {
-        return new ModuleNameInjectionTest().createDeployment(PojoServletFilter.class, Orange.class, Green.class);
+        return new ModuleNameInjectionTest().createDeployment(TestRun.class, Environment.class, PojoServletFilter.class, Orange.class, Green.class);
     }
 
     protected void decorateDescriptor(WebAppDescriptor descriptor) {
         descriptor.filter(PojoServletFilter.class, "/" + getTestContextName());
     }
-
-    public static class PojoServletFilter implements Filter, Environment {
-
-        @Resource(name = "returnEmail")
-        private String returnEmail;
-
-        @Resource(name = "connectionPool")
-        private Integer connectionPool;
-
-        @Resource(name = "startCount")
-        private Long startCount;
-
-        @Resource(name = "initSize")
-        private Short initSize;
-
-        @Resource(name = "totalQuantity")
-        private Byte totalQuantity;
-
-        @Resource(name = "enableEmail")
-        private Boolean enableEmail;
-
-        @Resource(name = "optionDefault")
-        private Character optionDefault;
-
-        @Override
-        public String getReturnEmail() {
-            return returnEmail;
-        }
-
-        @Override
-        public Integer getConnectionPool() {
-            return connectionPool;
-        }
-
-        @Override
-        public Long getStartCount() {
-            return startCount;
-        }
-
-        @Override
-        public Short getInitSize() {
-            return initSize;
-        }
-
-        @Override
-        public Byte getTotalQuantity() {
-            return totalQuantity;
-        }
-
-        @Override
-        public Boolean getEnableEmail() {
-            return enableEmail;
-        }
-
-        @Override
-        public Character getOptionDefault() {
-            return optionDefault;
-        }
-
-        @Inject
-        private Green green;
-
-        @EJB
-        private Orange orange;
-
-        public void init(FilterConfig config) {
-        }
-
-        public void destroy() {
-        }
-
-        @Override
-        public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
-            run(req, resp, this);
-        }
-
-
-        public void testCdi() {
-            assertEnvironment(green);
-        }
-
-        public void testEjb() {
-            assertEnvironment(orange);
-        }
-
-        public void testFilter() {
-            assertEnvironment(this);
-        }
-
-        public void assertEnvironment(Environment actual) {
-            Assert.assertNotNull("component", actual);
-
-            Environment expected = new Green("tomee@apache.org", 20, 200000l, (short) 6, (byte) 5, true, 'X');
-
-            Assert.assertEquals("ReturnEmail", expected.getReturnEmail(), actual.getReturnEmail());
-            Assert.assertEquals("ConnectionPool", expected.getConnectionPool(), actual.getConnectionPool());
-            Assert.assertEquals("StartCount", expected.getStartCount(), actual.getStartCount());
-            Assert.assertEquals("InitSize", expected.getInitSize(), actual.getInitSize());
-            Assert.assertEquals("TotalQuantity", expected.getTotalQuantity(), actual.getTotalQuantity());
-            Assert.assertEquals("EnableEmail", expected.getEnableEmail(), actual.getEnableEmail());
-            Assert.assertEquals("OptionDefault", expected.getOptionDefault(), actual.getOptionDefault());
-        }
-    }
-
-    public static class Green implements Environment {
-
-        @Resource(name = "returnEmail")
-        private String returnEmail;
-
-        @Resource(name = "connectionPool")
-        private Integer connectionPool;
-
-        @Resource(name = "startCount")
-        private Long startCount;
-
-        @Resource(name = "initSize")
-        private Short initSize;
-
-        @Resource(name = "totalQuantity")
-        private Byte totalQuantity;
-
-        @Resource(name = "enableEmail")
-        private Boolean enableEmail;
-
-        @Resource(name = "optionDefault")
-        private Character optionDefault;
-
-        @Inject
-        public Green() {
-        }
-
-        public Green(String returnEmail, Integer connectionPool, Long startCount, Short initSize, Byte totalQuantity, Boolean enableEmail, Character optionDefault) {
-            this.returnEmail = returnEmail;
-            this.connectionPool = connectionPool;
-            this.startCount = startCount;
-            this.initSize = initSize;
-            this.totalQuantity = totalQuantity;
-            this.enableEmail = enableEmail;
-            this.optionDefault = optionDefault;
-        }
-
-        @Override
-        public String getReturnEmail() {
-            return returnEmail;
-        }
-
-        @Override
-        public Integer getConnectionPool() {
-            return connectionPool;
-        }
-
-        @Override
-        public Long getStartCount() {
-            return startCount;
-        }
-
-        @Override
-        public Short getInitSize() {
-            return initSize;
-        }
-
-        @Override
-        public Byte getTotalQuantity() {
-            return totalQuantity;
-        }
-
-        @Override
-        public Boolean getEnableEmail() {
-            return enableEmail;
-        }
-
-        @Override
-        public Character getOptionDefault() {
-            return optionDefault;
-        }
-    }
-
-    @Singleton
-    @LocalBean
-    public static class Orange implements Environment {
-
-        @Resource(name = "returnEmail")
-        private String returnEmail;
-
-        @Resource(name = "connectionPool")
-        private Integer connectionPool;
-
-        @Resource(name = "startCount")
-        private Long startCount;
-
-        @Resource(name = "initSize")
-        private Short initSize;
-
-        @Resource(name = "totalQuantity")
-        private Byte totalQuantity;
-
-        @Resource(name = "enableEmail")
-        private Boolean enableEmail;
-
-        @Resource(name = "optionDefault")
-        private Character optionDefault;
-
-        @Override
-        public String getReturnEmail() {
-            return returnEmail;
-        }
-
-        @Override
-        public Integer getConnectionPool() {
-            return connectionPool;
-        }
-
-        @Override
-        public Long getStartCount() {
-            return startCount;
-        }
-
-        @Override
-        public Short getInitSize() {
-            return initSize;
-        }
-
-        @Override
-        public Byte getTotalQuantity() {
-            return totalQuantity;
-        }
-
-        @Override
-        public Boolean getEnableEmail() {
-            return enableEmail;
-        }
-
-        @Override
-        public Character getOptionDefault() {
-            return optionDefault;
-        }
-    }
-
-
-    /**
-     * @version $Rev$ $Date$
-     */
-    public static interface Environment {
-        String getReturnEmail();
-
-        Integer getConnectionPool();
-
-        Long getStartCount();
-
-        Short getInitSize();
-
-        Byte getTotalQuantity();
-
-        Boolean getEnableEmail();
-
-        Character getOptionDefault();
-    }
 }
 
 

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/Orange.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/Orange.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/Orange.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/Orange.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,67 @@
+package org.apache.openejb.arquillian.tests.modulename;
+
+import javax.annotation.Resource;
+import javax.ejb.LocalBean;
+import javax.ejb.Singleton;
+
+
+@Singleton
+@LocalBean
+public class Orange implements Environment {
+
+    @Resource(name = "returnEmail")
+    private String returnEmail;
+
+    @Resource(name = "connectionPool")
+    private Integer connectionPool;
+
+    @Resource(name = "startCount")
+    private Long startCount;
+
+    @Resource(name = "initSize")
+    private Short initSize;
+
+    @Resource(name = "totalQuantity")
+    private Byte totalQuantity;
+
+    @Resource(name = "enableEmail")
+    private Boolean enableEmail;
+
+    @Resource(name = "optionDefault")
+    private Character optionDefault;
+
+    @Override
+    public String getReturnEmail() {
+        return returnEmail;
+    }
+
+    @Override
+    public Integer getConnectionPool() {
+        return connectionPool;
+    }
+
+    @Override
+    public Long getStartCount() {
+        return startCount;
+    }
+
+    @Override
+    public Short getInitSize() {
+        return initSize;
+    }
+
+    @Override
+    public Byte getTotalQuantity() {
+        return totalQuantity;
+    }
+
+    @Override
+    public Boolean getEnableEmail() {
+        return enableEmail;
+    }
+
+    @Override
+    public Character getOptionDefault() {
+        return optionDefault;
+    }
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/PojoServletFilter.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/PojoServletFilter.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/PojoServletFilter.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/modulename/PojoServletFilter.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,119 @@
+package org.apache.openejb.arquillian.tests.modulename;
+
+import java.io.IOException;
+
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+import javax.inject.Inject;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+import org.apache.openejb.arquillian.tests.TestRun;
+import org.junit.Assert;
+
+public class PojoServletFilter implements Filter, Environment {
+
+    @Resource(name = "returnEmail")
+    private String returnEmail;
+
+    @Resource(name = "connectionPool")
+    private Integer connectionPool;
+
+    @Resource(name = "startCount")
+    private Long startCount;
+
+    @Resource(name = "initSize")
+    private Short initSize;
+
+    @Resource(name = "totalQuantity")
+    private Byte totalQuantity;
+
+    @Resource(name = "enableEmail")
+    private Boolean enableEmail;
+
+    @Resource(name = "optionDefault")
+    private Character optionDefault;
+
+    @Override
+    public String getReturnEmail() {
+        return returnEmail;
+    }
+
+    @Override
+    public Integer getConnectionPool() {
+        return connectionPool;
+    }
+
+    @Override
+    public Long getStartCount() {
+        return startCount;
+    }
+
+    @Override
+    public Short getInitSize() {
+        return initSize;
+    }
+
+    @Override
+    public Byte getTotalQuantity() {
+        return totalQuantity;
+    }
+
+    @Override
+    public Boolean getEnableEmail() {
+        return enableEmail;
+    }
+
+    @Override
+    public Character getOptionDefault() {
+        return optionDefault;
+    }
+
+    @Inject
+    private Green green;
+
+    @EJB
+    private Orange orange;
+
+    public void init(FilterConfig config) {
+    }
+
+    public void destroy() {
+    }
+
+    @Override
+    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
+        TestRun.run(req, resp, this);
+    }
+
+
+    public void testCdi() {
+        assertEnvironment(green);
+    }
+
+    public void testEjb() {
+        assertEnvironment(orange);
+    }
+
+    public void testFilter() {
+        assertEnvironment(this);
+    }
+
+    public void assertEnvironment(Environment actual) {
+        Assert.assertNotNull("component", actual);
+
+        Environment expected = new Green("tomee@apache.org", 20, 200000l, (short) 6, (byte) 5, true, 'X');
+
+        Assert.assertEquals("ReturnEmail", expected.getReturnEmail(), actual.getReturnEmail());
+        Assert.assertEquals("ConnectionPool", expected.getConnectionPool(), actual.getConnectionPool());
+        Assert.assertEquals("StartCount", expected.getStartCount(), actual.getStartCount());
+        Assert.assertEquals("InitSize", expected.getInitSize(), actual.getInitSize());
+        Assert.assertEquals("TotalQuantity", expected.getTotalQuantity(), actual.getTotalQuantity());
+        Assert.assertEquals("EnableEmail", expected.getEnableEmail(), actual.getEnableEmail());
+        Assert.assertEquals("OptionDefault", expected.getOptionDefault(), actual.getOptionDefault());
+    }
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/persistence/Address.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/persistence/Address.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/persistence/Address.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/persistence/Address.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,44 @@
+package org.apache.openejb.arquillian.tests.persistence;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Address {
+    public String getStreet() {
+        return street;
+    }
+
+    public void setStreet(String street) {
+        this.street = street;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getZip() {
+        return zip;
+    }
+
+    public void setZip(String zip) {
+        this.zip = zip;
+    }
+
+    private String street = "123 Lakeview St.", city = "Paradise", state = "ZZ", zip = "00000";
+
+    public String toString() {
+        return "Street: " + street + ", City: " + city + ", State: " + state + ", Zip: " + zip;
+    }
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/persistence/PersistenceServlet.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/persistence/PersistenceServlet.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/persistence/PersistenceServlet.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/persistence/PersistenceServlet.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,55 @@
+package org.apache.openejb.arquillian.tests.persistence;
+
+import java.io.IOException;
+
+import javax.annotation.Resource;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceUnit;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.transaction.UserTransaction;
+
+import org.apache.openejb.arquillian.tests.Runner;
+import org.junit.Assert;
+
+public class PersistenceServlet extends HttpServlet {
+
+    @Resource
+    private UserTransaction transaction;
+
+    @PersistenceUnit
+    private EntityManagerFactory entityMgrFactory;
+
+    @PersistenceContext
+    private EntityManager entityManager;
+
+    @Override
+    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        Runner.run(req, resp, this);
+    }
+
+    public void testEntityManagerFactory() {
+        Assert.assertNotNull(entityMgrFactory);
+
+        Address a = new Address();
+        EntityManager em = entityMgrFactory.createEntityManager();
+        em.contains(a);
+    }
+
+    public void testEntityManager() {
+        Assert.assertNotNull(entityManager);
+        Address a = new Address();
+        entityManager.contains(a);
+    }
+
+    public void testUserTransaction() throws Exception{
+        Assert.assertNotNull(transaction);
+        transaction.begin();
+        transaction.commit();
+    }
+
+}
\ No newline at end of file

Copied: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/persistence/ServletPersistenceInjectionTest.java (from r1178936, openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletPersistenceInjectionTest.java)
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/persistence/ServletPersistenceInjectionTest.java?p2=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/persistence/ServletPersistenceInjectionTest.java&p1=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletPersistenceInjectionTest.java&r1=1178936&r2=1178974&rev=1178974&view=diff
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletPersistenceInjectionTest.java (original)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/persistence/ServletPersistenceInjectionTest.java Tue Oct  4 21:56:55 2011
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.openejb.arquillian.tests;
+package org.apache.openejb.arquillian.tests.persistence;
 
 import org.jboss.arquillian.api.Deployment;
 import org.jboss.arquillian.junit.Arquillian;
@@ -24,21 +24,9 @@ import org.jboss.shrinkwrap.api.asset.St
 import org.jboss.shrinkwrap.api.spec.WebArchive;
 import org.jboss.shrinkwrap.descriptor.api.Descriptors;
 import org.jboss.shrinkwrap.descriptor.api.spec.servlet.web.WebAppDescriptor;
-import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import javax.annotation.Resource;
-import javax.persistence.Entity;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceUnit;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.transaction.UserTransaction;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -88,86 +76,6 @@ public class ServletPersistenceInjection
     }
 
 
-    public static class PersistenceServlet extends HttpServlet {
-
-        @Resource
-        private UserTransaction transaction;
-
-        @PersistenceUnit
-        private EntityManagerFactory entityMgrFactory;
-
-        @PersistenceContext
-        private EntityManager entityManager;
-
-        @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-            Runner.run(req, resp, this);
-        }
-
-        public void testEntityManagerFactory() {
-            Assert.assertNotNull(entityMgrFactory);
-
-            Address a = new Address();
-            EntityManager em = entityMgrFactory.createEntityManager();
-            em.contains(a);
-        }
-
-        public void testEntityManager() {
-            Assert.assertNotNull(entityManager);
-            Address a = new Address();
-            entityManager.contains(a);
-        }
-
-        public void testUserTransaction() throws Exception{
-            Assert.assertNotNull(transaction);
-            transaction.begin();
-            transaction.commit();
-        }
-
-    }
-
-
-    @Entity
-    public static class Address {
-        public String getStreet() {
-            return street;
-        }
-
-        public void setStreet(String street) {
-            this.street = street;
-        }
-
-        public String getCity() {
-            return city;
-        }
-
-        public void setCity(String city) {
-            this.city = city;
-        }
-
-        public String getState() {
-            return state;
-        }
-
-        public void setState(String state) {
-            this.state = state;
-        }
-
-        public String getZip() {
-            return zip;
-        }
-
-        public void setZip(String zip) {
-            this.zip = zip;
-        }
-
-        private String street = "123 Lakeview St.", city = "Paradise", state = "ZZ", zip = "00000";
-
-        public String toString() {
-            return "Street: " + street + ", City: " + city + ", State: " + state + ", Zip: " + zip;
-        }
-    }
-
     private void validateTest(String expectedOutput) throws IOException {
         final InputStream is = new URL("http://localhost:9080/" + TEST_NAME + "/" + TEST_NAME).openStream();
         final ByteArrayOutputStream os = new ByteArrayOutputStream();

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/CompanyRemote.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/CompanyRemote.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/CompanyRemote.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/CompanyRemote.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,8 @@
+package org.apache.openejb.arquillian.tests.remote;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface CompanyRemote {
+    public String employ(String employeeName);
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/DefaultCompany.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/DefaultCompany.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/DefaultCompany.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/DefaultCompany.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,14 @@
+package org.apache.openejb.arquillian.tests.remote;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class DefaultCompany implements CompanyRemote {
+
+    private final String name = "TomEE Software Inc.";
+
+    public String employ(String employeeName) {
+        return employeeName + " is employed at " + name;
+    }
+
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/RemoteServlet.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/RemoteServlet.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/RemoteServlet.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/RemoteServlet.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,30 @@
+package org.apache.openejb.arquillian.tests.remote;
+
+import java.io.IOException;
+
+import javax.ejb.EJB;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+
+public class RemoteServlet extends HttpServlet {
+
+    @EJB
+    private CompanyRemote remoteCompany;
+
+    @Override
+    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        String name = req.getParameter("name");
+        if (StringUtils.isEmpty(name)) {
+            name = "OpenEJB";
+        }
+
+        if (remoteCompany != null) {
+            resp.getOutputStream().println("Remote: " + remoteCompany.employ(name));
+        }
+    }
+
+}
\ No newline at end of file

Copied: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/ServletEjbRemoteTest.java (from r1178936, openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletEjbRemoteTest.java)
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/ServletEjbRemoteTest.java?p2=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/ServletEjbRemoteTest.java&p1=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletEjbRemoteTest.java&r1=1178936&r2=1178974&rev=1178974&view=diff
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletEjbRemoteTest.java (original)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/remote/ServletEjbRemoteTest.java Tue Oct  4 21:56:55 2011
@@ -14,9 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.openejb.arquillian.tests;
+package org.apache.openejb.arquillian.tests.remote;
 
-import org.apache.commons.lang.StringUtils;
 import org.jboss.arquillian.api.Deployment;
 import org.jboss.arquillian.junit.Arquillian;
 import org.jboss.shrinkwrap.api.ArchivePaths;
@@ -29,13 +28,6 @@ import org.jboss.shrinkwrap.descriptor.a
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import javax.ejb.EJB;
-import javax.ejb.Remote;
-import javax.ejb.Stateless;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -72,41 +64,6 @@ public class ServletEjbRemoteTest {
         return archive;
     }
 
-    public static class RemoteServlet extends HttpServlet {
-
-        @EJB
-        private CompanyRemote remoteCompany;
-
-        @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-            String name = req.getParameter("name");
-            if (StringUtils.isEmpty(name)) {
-                name = "OpenEJB";
-            }
-
-            if (remoteCompany != null) {
-                resp.getOutputStream().println("Remote: " + remoteCompany.employ(name));
-            }
-        }
-
-    }
-
-    @Remote
-    public static interface CompanyRemote {
-        public String employ(String employeeName);
-    }
-
-    @Stateless
-    public static class DefaultCompany implements CompanyRemote {
-
-        private final String name = "TomEE Software Inc.";
-
-        public String employ(String employeeName) {
-            return employeeName + " is employed at " + name;
-        }
-
-    }
-
     private void validateTest(String expectedOutput) throws IOException {
         final InputStream is = new URL("http://localhost:9080/" + TEST_NAME + "/" + TEST_NAME).openStream();
         final ByteArrayOutputStream os = new ByteArrayOutputStream();

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Blue.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Blue.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Blue.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Blue.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,68 @@
+package org.apache.openejb.arquillian.tests.resenventry;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+
+import javax.annotation.Resource;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.transaction.TransactionManager;
+import javax.transaction.TransactionSynchronizationRegistry;
+import javax.transaction.UserTransaction;
+import javax.validation.Validator;
+import javax.validation.ValidatorFactory;
+
+import org.apache.openejb.arquillian.tests.TestRun;
+import org.junit.Assert;
+
+@WebServlet("/blue")
+public class Blue extends HttpServlet {
+
+    @Resource(name = "java:comp/Validator")
+    private Validator validator;
+
+    @Resource(name = "java:comp/ValidatorFactory")
+    private ValidatorFactory validatorFactory;
+
+    @Resource(name = "java:comp/TransactionManager")
+    private TransactionManager transactionManager;
+
+    @Resource(name = "java:comp/TransactionSynchronizationRegistry")
+    private TransactionSynchronizationRegistry transactionSynchronizationRegistry;
+
+    @Resource(name = "java:comp/UserTransaction")
+    private UserTransaction userTransaction;
+
+    @Resource(name = "java:comp/BeanManager")
+    private BeanManager beanManager;
+
+    @Resource(name = "java:app/AppName")
+    private String app;
+
+    @Resource(name = "java:module/ModuleName")
+    private String module;
+
+    @Override
+    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        TestRun.run(req, resp, this);
+    }
+
+    public void test() throws Exception {
+
+        final Field[] fields = this.getClass().getDeclaredFields();
+
+        for (Field field : fields) {
+            field.setAccessible(true);
+            Assert.assertNotNull(field.getName(), field.get(this));
+        }
+
+        final String name = ServletResourceEnvEntryInjectionTest.class.getSimpleName();
+        Assert.assertEquals("app", name, app);
+        Assert.assertEquals("module", name, module);
+    }
+
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Green.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Green.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Green.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Green.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,9 @@
+package org.apache.openejb.arquillian.tests.resenventry;
+
+import javax.ejb.Singleton;
+
+@Singleton
+public class Green {
+
+    public void foo() {}
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Orange.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Orange.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Orange.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Orange.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,53 @@
+package org.apache.openejb.arquillian.tests.resenventry;
+
+import java.io.IOException;
+
+import javax.annotation.Resource;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.transaction.TransactionManager;
+import javax.transaction.TransactionSynchronizationRegistry;
+import javax.transaction.UserTransaction;
+import javax.validation.ValidatorFactory;
+
+import org.apache.openejb.arquillian.tests.TestRun;
+import org.junit.Assert;
+
+@WebServlet("/orange")
+public class Orange extends HttpServlet {
+
+    @Resource(name = "java:app/some/longer/path/MyValidatorFactory")
+    private ValidatorFactory validatorFactory;
+
+    @Resource(name = "java:app/some/longer/path/MyTransactionManager")
+    private TransactionManager transactionManager;
+
+    @Resource(name = "java:app/some/longer/path/MyTransactionSynchronizationRegistry")
+    private TransactionSynchronizationRegistry transactionSynchronizationRegistry;
+
+    @Resource(name = "java:app/some/longer/path/MyUserTransaction")
+    private UserTransaction userTransaction;
+
+    @Resource(name = "java:app/some/longer/path/MyBeanManager")
+    private BeanManager beanManager;
+
+    @Resource(name = "java:app/AppName")
+    private String app;
+
+    @Override
+    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        TestRun.run(req, resp, this);
+    }
+
+    public void test() throws Exception {
+
+        ServletResourceEnvEntryInjectionTest.assertFields(this);
+
+        Assert.assertEquals("app", "BuiltInEnvironmentEntriesTest", app);
+    }
+
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Purple.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Purple.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Purple.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Purple.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,36 @@
+package org.apache.openejb.arquillian.tests.resenventry;
+
+import javax.annotation.ManagedBean;
+import javax.annotation.Resource;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.transaction.TransactionManager;
+import javax.transaction.TransactionSynchronizationRegistry;
+import javax.transaction.UserTransaction;
+import javax.validation.Validator;
+import javax.validation.ValidatorFactory;
+
+@ManagedBean
+public class Purple {
+
+    @Resource
+    private Validator validator;
+
+    @Resource
+    private ValidatorFactory validatorFactory;
+
+    @Resource
+    private TransactionManager transactionManager;
+
+    @Resource
+    private TransactionSynchronizationRegistry transactionSynchronizationRegistry;
+
+    @Resource
+    private UserTransaction userTransaction;
+
+    @Resource
+    private BeanManager beanManager;
+
+    public void test() throws IllegalAccessException {
+        ServletResourceEnvEntryInjectionTest.assertFields(this);
+    }
+}
\ No newline at end of file

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Red.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Red.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Red.java (added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/Red.java Tue Oct  4 21:56:55 2011
@@ -0,0 +1,62 @@
+package org.apache.openejb.arquillian.tests.resenventry;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+
+import javax.annotation.Resource;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.transaction.TransactionManager;
+import javax.transaction.TransactionSynchronizationRegistry;
+import javax.transaction.UserTransaction;
+import javax.validation.Validator;
+import javax.validation.ValidatorFactory;
+
+import org.apache.openejb.arquillian.tests.TestRun;
+import org.junit.Assert;
+
+@WebServlet("/red")
+public class Red  extends HttpServlet {
+
+    @Resource
+    private Validator validator;
+
+    @Resource
+    private ValidatorFactory validatorFactory;
+
+    @Resource
+    private TransactionManager transactionManager;
+
+    @Resource
+    private TransactionSynchronizationRegistry transactionSynchronizationRegistry;
+
+    @Resource
+    private UserTransaction userTransaction;
+
+    @Resource
+    private BeanManager beanManager;
+
+    @Resource
+    private Purple purple;
+
+    @Override
+    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        TestRun.run(req, resp, this);
+    }
+
+    public void test() throws Exception {
+
+        final Field[] fields = this.getClass().getDeclaredFields();
+
+        for (Field field : fields) {
+            field.setAccessible(true);
+            Assert.assertNotNull(field.getName(), field.get(this));
+        }
+
+        purple.test();
+    }
+}
\ No newline at end of file

Copied: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/ServletResourceEnvEntryInjectionTest.java (from r1178936, openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletResourceEnvEntryInjectionTest.java)
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/ServletResourceEnvEntryInjectionTest.java?p2=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/ServletResourceEnvEntryInjectionTest.java&p1=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletResourceEnvEntryInjectionTest.java&r1=1178936&r2=1178974&rev=1178974&view=diff
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/ServletResourceEnvEntryInjectionTest.java (original)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/resenventry/ServletResourceEnvEntryInjectionTest.java Tue Oct  4 21:56:55 2011
@@ -14,31 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.openejb.arquillian.tests;
+package org.apache.openejb.arquillian.tests.resenventry;
 
+import org.apache.openejb.arquillian.tests.TestRun;
+import org.apache.openejb.arquillian.tests.TestSetup;
 import org.jboss.arquillian.api.Deployment;
 import org.jboss.arquillian.junit.Arquillian;
 import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import javax.annotation.ManagedBean;
-import javax.annotation.Resource;
-import javax.ejb.Singleton;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.servlet.ServletException;
-import javax.servlet.annotation.WebServlet;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.transaction.TransactionManager;
-import javax.transaction.TransactionSynchronizationRegistry;
-import javax.transaction.UserTransaction;
-import javax.validation.Validator;
-import javax.validation.ValidatorFactory;
-import java.io.IOException;
-import java.lang.reflect.Field;
 
 import static junit.framework.Assert.assertNotNull;
 import static junit.framework.Assert.assertTrue;
@@ -60,165 +45,7 @@ public class ServletResourceEnvEntryInje
 
     @Deployment(testable = false)
     public static WebArchive getArchive() {
-        return new ServletResourceEnvEntryInjectionTest().createDeployment(ServletResourceEnvEntryInjectionTest.class, Blue.class, Red.class, Green.class, Orange.class, Purple.class);
-    }
-
-    @WebServlet("/blue")
-    public static class Blue extends HttpServlet {
-
-        @Resource(name = "java:comp/Validator")
-        private Validator validator;
-
-        @Resource(name = "java:comp/ValidatorFactory")
-        private ValidatorFactory validatorFactory;
-
-        @Resource(name = "java:comp/TransactionManager")
-        private TransactionManager transactionManager;
-
-        @Resource(name = "java:comp/TransactionSynchronizationRegistry")
-        private TransactionSynchronizationRegistry transactionSynchronizationRegistry;
-
-        @Resource(name = "java:comp/UserTransaction")
-        private UserTransaction userTransaction;
-
-        @Resource(name = "java:comp/BeanManager")
-        private BeanManager beanManager;
-
-        @Resource(name = "java:app/AppName")
-        private String app;
-
-        @Resource(name = "java:module/ModuleName")
-        private String module;
-
-        @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-            run(req, resp, this);
-        }
-
-        public void test() throws Exception {
-
-            final Field[] fields = this.getClass().getDeclaredFields();
-
-            for (Field field : fields) {
-                field.setAccessible(true);
-                Assert.assertNotNull(field.getName(), field.get(this));
-            }
-
-            final String name = ServletResourceEnvEntryInjectionTest.class.getSimpleName();
-            Assert.assertEquals("app", name, app);
-            Assert.assertEquals("module", name, module);
-        }
-
-    }
-
-
-    @WebServlet("/red")
-    public static class Red  extends HttpServlet {
-
-        @Resource
-        private Validator validator;
-
-        @Resource
-        private ValidatorFactory validatorFactory;
-
-        @Resource
-        private TransactionManager transactionManager;
-
-        @Resource
-        private TransactionSynchronizationRegistry transactionSynchronizationRegistry;
-
-        @Resource
-        private UserTransaction userTransaction;
-
-        @Resource
-        private BeanManager beanManager;
-
-        @Resource
-        private Purple purple;
-
-        @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-            run(req, resp, this);
-        }
-
-        public void test() throws Exception {
-
-            final Field[] fields = this.getClass().getDeclaredFields();
-
-            for (Field field : fields) {
-                field.setAccessible(true);
-                Assert.assertNotNull(field.getName(), field.get(this));
-            }
-
-            purple.test();
-        }
-    }
-
-    @Singleton
-    public static class Green {
-
-        public void foo() {}
-    }
-
-    @WebServlet("/orange")
-    public static class Orange extends HttpServlet {
-
-        @Resource(name = "java:app/some/longer/path/MyValidatorFactory")
-        private ValidatorFactory validatorFactory;
-
-        @Resource(name = "java:app/some/longer/path/MyTransactionManager")
-        private TransactionManager transactionManager;
-
-        @Resource(name = "java:app/some/longer/path/MyTransactionSynchronizationRegistry")
-        private TransactionSynchronizationRegistry transactionSynchronizationRegistry;
-
-        @Resource(name = "java:app/some/longer/path/MyUserTransaction")
-        private UserTransaction userTransaction;
-
-        @Resource(name = "java:app/some/longer/path/MyBeanManager")
-        private BeanManager beanManager;
-
-        @Resource(name = "java:app/AppName")
-        private String app;
-
-        @Override
-        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-            run(req, resp, this);
-        }
-
-        public void test() throws Exception {
-
-            assertFields(this);
-
-            Assert.assertEquals("app", "BuiltInEnvironmentEntriesTest", app);
-        }
-
-    }
-
-    @ManagedBean
-    public static class Purple {
-
-        @Resource
-        private Validator validator;
-
-        @Resource
-        private ValidatorFactory validatorFactory;
-
-        @Resource
-        private TransactionManager transactionManager;
-
-        @Resource
-        private TransactionSynchronizationRegistry transactionSynchronizationRegistry;
-
-        @Resource
-        private UserTransaction userTransaction;
-
-        @Resource
-        private BeanManager beanManager;
-
-        public void test() throws IllegalAccessException {
-            assertFields(this);
-        }
+        return new ServletResourceEnvEntryInjectionTest().createDeployment(TestRun.class, ServletResourceEnvEntryInjectionTest.class, Blue.class, Red.class, Green.class, Orange.class, Purple.class);
     }
 }
 



Mime
View raw message