Fixes the tests in Mdb

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

Branch: refs/heads/tomee-1.7.x
Commit: 87fdee71425a2abf406fcdb5b228df7caddd9364
Parents: 8fc0f11
Author: Otavio Santana <[email protected]>
Authored: Thu Jul 6 11:18:00 2017 -0300
Committer: Otavio Santana <[email protected]>
Committed: Thu Jul 6 11:18:00 2017 -0300

----------------------------------------------------------------------
 .../openejb/core/mdb/MdbContainerFailTest.java  |  1 +
 .../openejb/core/mdb/MdbContainerTest.java      | 25 +-----
 .../service-jar.xml                             | 82 ++++++++++++++++++++
 .../service-jar.xml                             | 82 ++++++++++++++++++++
 .../META-INF/org.apache.openejb/service-jar.xml | 53 -------------
 5 files changed, 166 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/87fdee71/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MdbContainerFailTest.java
----------------------------------------------------------------------
diff --git 
a/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MdbContainerFailTest.java
 
b/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MdbContainerFailTest.java
index fa570b0..e2b6013 100644
--- 
a/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MdbContainerFailTest.java
+++ 
b/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MdbContainerFailTest.java
@@ -74,6 +74,7 @@ public class MdbContainerFailTest {
                 .p("xaCf.BrokerURL", "vm://localhost")
                 .p("mdb.activation.ignore", "testString")
                 .p("mdb.activation.ignore2", "testString")
+                .p("openejb.provider.default", 
"org.apache.openejb.actproptrue") // service-jar.xml with 
FailOnUnknowActivationSpec = true
                 .build();
     }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/87fdee71/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MdbContainerTest.java
----------------------------------------------------------------------
diff --git 
a/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MdbContainerTest.java
 
b/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MdbContainerTest.java
index 1a24549..06bd609 100644
--- 
a/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MdbContainerTest.java
+++ 
b/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MdbContainerTest.java
@@ -23,10 +23,7 @@ import org.apache.openejb.junit.ApplicationComposer;
 import org.apache.openejb.testing.Configuration;
 import org.apache.openejb.testing.Module;
 import org.apache.openejb.testng.PropertiesBuilder;
-import org.apache.openjpa.lib.util.Files;
-import org.junit.AfterClass;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -43,11 +40,6 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.XAConnectionFactory;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URISyntaxException;
-import java.net.URL;
 import java.util.Properties;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
@@ -61,22 +53,6 @@ public class MdbContainerTest {
 
     private static final String TEXT = "foo";
 
-    @BeforeClass
-    public static void beforeClass() throws URISyntaxException, IOException {
-        URL url = 
MdbContainerTest.class.getResource("/META-INF/org.apache.openejb/service-jar.txt");
-        File txtFile = new File(url.toURI());
-        File xmlFile = new File(txtFile.getParentFile(), "service-jar.xml");
-        xmlFile.createNewFile();
-        Files.copy(txtFile, xmlFile);
-
-    }
-
-    @AfterClass
-    public static void afterClass() throws URISyntaxException {
-        URL stream = 
MdbContainerTest.class.getResource("/META-INF/org.apache.openejb/service-jar.xml");
-        File file = new File(stream.toURI());
-        file.delete();
-    }
 
     @Configuration
     public Properties config() {
@@ -98,6 +74,7 @@ public class MdbContainerTest {
                 .p("xaCf.BrokerURL", "vm://localhost")
                 .p("mdb.activation.ignore", "testString")
                 .p("mdb.activation.ignore2", "testString")
+                .p("openejb.provider.default", 
"org.apache.openejb.actpropfalse") // service-jar.xml with 
FailOnUnknowActivationSpec = false
                 .build();
     }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/87fdee71/container/openejb-core/src/test/resources/META-INF/org.apache.openejb.actpropfalse/service-jar.xml
----------------------------------------------------------------------
diff --git 
a/container/openejb-core/src/test/resources/META-INF/org.apache.openejb.actpropfalse/service-jar.xml
 
b/container/openejb-core/src/test/resources/META-INF/org.apache.openejb.actpropfalse/service-jar.xml
new file mode 100644
index 0000000..030deeb
--- /dev/null
+++ 
b/container/openejb-core/src/test/resources/META-INF/org.apache.openejb.actpropfalse/service-jar.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<ServiceJar>
+
+    <ServiceProvider id="Default CMP Container" 
parent="org.apache.openejb:Default CMP Container"/>
+    <ServiceProvider id="Default BMP Container" 
parent="org.apache.openejb:Default BMP Container"/>
+    <ServiceProvider id="Default Stateless Container" 
parent="org.apache.openejb:Default Stateless Container"/>
+    <ServiceProvider id="Default Singleton Container" 
parent="org.apache.openejb:Default Singleton Container"/>
+    <ServiceProvider id="Default Stateful Container" 
parent="org.apache.openejb:Default Stateful Container"/>
+    <ServiceProvider id="Default Managed Container" 
parent="org.apache.openejb:Default Managed Container"/>
+    <ServiceProvider id="Default JDK 1.3 ProxyFactory" 
parent="org.apache.openejb:Default JDK 1.3 ProxyFactory"/>
+    <ServiceProvider id="Default Security Service" 
parent="org.apache.openejb:Default Security Service"/>
+    <ServiceProvider id="PseudoSecurityService" 
parent="org.apache.openejb:PseudoSecurityService"/>
+    <ServiceProvider id="Default Transaction Manager" 
parent="org.apache.openejb:Default Transaction Manager"/>
+    <ServiceProvider id="Default JDBC Database" 
parent="org.apache.openejb:Default JDBC Database"/>
+    <ServiceProvider id="Default Unmanaged JDBC Database" 
parent="org.apache.openejb:Default Unmanaged JDBC Database"/>
+    <ServiceProvider id="Default JMS Resource Adapter" 
parent="org.apache.openejb:Default JMS Resource Adapter">
+        BrokerXmlConfig=broker:()/localhost?persistent=false
+        DataSource
+    </ServiceProvider>
+    <ServiceProvider id="Default JMS Connection Factory" 
parent="org.apache.openejb:Default JMS Connection Factory"/>
+    <ServiceProvider id="Default Queue" parent="org.apache.openejb:Default 
Queue"/>
+    <ServiceProvider id="Default Topic" parent="org.apache.openejb:Default 
Topic"/>
+    <ServiceProvider id="Default ORB" parent="org.apache.openejb:Default ORB"/>
+    <ServiceProvider id="Default Mail Session" 
parent="org.apache.openejb:Default Mail Session"/>
+    <ServiceProvider id="Default Remote Jndi Provider" 
parent="org.apache.openejb:Default Remote Jndi Provider"/>
+    <ServiceProvider id="RoutedDataSource" 
parent="org.apache.openejb:RoutedDataSource"/>
+    <ServiceProvider id="Default Executor Service" 
parent="org.apache.openejb:Default Executor Service"/>
+    <ServiceProvider id="Default Scheduled Executor Service"
+                     parent="org.apache.openejb:Default Scheduled Executor 
Service"/>
+    <ServiceProvider id="Default Managed Thread Factory" 
parent="org.apache.openejb:Default Managed Thread Factory"/>
+    <ServiceProvider id="Default Context Service" 
parent="org.apache.openejb:Default Context Service"/>
+
+
+    <ServiceProvider
+            id="Default MDB Container"
+            service="Container"
+            types="MESSAGE"
+            constructor="id, securityService, ResourceAdapter, 
MessageListenerInterface, ActivationSpecClass, InstanceLimit, 
FailOnUnknowActivationSpec"
+            class-name="org.apache.openejb.core.mdb.MdbContainer">
+
+        # The resource adapter delivers messages to the container
+
+        ResourceAdapter Default JMS Resource Adapter
+
+        # Specifies the message listener interface handled by this container
+
+        MessageListenerInterface javax.jms.MessageListener
+
+        # Specifies the activation spec class
+
+        ActivationSpecClass org.apache.activemq.ra.ActiveMQActivationSpec
+
+        # Specifies the maximum number of bean instances that are
+        # allowed to exist for each MDB deployment.
+
+        InstanceLimit 10
+
+        # log a warning if true or throw an exception if false is an 
activation spec can't be respected
+
+        FailOnUnknowActivationSpec = false
+
+    </ServiceProvider>
+</ServiceJar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/87fdee71/container/openejb-core/src/test/resources/META-INF/org.apache.openejb.actproptrue/service-jar.xml
----------------------------------------------------------------------
diff --git 
a/container/openejb-core/src/test/resources/META-INF/org.apache.openejb.actproptrue/service-jar.xml
 
b/container/openejb-core/src/test/resources/META-INF/org.apache.openejb.actproptrue/service-jar.xml
new file mode 100644
index 0000000..ab1dceb
--- /dev/null
+++ 
b/container/openejb-core/src/test/resources/META-INF/org.apache.openejb.actproptrue/service-jar.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<ServiceJar>
+
+    <ServiceProvider id="Default CMP Container" 
parent="org.apache.openejb:Default CMP Container"/>
+    <ServiceProvider id="Default BMP Container" 
parent="org.apache.openejb:Default BMP Container"/>
+    <ServiceProvider id="Default Stateless Container" 
parent="org.apache.openejb:Default Stateless Container"/>
+    <ServiceProvider id="Default Singleton Container" 
parent="org.apache.openejb:Default Singleton Container"/>
+    <ServiceProvider id="Default Stateful Container" 
parent="org.apache.openejb:Default Stateful Container"/>
+    <ServiceProvider id="Default Managed Container" 
parent="org.apache.openejb:Default Managed Container"/>
+    <ServiceProvider id="Default JDK 1.3 ProxyFactory" 
parent="org.apache.openejb:Default JDK 1.3 ProxyFactory"/>
+    <ServiceProvider id="Default Security Service" 
parent="org.apache.openejb:Default Security Service"/>
+    <ServiceProvider id="PseudoSecurityService" 
parent="org.apache.openejb:PseudoSecurityService"/>
+    <ServiceProvider id="Default Transaction Manager" 
parent="org.apache.openejb:Default Transaction Manager"/>
+    <ServiceProvider id="Default JDBC Database" 
parent="org.apache.openejb:Default JDBC Database"/>
+    <ServiceProvider id="Default Unmanaged JDBC Database" 
parent="org.apache.openejb:Default Unmanaged JDBC Database"/>
+    <ServiceProvider id="Default JMS Resource Adapter" 
parent="org.apache.openejb:Default JMS Resource Adapter">
+        BrokerXmlConfig=broker:()/localhost?persistent=false
+        DataSource
+    </ServiceProvider>
+    <ServiceProvider id="Default JMS Connection Factory" 
parent="org.apache.openejb:Default JMS Connection Factory"/>
+    <ServiceProvider id="Default Queue" parent="org.apache.openejb:Default 
Queue"/>
+    <ServiceProvider id="Default Topic" parent="org.apache.openejb:Default 
Topic"/>
+    <ServiceProvider id="Default ORB" parent="org.apache.openejb:Default ORB"/>
+    <ServiceProvider id="Default Mail Session" 
parent="org.apache.openejb:Default Mail Session"/>
+    <ServiceProvider id="Default Remote Jndi Provider" 
parent="org.apache.openejb:Default Remote Jndi Provider"/>
+    <ServiceProvider id="RoutedDataSource" 
parent="org.apache.openejb:RoutedDataSource"/>
+    <ServiceProvider id="Default Executor Service" 
parent="org.apache.openejb:Default Executor Service"/>
+    <ServiceProvider id="Default Scheduled Executor Service"
+                     parent="org.apache.openejb:Default Scheduled Executor 
Service"/>
+    <ServiceProvider id="Default Managed Thread Factory" 
parent="org.apache.openejb:Default Managed Thread Factory"/>
+    <ServiceProvider id="Default Context Service" 
parent="org.apache.openejb:Default Context Service"/>
+
+
+    <ServiceProvider
+            id="Default MDB Container"
+            service="Container"
+            types="MESSAGE"
+            constructor="id, securityService, ResourceAdapter, 
MessageListenerInterface, ActivationSpecClass, InstanceLimit, 
FailOnUnknowActivationSpec"
+            class-name="org.apache.openejb.core.mdb.MdbContainer">
+
+        # The resource adapter delivers messages to the container
+
+        ResourceAdapter Default JMS Resource Adapter
+
+        # Specifies the message listener interface handled by this container
+
+        MessageListenerInterface javax.jms.MessageListener
+
+        # Specifies the activation spec class
+
+        ActivationSpecClass org.apache.activemq.ra.ActiveMQActivationSpec
+
+        # Specifies the maximum number of bean instances that are
+        # allowed to exist for each MDB deployment.
+
+        InstanceLimit 10
+
+        # log a warning if true or throw an exception if false is an 
activation spec can't be respected
+
+        FailOnUnknowActivationSpec = true
+
+    </ServiceProvider>
+</ServiceJar>

http://git-wip-us.apache.org/repos/asf/tomee/blob/87fdee71/container/openejb-core/src/test/resources/META-INF/org.apache.openejb/service-jar.xml
----------------------------------------------------------------------
diff --git 
a/container/openejb-core/src/test/resources/META-INF/org.apache.openejb/service-jar.xml
 
b/container/openejb-core/src/test/resources/META-INF/org.apache.openejb/service-jar.xml
deleted file mode 100644
index 7fdcea6..0000000
--- 
a/container/openejb-core/src/test/resources/META-INF/org.apache.openejb/service-jar.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-
-<!-- $Rev$ $Date$ -->
-
-<ServiceJar>
-
-
-  <ServiceProvider
-      id="Default MDB Container"
-      service="Container"
-      types="MESSAGE"
-      constructor="id, securityService, ResourceAdapter, 
MessageListenerInterface, ActivationSpecClass, InstanceLimit, 
FailOnUnknowActivationSpec"
-      class-name="org.apache.openejb.core.mdb.MdbContainer">
-
-    # The resource adapter delivers messages to the container
-
-    ResourceAdapter Default JMS Resource Adapter
-
-    # Specifies the message listener interface handled by this container
-
-    MessageListenerInterface javax.jms.MessageListener
-
-    # Specifies the activation spec class
-
-    ActivationSpecClass org.apache.activemq.ra.ActiveMQActivationSpec
-
-    # Specifies the maximum number of bean instances that are
-    # allowed to exist for each MDB deployment.
-
-    InstanceLimit 10
-
-    # log a warning if false or throw an exception if true is an activation 
spec can't be respected
-
-    FailOnUnknowActivationSpec = false
-
-  </ServiceProvider>
-</ServiceJar>

Reply via email to