From 60a526c36b5a3842c1f7eac1a8ffda5cd315c904 Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Wed, 28 Feb 2007 07:29:43 +0000 Subject: [PATCH] now check for correct order of messages git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@512643 13f79535-47bb-0310-9956-ffa450edef68 --- .../bugs/JmsDurableTopicSlowReceiveTest.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/activemq-core/src/test/java/org/apache/activemq/bugs/JmsDurableTopicSlowReceiveTest.java b/activemq-core/src/test/java/org/apache/activemq/bugs/JmsDurableTopicSlowReceiveTest.java index d0ee87d327..23fa2d7b3f 100755 --- a/activemq-core/src/test/java/org/apache/activemq/bugs/JmsDurableTopicSlowReceiveTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/bugs/JmsDurableTopicSlowReceiveTest.java @@ -50,6 +50,7 @@ public class JmsDurableTopicSlowReceiveTest extends JmsTopicSendReceiveTest{ private Connection connection3; private Session consumeSession3; private TopicSubscriber consumer3; + private final String countProperyName = "count"; /** * Set up a durable suscriber test. @@ -84,9 +85,9 @@ public class JmsDurableTopicSlowReceiveTest extends JmsTopicSendReceiveTest{ } protected void configureBroker(BrokerService answer) throws Exception{ - //KahaPersistenceAdapter adapter=new KahaPersistenceAdapter(new File("target/test-amq-data/durableTest")); - //JDBCPersistenceAdapter adapter = new JDBCPersistenceAdapter(); - // answer.setPersistenceAdapter(adapter); + // KahaPersistenceAdapter adapter=new KahaPersistenceAdapter(new File("activemq-data/durableTest")); + // JDBCPersistenceAdapter adapter = new JDBCPersistenceAdapter(); + // answer.setPersistenceAdapter(adapter); answer.setDeleteAllMessagesOnStartup(true); } @@ -110,6 +111,7 @@ public class JmsDurableTopicSlowReceiveTest extends JmsTopicSendReceiveTest{ public void run(){ try{ + int count = 0; for(int loop=0;loop<4;loop++){ connection2=createConnection(); connection2.start(); @@ -121,12 +123,14 @@ public class JmsDurableTopicSlowReceiveTest extends JmsTopicSendReceiveTest{ BytesMessage message=session2.createBytesMessage(); message.writeBytes(new byte[MSIZE]); message.setStringProperty("test","test"); + message.setIntProperty(countProperyName,count); message.setJMSType("test"); producer2.send(consumerDestination2,message); Thread.sleep(50); - if (verbose) { - System.err.println("Sent("+loop+"): "+i); + if(verbose){ + System.out.println("Sent("+loop+"): "+i); } + count++; } producer2.close(); connection2.stop(); @@ -143,6 +147,7 @@ public class JmsDurableTopicSlowReceiveTest extends JmsTopicSendReceiveTest{ consumeSession3=connection3.createSession(false,Session.CLIENT_ACKNOWLEDGE); consumer3=consumeSession3.createDurableSubscriber((Topic)consumerDestination2,getName()); connection3.close(); + int count =0; for(int loop=0;loop<4;++loop){ connection3=createConnection(); connection3.setClientID("test"); @@ -152,23 +157,22 @@ public class JmsDurableTopicSlowReceiveTest extends JmsTopicSendReceiveTest{ Message msg=null; int i; for(i=0;i