activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject activemq git commit: AMQ-7118 - Override hostname for naming to allow tests to apss on all platforms
Date Tue, 08 Jan 2019 00:04:39 GMT
Repository: activemq
Updated Branches:
  refs/heads/activemq-5.15.x 2ed15d563 -> a2dccbf84


AMQ-7118 - Override hostname for naming to allow tests to apss on all
platforms


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

Branch: refs/heads/activemq-5.15.x
Commit: a2dccbf8431b881fc95f63a41ce4deb4ae476304
Parents: 2ed15d5
Author: Jeff Genender <jgenender@savoirtech.com>
Authored: Mon Jan 7 17:03:20 2019 -0700
Committer: Jeff Genender <jgenender@savoirtech.com>
Committed: Mon Jan 7 17:03:20 2019 -0700

----------------------------------------------------------------------
 .../src/test/java/org/apache/activemq/bugs/AMQ7118Test.java   | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/a2dccbf8/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ7118Test.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ7118Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ7118Test.java
index 0e845d2..d637fb9 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ7118Test.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ7118Test.java
@@ -16,9 +16,11 @@
  */
 package org.apache.activemq.bugs;
 
+import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerFactory;
 import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.command.ConnectionId;
 import org.apache.commons.lang.StringUtils;
 import org.junit.After;
 import org.junit.Before;
@@ -51,6 +53,7 @@ public class AMQ7118Test {
     private final String xbean = "xbean:";
     private final String confBase = "src/test/resources/org/apache/activemq/bugs/amq7118";
     int checkpointIndex = 0;
+    protected long idGenerator;
 
     private static final ActiveMQConnectionFactory ACTIVE_MQ_CONNECTION_FACTORY = new ActiveMQConnectionFactory(WIRE_LEVEL_ENDPOINT);
 
@@ -67,6 +70,10 @@ public class AMQ7118Test {
 
     public void setupProducerConnection() throws Exception {
         producerConnection = ACTIVE_MQ_CONNECTION_FACTORY.createConnection();
+
+        //Small hack to be sure the message IDs are the same across platforms when testing
+        ((ActiveMQConnection)producerConnection).getConnectionInfo().setConnectionId(new
ConnectionId("connection:" + (++idGenerator)));
+
         producerConnection.start();
         pSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
     }


Mime
View raw message