Use vm transport for broker to avoid port conflict issues

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

Branch: refs/heads/3.0.x-fixes
Commit: 3b734a58ec9eb45c38fb4481e5638fdc2896b0c5
Parents: dc1a1c0
Author: Daniel Kulp <[email protected]>
Authored: Thu Nov 6 11:42:10 2014 -0500
Committer: Daniel Kulp <[email protected]>
Committed: Fri Nov 7 13:52:16 2014 -0500

----------------------------------------------------------------------
 osgi/itests/pom.xml                                         | 2 +-
 .../org/apache/cxf/osgi/itests/soap/JmsServiceTest.java     | 9 +++++----
 .../org/apache/cxf/osgi/itests/soap/JmsTestActivator.java   | 7 +++++--
 3 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/3b734a58/osgi/itests/pom.xml
----------------------------------------------------------------------
diff --git a/osgi/itests/pom.xml b/osgi/itests/pom.xml
index 6f48eab..92f2ecf 100644
--- a/osgi/itests/pom.xml
+++ b/osgi/itests/pom.xml
@@ -65,8 +65,8 @@
         <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-karaf</artifactId>
-               <version>5.9.1</version>
                <type>xml</type>
+                <version>${cxf.activemq.version}</version>
                <classifier>features</classifier>
         </dependency>
         

http://git-wip-us.apache.org/repos/asf/cxf/blob/3b734a58/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/JmsServiceTest.java
----------------------------------------------------------------------
diff --git 
a/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/JmsServiceTest.java 
b/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/JmsServiceTest.java
index 797f89e..0916b1c 100644
--- 
a/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/JmsServiceTest.java
+++ 
b/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/JmsServiceTest.java
@@ -23,7 +23,7 @@ import java.util.Collections;
 
 import javax.jms.ConnectionFactory;
 
-import org.apache.activemq.spring.ActiveMQConnectionFactory;
+import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
 import org.apache.cxf.osgi.itests.CXFOSGiTestSupport;
 import org.apache.cxf.transport.jms.ConnectionFactoryFeature;
@@ -65,7 +65,8 @@ public class JmsServiceTest extends CXFOSGiTestSupport {
     }
 
     private ActiveMQConnectionFactory createConnectionFactory() {
-        ActiveMQConnectionFactory connectionFactory = new 
ActiveMQConnectionFactory();
+        ActiveMQConnectionFactory connectionFactory 
+            = new ActiveMQConnectionFactory("vm://JmsServiceTest");
         connectionFactory.setUserName("karaf");
         connectionFactory.setPassword("karaf");
         return connectionFactory;
@@ -76,8 +77,8 @@ public class JmsServiceTest extends CXFOSGiTestSupport {
         MavenUrlReference activeMQFeature = 
maven().groupId("org.apache.activemq")
             
.artifactId("activemq-karaf").type("xml").classifier("features").versionAsInProject();
         return new Option[] {
-            cxfBaseConfig(),
-            logLevel(LogLevel.INFO),
+            cxfBaseConfigWithTestUtils(),
+            logLevel(LogLevel.WARN),
             features(activeMQFeature, "activemq-broker-noweb"),
             features(cxfUrl, "cxf-transports-jms"),
             provision(serviceBundle())

http://git-wip-us.apache.org/repos/asf/cxf/blob/3b734a58/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/JmsTestActivator.java
----------------------------------------------------------------------
diff --git 
a/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/JmsTestActivator.java
 
b/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/JmsTestActivator.java
index f1d3f4c..213b623 100644
--- 
a/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/JmsTestActivator.java
+++ 
b/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/JmsTestActivator.java
@@ -22,14 +22,16 @@ import java.util.Collections;
 
 import javax.jms.ConnectionFactory;
 
-import org.apache.activemq.spring.ActiveMQConnectionFactory;
+import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.testutil.common.TestUtil;
 import org.apache.cxf.transport.jms.ConnectionFactoryFeature;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 
 public class JmsTestActivator implements BundleActivator {
+    public static final String PORT = 
TestUtil.getPortNumber(JmsTestActivator.class);
     private Server server;
 
     @Override
@@ -48,7 +50,8 @@ public class JmsTestActivator implements BundleActivator {
     }
 
     private ActiveMQConnectionFactory createConnectionFactory() {
-        ActiveMQConnectionFactory connectionFactory = new 
ActiveMQConnectionFactory();
+        ActiveMQConnectionFactory connectionFactory 
+            = new ActiveMQConnectionFactory("vm://JmsServiceTest");
         connectionFactory.setUserName("karaf");
         connectionFactory.setPassword("karaf");
         return connectionFactory;

Reply via email to