From 3ec560f2a83f9973a9c130a4ef8dc2eeeeb51ab2 Mon Sep 17 00:00:00 2001 From: "Christopher L. Shannon (cshannon)" Date: Thu, 10 Sep 2015 16:22:44 +0000 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-5923 Making message size statistic tests more reliable --- .../apache/activemq/store/AbstractStoreStatTestSupport.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/store/AbstractStoreStatTestSupport.java b/activemq-unit-tests/src/test/java/org/apache/activemq/store/AbstractStoreStatTestSupport.java index 3f0e7c1382..e9630f0a36 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/store/AbstractStoreStatTestSupport.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/store/AbstractStoreStatTestSupport.java @@ -253,8 +253,7 @@ public abstract class AbstractStoreStatTestSupport { */ protected BytesMessage createMessage(Session session, int messageSize, AtomicLong publishedMessageSize) throws JMSException { final BytesMessage message = session.createBytesMessage(); - final Random rn = new Random(); - int size = rn.nextInt(messageSize - 100); + int size = messageSize; if (publishedMessageSize != null) { publishedMessageSize.addAndGet(size); }