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 0e845d2e08..d637fb9545 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); }