You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ta...@apache.org on 2015/01/07 17:24:12 UTC

qpid-jms git commit: Detect an available port for the test to avoid future issue with fixed ports on different platforms and inside build automation etc.

Repository: qpid-jms
Updated Branches:
  refs/heads/master 290312885 -> a587e3fd2


Detect an available port for the test to avoid future issue with fixed
ports on different platforms and inside build automation etc.

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

Branch: refs/heads/master
Commit: a587e3fd2b856acbeb1255aa4b79bad506c300bd
Parents: 2903128
Author: Timothy Bish <ta...@gmail.com>
Authored: Wed Jan 7 11:23:50 2015 -0500
Committer: Timothy Bish <ta...@gmail.com>
Committed: Wed Jan 7 11:23:50 2015 -0500

----------------------------------------------------------------------
 .../BytesMessageIntegrationTest.java            |  8 ++--
 .../integration/ConnectionIntegrationTest.java  |  8 ++--
 .../jms/integration/IntegrationTestFixture.java | 30 ++++++++++++-
 .../integration/MapMessageIntegrationTest.java  |  4 +-
 .../jms/integration/MessageIntegrationTest.java | 46 ++++++++++----------
 .../ObjectMessageIntegrationTest.java           | 10 ++---
 .../jms/integration/SenderIntegrationTest.java  | 24 +++++-----
 .../jms/integration/SessionIntegrationTest.java | 38 ++++++++--------
 .../StreamMessageIntegrationTest.java           |  4 +-
 .../integration/TextMessageIntegrationTest.java |  8 ++--
 10 files changed, 103 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/a587e3fd/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/BytesMessageIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/BytesMessageIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/BytesMessageIntegrationTest.java
index 06264d5..241b00a 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/BytesMessageIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/BytesMessageIntegrationTest.java
@@ -57,7 +57,7 @@ public class BytesMessageIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testSendBasicBytesMessageWithContent() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -90,7 +90,7 @@ public class BytesMessageIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testReceiveBasicBytesMessageWithContentUsingDataSection() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -136,7 +136,7 @@ public class BytesMessageIntegrationTest extends QpidJmsTestCase {
      */
     @Test(timeout = 5000)
     public void testReceiveBytesMessageAndResendAfterResetAndPartialRead() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -244,7 +244,7 @@ public class BytesMessageIntegrationTest extends QpidJmsTestCase {
      */
     @Test(timeout = 5000)
     public void testReceiveBytesMessageWithAmqpValueAndResendResultsInData() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/a587e3fd/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionIntegrationTest.java
index 7fe6b3f..5b25e1c 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionIntegrationTest.java
@@ -40,7 +40,7 @@ public class ConnectionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout=10000)
     public void testCreateAndCloseConnection() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectClose();
             connection.close();
@@ -49,7 +49,7 @@ public class ConnectionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout=10000)
     public void testCreateAutoAckSession() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
@@ -59,7 +59,7 @@ public class ConnectionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout=5000)
     public void testCreateTransactedSession() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
 
             testPeer.expectBegin(true);
@@ -76,7 +76,7 @@ public class ConnectionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout=5000)
     public void testConnectionMetaDataVersion() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
 
             ConnectionMetaData meta = connection.getMetaData();

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/a587e3fd/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/IntegrationTestFixture.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/IntegrationTestFixture.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/IntegrationTestFixture.java
index 7688da5..a5a9e4b 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/IntegrationTestFixture.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/IntegrationTestFixture.java
@@ -20,18 +20,24 @@ package org.apache.qpid.jms.integration;
 
 import static org.junit.Assert.assertNull;
 
+import java.io.IOException;
+import java.net.ServerSocket;
 import java.util.Map;
 
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.JMSException;
+import javax.net.ServerSocketFactory;
 
 import org.apache.qpid.jms.JmsConnectionFactory;
 import org.apache.qpid.jms.test.testpeer.TestAmqpPeer;
 import org.apache.qpid.proton.amqp.Symbol;
 
 public class IntegrationTestFixture {
-    static final int PORT = 25672;
+
+    private static final int PORT = 25672;
+
+    protected int availablePort = 0;
 
     Connection establishConnecton(TestAmqpPeer testPeer) throws JMSException {
         return establishConnecton(testPeer, null, null, null);
@@ -55,7 +61,7 @@ public class IntegrationTestFixture {
         // Each connection creates a session for managing temporary destinations etc
         testPeer.expectBegin(true);
 
-        final String baseURI = "amqp://localhost:" + PORT;
+        final String baseURI = "amqp://localhost:" + getAvailablePort();
         String brokerURI = baseURI;
         if (optionsString != null) {
             brokerURI = baseURI + optionsString;
@@ -70,4 +76,24 @@ public class IntegrationTestFixture {
         assertNull(testPeer.getThrowable());
         return connection;
     }
+
+    protected int getAvailablePort() {
+        if (availablePort == 0) {
+            ServerSocket ss = null;
+            try {
+                ss = ServerSocketFactory.getDefault().createServerSocket(0);
+                availablePort = ss.getLocalPort();
+            } catch (IOException e) { // revert back to default
+                availablePort = PORT;
+            } finally {
+                try {
+                    if (ss != null ) {
+                        ss.close();
+                    }
+                } catch (IOException e) { // ignore
+                }
+            }
+        }
+        return availablePort;
+    }
 }

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/a587e3fd/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MapMessageIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MapMessageIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MapMessageIntegrationTest.java
index 55b1106..fe3c573 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MapMessageIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MapMessageIntegrationTest.java
@@ -60,7 +60,7 @@ public class MapMessageIntegrationTest extends QpidJmsTestCase {
      */
     @Test(timeout = 5000)
     public void testReceiveBasicMapMessage() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -149,7 +149,7 @@ public class MapMessageIntegrationTest extends QpidJmsTestCase {
      */
     @Test(timeout = 5000)
     public void testSendBasicMapMessage() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/a587e3fd/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
index 9f70eb2..193bf4c 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
@@ -22,10 +22,10 @@ import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.notNullValue;
 import static org.hamcrest.Matchers.nullValue;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.fail;
 
 import java.util.Date;
@@ -100,7 +100,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
 
     @Test(timeout = 2000)
     public void testSendMessageWithApplicationProperties() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -155,7 +155,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
 
     @Test(timeout = 2000)
     public void testReceiveMessageWithApplicationProperties() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -236,7 +236,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
     }
 
     public void receivedMessageFromQueueWithoutToResultsInUseOfConsumerDestinationImpl(boolean useQueue) throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -287,7 +287,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
      */
     @Test(timeout = 2000)
     public void testReceivedMessageFromQueueWithNoReplyToReturnsNull() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -460,7 +460,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
                                                                  Object annotationValue,
                                                                  String replyAnnotationName,
                                                                  Object replyAnnotationValue) throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = null;
             if (destType == Topic.class) {
                 connection = testFixture.establishConnecton(testPeer, "?jms.topicPrefix=" + destPrefix);
@@ -620,7 +620,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
                                                              String destName,
                                                              String destAddress,
                                                              Byte destTypeAnnotationValue) throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = null;
             if (destType == Topic.class) {
                 connection = testFixture.establishConnecton(testPeer, "?jms.topicPrefix=" + destPrefix);
@@ -745,7 +745,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
                                                                                   Object annotationValue,
                                                                                   String replyAnnotationName,
                                                                                   Object replyAnnotationValue) throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             // Have the test peer provide the destination prefixes as connection properties
             Map<Symbol, Object> properties = new HashMap<Symbol, Object>();
             properties.put(AmqpConnectionProperties.QUEUE_PREFIX, destPrefix);
@@ -855,7 +855,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
                                                              String destName,
                                                              String destAddress,
                                                              Byte destTypeAnnotationValue) throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             // Have the test peer provide the destination prefixes as connection properties
             Map<Symbol, Object> properties = new HashMap<Symbol, Object>();
             properties.put(AmqpConnectionProperties.QUEUE_PREFIX, destPrefix);
@@ -923,7 +923,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
      */
     @Test(timeout = 2000)
     public void testReceivedMessageFromTopicWithReplyToWithoutTypeAnnotationResultsInUseOfConsumerDestinationType() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -964,7 +964,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
      */
     @Test(timeout = 5000)
     public void testSentMessageContainsToTypeAnnotationByte() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -1001,7 +1001,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
      */
     @Test(timeout = 5000)
     public void testSentMessageContainsReplyToTypeAnnotationByte() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
 
             testPeer.expectBegin(true);
@@ -1046,7 +1046,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
      */
     @Test(timeout = 2000)
     public void testReceivedMessageFromQueueWithToLegacyTypeAnnotationForTopic() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -1088,7 +1088,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
      */
     @Test(timeout = 2000)
     public void testReceivedMessageFromQueueWithLegacyReplyToTypeAnnotationForTopic() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -1131,7 +1131,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
      */
     @Test(timeout = 2000)
     public void testReceivedMessageFromQueueWithNoAbsoluteExpiryOrTtlReturnsJMSExpirationZero() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -1164,7 +1164,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
      */
     @Test(timeout = 2000)
     public void testReceivedMessageFromQueueWithAbsoluteExpiryReturnsJMSExpirationNonZero() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -1199,7 +1199,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
 
     @Test(timeout = 2000)
     public void testReceiveMessageWithoutMessageId() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -1259,7 +1259,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
     }
 
     private void receivedMessageWithMessageIdTestImpl(Object underlyingAmqpMessageId) throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -1326,7 +1326,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
     }
 
     private void receivedMessageWithCorrelationIdTestImpl(Object correlationIdForAmqpMessageClass, boolean appSpecific) throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -1430,7 +1430,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
     }
 
     private void sentMessageWithCorrelationIdTestImpl(String stringCorrelationId, Object correlationIdForAmqpMessageClass, boolean appSpecific) throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -1513,7 +1513,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
     }
 
     private void recieveMessageIdSendCorrelationIdTestImpl(Object idForAmqpMessageClass) throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -1580,7 +1580,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
      */
     @Test(timeout = 2000)
     public void testReceivedMessageWithGroupRelatedPropertiesSet() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -1655,7 +1655,7 @@ public class MessageIntegrationTest extends QpidJmsTestCase
      */
     @Test(timeout = 2000)
     public void testSendMessageWithGroupRelatedPropertiesSet() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/a587e3fd/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ObjectMessageIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ObjectMessageIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ObjectMessageIntegrationTest.java
index 65552fe..7753738 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ObjectMessageIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ObjectMessageIntegrationTest.java
@@ -62,7 +62,7 @@ public class ObjectMessageIntegrationTest extends QpidJmsTestCase
 
     @Test(timeout = 5000)
     public void testSendBasicObjectMessageWithSerializedContent() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -104,7 +104,7 @@ public class ObjectMessageIntegrationTest extends QpidJmsTestCase
 
     @Test(timeout = 5000)
     public void testReceiveBasicObjectMessageWithSerializedContent() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -150,7 +150,7 @@ public class ObjectMessageIntegrationTest extends QpidJmsTestCase
 
     @Test(timeout = 5000)
     public void testReceiveAndThenResendBasicObjectMessageWithSerializedContent() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -212,7 +212,7 @@ public class ObjectMessageIntegrationTest extends QpidJmsTestCase
 
     @Test(timeout = 5000)
     public void testSendBasicObjectMessageWithAmqpTypedContent() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -249,7 +249,7 @@ public class ObjectMessageIntegrationTest extends QpidJmsTestCase
 
     @Test(timeout = 5000)
     public void testRecieveBasicObjectMessageWithAmqpTypedContentAndJMSMessageTypeAnnotation() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/a587e3fd/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SenderIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SenderIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SenderIntegrationTest.java
index 4ee1283..35b6759 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SenderIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SenderIntegrationTest.java
@@ -56,7 +56,7 @@ public class SenderIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 10000)
     public void testCloseSender() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -74,7 +74,7 @@ public class SenderIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 10000)
     public void testDefaultDeliveryModeProducesDurableMessages() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -103,7 +103,7 @@ public class SenderIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 10000)
     public void testProducerOverridesMessageDeliveryMode() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -141,7 +141,7 @@ public class SenderIntegrationTest extends QpidJmsTestCase {
      */
     @Test(timeout = 5000)
     public void testSendingMessageSetsJMSDestination() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -176,7 +176,7 @@ public class SenderIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 10000)
     public void testSendingMessageSetsJMSTimestamp() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -220,7 +220,7 @@ public class SenderIntegrationTest extends QpidJmsTestCase {
      */
     @Test(timeout = 5000)
     public void testSendingMessageWithDisableMessageTimestampHint() throws Exception {
-        try(TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try(TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -257,7 +257,7 @@ public class SenderIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 10000)
     public void testSendingMessageSetsJMSExpirationRelatedAbsoluteExpiryAndTtlFields() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -310,7 +310,7 @@ public class SenderIntegrationTest extends QpidJmsTestCase {
     }
 
     public void sendingMessageWithJMS_AMQP_TTLSetTestImpl(long jmsTtl, long amqpTtl) throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -362,7 +362,7 @@ public class SenderIntegrationTest extends QpidJmsTestCase {
      */
     @Test(timeout = 10000)
     public void testDefaultPriorityProducesMessagesWithoutPriorityField() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -398,7 +398,7 @@ public class SenderIntegrationTest extends QpidJmsTestCase {
      */
     @Test(timeout = 10000)
     public void testNonDefaultPriorityProducesMessagesWithPriorityFieldAndSetsJMSPriority() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -436,7 +436,7 @@ public class SenderIntegrationTest extends QpidJmsTestCase {
      */
     @Test(timeout = 10000)
     public void testSendingMessageSetsJMSMessageID() throws Exception {
-        try(TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try(TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -482,7 +482,7 @@ public class SenderIntegrationTest extends QpidJmsTestCase {
      */
     @Test(timeout = 5000)
     public void testSendingMessageWithDisableMessageIDHint() throws Exception {
-        try(TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try(TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/a587e3fd/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
index 126bba9..53f846b 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
@@ -79,7 +79,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testCloseSession() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
@@ -91,7 +91,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testCreateProducer() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
 
@@ -106,7 +106,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testCreateProducerLinkSupportsAcceptedAndRejectedOutcomes() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
 
@@ -132,7 +132,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testCreateConsumer() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -152,7 +152,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testCreateTemporaryQueue() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -173,7 +173,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testCreateTemporaryTopic() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -194,7 +194,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testCreateDurableTopicSubscriber() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -219,7 +219,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testCloseDurableTopicSubscriberDetachesWithCloseFalse() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -244,7 +244,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testCreateAnonymousProducerWhenAnonymousRelayNodeIsSupported() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             //Add capability to indicate support for ANONYMOUS-RELAY
             Symbol[] serverCapabilities = new Symbol[]{AmqpConnectionProperties.ANONYMOUS_RELAY};
 
@@ -301,7 +301,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
     }
 
     private void doCreateAnonymousProducerFailsWhenAnonymousRelayNodeIsSupportedButLinkRefusedTestImpl(boolean deferAttachFrameWrite) throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             //Add capability to indicate support for ANONYMOUS-RELAY
             Symbol[] serverCapabilities = new Symbol[]{AmqpConnectionProperties.ANONYMOUS_RELAY};
 
@@ -343,7 +343,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
     }
 
     private void doCreateProducerFailsWhenLinkRefusedTestImpl(boolean deferAttachResponseWrite) throws JMSException, InterruptedException, Exception, IOException {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -377,7 +377,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testCreateAnonymousProducerWhenAnonymousRelayNodeIsNotSupported() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
 
             //DO NOT add capability to indicate server support for ANONYMOUS-RELAY
 
@@ -439,7 +439,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
     }
 
     private void doCommitTransactedSessionWithConsumerTestImpl(int transferCount, int consumeCount) throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -495,7 +495,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout=5000)
     public void testProducedMessagesOnTransactedSessionCarryTxnId() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -551,7 +551,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
     }
 
     private void doRollbackTransactedSessionWithConsumerTestImpl(int transferCount, int consumeCount) throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -619,7 +619,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout=5000)
     public void testRollbackTransactedSessionWithPrefetchFullBeforeStoppingConsumer() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             int messageCount = 5;
             ((JmsConnection) connection).getPrefetchPolicy().setAll(messageCount);
@@ -693,7 +693,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout=5000)
     public void testRollbackTransactedSessionWithPrefetchFullyUtilisedByDrainWhenStoppingConsumer() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             int messageCount = 5;
             ((JmsConnection) connection).getPrefetchPolicy().setAll(messageCount);
@@ -772,7 +772,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout=5000)
     public void testDefaultOutcomeIsModifiedForConsumerSourceOnTransactedSession() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -802,7 +802,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout=5000)
     public void testPrefetchPolicyInfluencesCreditFlow() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             int newPrefetch = 263;
             ((JmsConnection) connection).getPrefetchPolicy().setAll(newPrefetch);

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/a587e3fd/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/StreamMessageIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/StreamMessageIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/StreamMessageIntegrationTest.java
index b337f8d..10311fc 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/StreamMessageIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/StreamMessageIntegrationTest.java
@@ -60,7 +60,7 @@ public class StreamMessageIntegrationTest extends QpidJmsTestCase {
      */
     @Test(timeout = 5000)
     public void testReceiveBasicMapMessage() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -145,7 +145,7 @@ public class StreamMessageIntegrationTest extends QpidJmsTestCase {
      */
     @Test(timeout = 5000)
     public void testSendBasicMapMessage() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/a587e3fd/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/TextMessageIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/TextMessageIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/TextMessageIntegrationTest.java
index 3157945..876b30c 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/TextMessageIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/TextMessageIntegrationTest.java
@@ -48,7 +48,7 @@ public class TextMessageIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testSendTextMessage() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -77,7 +77,7 @@ public class TextMessageIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testReceiveTextMessageWithContentAmqpValue() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 
@@ -105,7 +105,7 @@ public class TextMessageIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testSendTextMessageWithoutContent() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             testPeer.expectBegin(true);
             testPeer.expectSenderAttach();
@@ -133,7 +133,7 @@ public class TextMessageIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testReceiveTextMessageWithAmqpValueNullBodyAndNoMsgTypeAnnotation() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);) {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer(testFixture.getAvailablePort());) {
             Connection connection = testFixture.establishConnecton(testPeer);
             connection.start();
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org