tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgallim...@apache.org
Subject [4/4] tomee git commit: TOMEE-2151 add unit test for appinfobuilder
Date Mon, 04 Dec 2017 14:47:30 GMT
TOMEE-2151 add unit test for appinfobuilder


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/f3dd42b0
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/f3dd42b0
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/f3dd42b0

Branch: refs/heads/tomee-1.7.x
Commit: f3dd42b0872fdea3235bb284fbf4059cc741972c
Parents: 6cd6465
Author: Jonathan Gallimore <jon@jrg.me.uk>
Authored: Mon Dec 4 14:38:06 2017 +0000
Committer: Jonathan Gallimore <jon@jrg.me.uk>
Committed: Mon Dec 4 14:38:06 2017 +0000

----------------------------------------------------------------------
 .../openejb/config/AppInfoBuilderTest.java      | 29 ++++++++++++++++++++
 1 file changed, 29 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/f3dd42b0/container/openejb-core/src/test/java/org/apache/openejb/config/AppInfoBuilderTest.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/AppInfoBuilderTest.java
b/container/openejb-core/src/test/java/org/apache/openejb/config/AppInfoBuilderTest.java
index 616c47f..a58fd07 100644
--- a/container/openejb-core/src/test/java/org/apache/openejb/config/AppInfoBuilderTest.java
+++ b/container/openejb-core/src/test/java/org/apache/openejb/config/AppInfoBuilderTest.java
@@ -17,8 +17,13 @@
 package org.apache.openejb.config;
 
 import junit.framework.TestCase;
+import org.apache.activemq.ra.ActiveMQActivationSpec;
+import org.apache.openejb.assembler.classic.AppInfo;
+import org.apache.openejb.assembler.classic.ContainerInfo;
 import org.apache.openejb.assembler.classic.EjbJarInfo;
 import org.apache.openejb.assembler.classic.PortInfo;
+import org.apache.openejb.config.sys.Container;
+import org.apache.openejb.core.mdb.MdbContainer;
 import org.apache.openejb.jee.EjbJar;
 import org.apache.openejb.jee.SessionBean;
 import org.apache.openejb.jee.oejb2.AuthMethodType;
@@ -26,6 +31,7 @@ import org.apache.openejb.jee.oejb2.TransportGuaranteeType;
 import org.apache.openejb.jee.oejb3.EjbDeployment;
 import org.apache.openejb.jee.oejb3.OpenejbJar;
 
+import javax.jms.MessageListener;
 import java.util.List;
 import java.util.Properties;
 
@@ -145,4 +151,27 @@ public class AppInfoBuilderTest extends TestCase {
         assertEquals("Timestamp", portInfo.properties.getProperty("wss4j.in.action"));
         assertEquals("Timestamp", portInfo.properties.getProperty("wss4j.out.action"));
     }
+
+    public void testShouldCreateContainer() throws Exception {
+        final EjbJar ejbJar = new EjbJar();
+        final OpenejbJar openejbJar = new OpenejbJar();
+
+        final EjbModule ejbModule = new EjbModule(ejbJar, openejbJar);
+
+        final AppModule appModule = new AppModule(ejbModule);
+        appModule.getContainers().add(new Container("my-container", "MESSAGE", null));
+
+        final AppInfo appInfo = new AppInfoBuilder(new ConfigurationFactory()).build(appModule);
+        assertEquals(1, appInfo.containers.size());
+        final ContainerInfo containerInfo = appInfo.containers.get(0);
+        assertEquals(appInfo.appId + "/my-container", containerInfo.id);
+        assertEquals(1, containerInfo.types.size());
+        assertEquals("MESSAGE", containerInfo.types.get(0));
+        assertEquals(MdbContainer.class.getName(), containerInfo.className);
+        assertEquals("Default JMS Resource Adapter", containerInfo.properties.get("ResourceAdapter"));
+        assertEquals(MessageListener.class.getName(), containerInfo.properties.get("MessageListenerInterface"));
+        assertEquals(ActiveMQActivationSpec.class.getName(), containerInfo.properties.get("ActivationSpecClass"));
+        assertEquals("10", containerInfo.properties.get("InstanceLimit"));
+        assertEquals("true", containerInfo.properties.get("FailOnUnknownActivationSpec"));
+    }
 }


Mime
View raw message