You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by gt...@apache.org on 2019/09/20 09:01:06 UTC

[activemq] branch master updated: AMQ-7118 ensure message size and usage is constant for the test, fix failure

This is an automated email from the ASF dual-hosted git repository.

gtully pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/master by this push:
     new e8e27f0  AMQ-7118 ensure message size and usage is constant for the test, fix failure
e8e27f0 is described below

commit e8e27f0b16e099e6774096f5c9adbd404dcd0cc7
Author: gtully <ga...@gmail.com>
AuthorDate: Fri Sep 20 10:00:33 2019 +0100

    AMQ-7118 ensure message size and usage is constant for the test, fix failure
---
 .../java/org/apache/activemq/bugs/AMQ7118Test.java     | 18 ++++++------------
 .../org/apache/activemq/bugs/amq7118/activemq.xml      |  2 +-
 2 files changed, 7 insertions(+), 13 deletions(-)

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 d637fb9..774422f 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,11 +16,9 @@
  */
 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;
@@ -53,7 +51,6 @@ 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);
 
@@ -61,6 +58,7 @@ public class AMQ7118Test {
     public void setup() throws Exception {
         deleteData(new File("target/data"));
         createBroker();
+        ACTIVE_MQ_CONNECTION_FACTORY.setConnectionIDPrefix("bla");
     }
 
     @After
@@ -70,10 +68,6 @@ 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);
     }
@@ -139,11 +133,11 @@ public class AMQ7118Test {
         LOG.info("All messages Consumed.");
 
         //Clean up the log files and be sure its stable
-        checkFiles(true, 2, "db-33.log");
-        checkFiles(true, 3, "db-34.log");
-        checkFiles(true, 2, "db-34.log");
-        checkFiles(true, 2, "db-34.log");
-        checkFiles(true, 2, "db-34.log");
+        checkFiles(true, 2, "db-30.log");
+        checkFiles(true, 3, "db-31.log");
+        checkFiles(true, 2, "db-31.log");
+        checkFiles(true, 2, "db-31.log");
+        checkFiles(true, 2, "db-31.log");
 
         broker.stop();
         broker.waitUntilStopped();
diff --git a/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq7118/activemq.xml b/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq7118/activemq.xml
index b610ae0..e27e937 100644
--- a/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq7118/activemq.xml
+++ b/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq7118/activemq.xml
@@ -24,7 +24,7 @@
     <!--
         The <broker> element is used to configure the ActiveMQ broker.
     -->
-    <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="target/data">
+    <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" brokerId="brokerId" dataDirectory="target/data">
 
         <destinationPolicy>
             <policyMap>