[jboss-cvs] JBoss Messaging SVN: r5558 - in trunk/tests/src/org/jboss/messaging/tests/integration: management and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Dec 22 03:09:41 EST 2008


Author: jmesnil
Date: 2008-12-22 03:09:41 -0500 (Mon, 22 Dec 2008)
New Revision: 5558

Modified:
   trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSQueueControlTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/TopicControlTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlTest.java
Log:
removed Thread.sleep() calls since the connection factory is now blocking when sending messages

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSQueueControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSQueueControlTest.java	2008-12-22 07:56:11 UTC (rev 5557)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSQueueControlTest.java	2008-12-22 08:09:41 UTC (rev 5558)
@@ -122,16 +122,12 @@
 
       JMSUtil.sendMessages(queue, 2);
 
-      Thread.sleep(100);
-
       assertEquals(2, queueControl.getMessageCount());
       assertEquals(2, queueControl.getMessagesAdded());
 
       assertNotNull(consumer.receive(500));
       assertNotNull(consumer.receive(500));
 
-      Thread.sleep(100);
-
       assertEquals(0, queueControl.getMessageCount());
       assertEquals(2, queueControl.getMessagesAdded());
 
@@ -304,9 +300,6 @@
       JMSUtil.sendMessageWithProperty(session, queue, key, unmatchingValue);
       JMSUtil.sendMessageWithProperty(session, queue, key, matchingValue);
 
-      // wiat a little bit to give time for the message to be handled by the server
-      Thread.sleep(200);
-
       assertEquals(3, queueControl.getMessageCount());
 
       assertEquals(2, queueControl.countMessages(key + " =" + matchingValue));

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/TopicControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/TopicControlTest.java	2008-12-22 07:56:11 UTC (rev 5557)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/TopicControlTest.java	2008-12-22 08:09:41 UTC (rev 5558)
@@ -157,9 +157,6 @@
       
       TopicControlMBean topicControl = createTopicControl(topic, mbeanServer);
       
-      // wiat a little bit to give time for the message to be handled by the server
-      Thread.sleep(200);
-
       assertEquals(3, topicControl.getMessageCount());
 
       assertEquals(2, topicControl.countMessagesForSubscription(clientID, subscriptionName, key + " =" + matchingValue));

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlTest.java	2008-12-22 07:56:11 UTC (rev 5557)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlTest.java	2008-12-22 08:09:41 UTC (rev 5558)
@@ -114,8 +114,6 @@
       message.putLongProperty(key, value);
       producer.send(message);
 
-      // wait a little bit to ensure the message is handled by the server
-      Thread.sleep(100);
       QueueControlMBean queueControl = createQueueControl(address, queue, mbeanServer);
       assertEquals(1, queueControl.getMessageCount());
 
@@ -159,6 +157,8 @@
       long unmatchingValue = matchingValue + 1;
 
       ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(InVMConnectorFactory.class.getName()));
+      sf.setBlockOnNonPersistentSend(true);
+      sf.setBlockOnPersistentSend(true);
       ClientSession session = sf.createSession(false, true, true);
 
       SimpleString address = randomSimpleString();
@@ -179,8 +179,6 @@
       unmatchingMessage.putLongProperty(key, unmatchingValue);
       producer.send(unmatchingMessage);
 
-      // wait a little bit to ensure the message is handled by the server
-      Thread.sleep(100);
       QueueControlMBean queueControl = createQueueControl(address, queue, mbeanServer);
       assertEquals(2, queueControl.getMessageCount());
 
@@ -234,8 +232,6 @@
       producer.send(session.createClientMessage(false));
       producer.send(session.createClientMessage(false));
 
-      // wait a little bit to ensure the message is handled by the server
-      Thread.sleep(100);
       QueueControlMBean queueControl = createQueueControl(address, queue, mbeanServer);
       assertEquals(2, queueControl.getMessageCount());
 
@@ -286,8 +282,6 @@
       unmatchingMessage.putLongProperty(key, unmatchingValue);
       producer.send(unmatchingMessage);
 
-      // wait a little bit to ensure the message is handled by the server
-      Thread.sleep(100);
       QueueControlMBean queueControl = createQueueControl(address, queue, mbeanServer);
       assertEquals(2, queueControl.getMessageCount());
 
@@ -339,8 +333,6 @@
       producer.send(unmatchingMessage);
       producer.send(matchingMessage);
 
-      // wait a little bit to ensure the message is handled by the server
-      Thread.sleep(100);
       QueueControlMBean queueControl = createQueueControl(address, queue, mbeanServer);
       assertEquals(3, queueControl.getMessageCount());
 
@@ -375,8 +367,6 @@
       unmatchingMessage.putLongProperty(key, unmatchingValue);
       producer.send(unmatchingMessage);
 
-      // wait a little bit to ensure the message is handled by the server
-      Thread.sleep(100);
       QueueControlMBean queueControl = createQueueControl(address, queue, mbeanServer);
       assertEquals(2, queueControl.getMessageCount());
 




More information about the jboss-cvs-commits mailing list