tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r685052 - in /openejb/trunk/openejb3/container/openejb-core: ./ src/main/java/org/apache/openejb/resource/activemq/ src/test/java/org/apache/openejb/core/mdb/ src/test/resources/org/apache/openejb/core/ src/test/resources/org/apache/openejb...
Date Tue, 12 Aug 2008 06:31:15 GMT
Author: dain
Date: Mon Aug 11 23:31:13 2008
New Revision: 685052

URL: http://svn.apache.org/viewvc?rev=685052&view=rev
Log:
Fix support for external activemq.xml configuration

Added:
    openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/AmqXmlTest.java
    openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/core/
    openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/core/mdb/
    openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/core/mdb/activemq.xml
Modified:
    openejb/trunk/openejb3/container/openejb-core/pom.xml
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQResourceAdapter.java
    openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/JmsProxyTest.java

Modified: openejb/trunk/openejb3/container/openejb-core/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/pom.xml?rev=685052&r1=685051&r2=685052&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/pom.xml (original)
+++ openejb/trunk/openejb3/container/openejb-core/pom.xml Mon Aug 11 23:31:13 2008
@@ -366,6 +366,18 @@
       <artifactId>xmlunit</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring</artifactId>
+        <version>2.5.5</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.xbean</groupId>
+      <artifactId>xbean-spring</artifactId>
+        <version>3.4.3</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
   <profiles>
     <profile>

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQResourceAdapter.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQResourceAdapter.java?rev=685052&r1=685051&r2=685052&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQResourceAdapter.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQResourceAdapter.java
Mon Aug 11 23:31:13 2008
@@ -115,7 +115,7 @@
 
         // prefix server uri with openejb: so our broker factory is used
         String brokerXmlConfig = getBrokerXmlConfig();
-        if (brokerXmlConfig != null) {
+        if (brokerXmlConfig != null && brokerXmlConfig.startsWith("broker:")) {
             try {
                 URISupport.CompositeData compositeData = URISupport.parseComposite(new URI(brokerXmlConfig));
                 compositeData.getParameters().put("persistent", "false");

Added: openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/AmqXmlTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/AmqXmlTest.java?rev=685052&view=auto
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/AmqXmlTest.java
(added)
+++ openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/AmqXmlTest.java
Mon Aug 11 23:31:13 2008
@@ -0,0 +1,25 @@
+/**
+ *
+ * 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.
+ */
+package org.apache.openejb.core.mdb;
+
+public class AmqXmlTest extends JmsProxyTest {
+    protected String getBrokerXmlConfig() {
+        // note activemq uses classpath xml loader
+        return "xbean:org/apache/openejb/core/mdb/activemq.xml";
+    }
+}

Modified: openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/JmsProxyTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/JmsProxyTest.java?rev=685052&r1=685051&r2=685052&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/JmsProxyTest.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/JmsProxyTest.java
Mon Aug 11 23:31:13 2008
@@ -52,7 +52,7 @@
 
         // initialize properties
         ra.setServerUrl("tcp://localhost:61616");
-        ra.setBrokerXmlConfig("broker:(tcp://localhost:61616)?useJmx=false");
+        ra.setBrokerXmlConfig(getBrokerXmlConfig());
 
         // create a thead pool for ActiveMQ
         Executor threadPool = Executors.newFixedThreadPool(30);
@@ -73,6 +73,10 @@
         connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
     }
 
+    protected String getBrokerXmlConfig() {
+        return "broker:(tcp://localhost:61616)?useJmx=false";
+    }
+
     protected void tearDown() throws Exception {
         connectionFactory = null;
         if (ra != null) {

Added: openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/core/mdb/activemq.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/core/mdb/activemq.xml?rev=685052&view=auto
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/core/mdb/activemq.xml
(added)
+++ openejb/trunk/openejb3/container/openejb-core/src/test/resources/org/apache/openejb/core/mdb/activemq.xml
Mon Aug 11 23:31:13 2008
@@ -0,0 +1,16 @@
+<beans
+  xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+    <bean name="broker" class="org.apache.activemq.xbean.XBeanBrokerService">
+        <property name="persistent" value="false"/>
+        <property name="brokerName" value="localhost"/>
+        <property name="transportConnectors">
+            <list>
+                <bean name="openwire" class="org.apache.activemq.broker.TransportConnector">
+                    <property name="uri" value="tcp://localhost:61616"/>
+                </bean>
+            </list>
+        </property>
+    </bean>
+</beans>
\ No newline at end of file



Mime
View raw message