tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgallim...@apache.org
Subject svn commit: r1178974 [4/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
Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/Environment.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/Environment.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/Environment.java
(added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/Environment.java
Tue Oct  4 21:56:55 2011
@@ -0,0 +1,20 @@
+package org.apache.openejb.arquillian.tests.sharedenv;
+
+/**
+ * @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/sharedenv/Green.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/Green.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/Green.java
(added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/Green.java
Tue Oct  4 21:56:55 2011
@@ -0,0 +1,78 @@
+package org.apache.openejb.arquillian.tests.sharedenv;
+
+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

Added: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/Orange.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/Orange.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/Orange.java
(added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/Orange.java
Tue Oct  4 21:56:55 2011
@@ -0,0 +1,67 @@
+package org.apache.openejb.arquillian.tests.sharedenv;
+
+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/sharedenv/PojoServletFilter.java
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/PojoServletFilter.java?rev=1178974&view=auto
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/PojoServletFilter.java
(added)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/PojoServletFilter.java
Tue Oct  4 21:56:55 2011
@@ -0,0 +1,119 @@
+package org.apache.openejb.arquillian.tests.sharedenv;
+
+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

Copied: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/SharedEnvironmentTest.java
(from r1178525, openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/SharedEnvironmentTest.java)
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/SharedEnvironmentTest.java?p2=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/SharedEnvironmentTest.java&p1=openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/SharedEnvironmentTest.java&r1=1178525&r2=1178974&rev=1178974&view=diff
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/SharedEnvironmentTest.java
(original)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/java/org/apache/openejb/arquillian/tests/sharedenv/SharedEnvironmentTest.java
Tue Oct  4 21:56:55 2011
@@ -14,30 +14,23 @@
  * 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.sharedenv;
 
+import java.io.File;
+
+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.exporter.ExplodedExporter;
 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 SharedEnvironmentTest extends TestSetup {
@@ -61,7 +54,9 @@ public class SharedEnvironmentTest exten
 
     @Deployment(testable = false)
     public static WebArchive getArchive() {
-        return new SharedEnvironmentTest().createDeployment(PojoServletFilter.class, Orange.class,
Green.class);
+        WebArchive deployment = new SharedEnvironmentTest().createDeployment(TestRun.class,
PojoServletFilter.class, Orange.class, Green.class, Environment.class);
+        deployment.as(ExplodedExporter.class).exportExploded(new File("/tmp"));
+		return deployment;
     }
 
     protected void decorateDescriptor(WebAppDescriptor descriptor) {
@@ -88,263 +83,6 @@ public class SharedEnvironmentTest exten
         ;
 
     }
-
-    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();
-    }
 }
 
 

Modified: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/resources/arquillian.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/resources/arquillian.xml?rev=1178974&r1=1178973&r2=1178974&view=diff
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/resources/arquillian.xml
(original)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/resources/arquillian.xml
Tue Oct  4 21:56:55 2011
@@ -23,8 +23,8 @@
        <container qualifier="tomee" default="true">
            <configuration>
            	   <property name="dir">/tmp/arquillian-apache-tomee</property>
-               <property name="httpPort">8080</property>
-               <property name="stopPort">8005</property>
+               <property name="httpPort">9080</property>
+               <property name="stopPort">9005</property>
                <property name="tomcatVersion"></property>
                <property name="openejbVersion">1.0.0-beta-1</property>
            </configuration>

Modified: openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/resources/persistence.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/resources/persistence.xml?rev=1178974&r1=1178973&r2=1178974&view=diff
==============================================================================
--- openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/resources/persistence.xml
(original)
+++ openejb/trunk/arquillian-tomee/arquillian-tomee-tests/src/test/resources/persistence.xml
Tue Oct  4 21:56:55 2011
@@ -3,13 +3,14 @@
              xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
              version="2.0">
     <persistence-unit name="test">
-        <class>org.apache.openejb.arquillian.ServletPersistenceInjectionTest$Address</class>
-        <class>org.apache.openejb.arquillian.ServletFilterPersistenceInjectionTest$Address</class>
+        <class>org.apache.openejb.arquillian.tests.persistence.Address</class>
+        <class>org.apache.openejb.arquillian.tests.filterpersistence.Address</class>
+        <class>org.apache.openejb.arquillian.tests.listenerpersistence.Address</class>
 <!--
         <properties>
             <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
         </properties>
 -->
-        <class>org.apache.openejb.arquillian.ServletListenerPersistenceInjectionTest$Address</class>
+        
     </persistence-unit>
 </persistence>
\ No newline at end of file



Mime
View raw message