From 47c392bad380f9b37ad1c4620f889ede9ed821d3 Mon Sep 17 00:00:00 2001 From: Bosanac Dejan Date: Wed, 18 Apr 2012 12:40:51 +0000 Subject: [PATCH] ExpiredMessagesWithNoConsumerTest - trying to tweak it a bit to prevent failures on slow machines git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1327484 13f79535-47bb-0310-9956-ffa450edef68 --- .../ExpiredMessagesWithNoConsumerTest.java | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/ExpiredMessagesWithNoConsumerTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/ExpiredMessagesWithNoConsumerTest.java index 9bc2590542..1eae40f6c7 100644 --- a/activemq-core/src/test/java/org/apache/activemq/usecases/ExpiredMessagesWithNoConsumerTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/usecases/ExpiredMessagesWithNoConsumerTest.java @@ -16,23 +16,7 @@ */ package org.apache.activemq.usecases; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicLong; - -import javax.jms.Connection; -import javax.jms.DeliveryMode; -import javax.jms.Message; -import javax.jms.MessageConsumer; -import javax.jms.MessageListener; -import javax.jms.MessageProducer; -import javax.jms.Session; -import javax.jms.Topic; -import javax.jms.TopicSubscriber; -import javax.management.ObjectName; - import junit.framework.Test; - import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.CombinationTestSupport; import org.apache.activemq.broker.BrokerService; @@ -49,6 +33,20 @@ import org.apache.activemq.util.Wait; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.jms.Connection; +import javax.jms.DeliveryMode; +import javax.jms.Message; +import javax.jms.MessageConsumer; +import javax.jms.MessageListener; +import javax.jms.MessageProducer; +import javax.jms.Session; +import javax.jms.Topic; +import javax.jms.TopicSubscriber; +import javax.management.ObjectName; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; + public class ExpiredMessagesWithNoConsumerTest extends CombinationTestSupport { private static final Logger LOG = LoggerFactory.getLogger(ExpiredMessagesWithNoConsumerTest.class); @@ -499,7 +497,7 @@ public class ExpiredMessagesWithNoConsumerTest extends CombinationTestSupport { connection.start(); Topic destination = session.createTopic("test"); producer = session.createProducer(destination); - final int ttl = 300; + final int ttl = 1000; producer.setTimeToLive(ttl); final long sendCount = 10; @@ -518,7 +516,7 @@ public class ExpiredMessagesWithNoConsumerTest extends CombinationTestSupport { assertEquals(0, view.getExpiredCount()); assertEquals(10, view.getEnqueueCount()); - Thread.sleep(4000); + Thread.sleep(5000); LOG.info("expired=" + view.getExpiredCount() + " " + view.getEnqueueCount()); assertEquals(10, view.getExpiredCount());