Author: timfox
Date: 2009-11-09 16:20:59 -0500 (Mon, 09 Nov 2009)
New Revision: 8254
Modified:
trunk/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java
trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java
trunk/tests/src/org/hornetq/tests/integration/DuplicateDetectionTest.java
trunk/tests/src/org/hornetq/tests/integration/InterceptorTest.java
trunk/tests/src/org/hornetq/tests/integration/client/CompactingTest.java
trunk/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java
trunk/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java
trunk/tests/src/org/hornetq/tests/integration/client/LargeMessageTest.java
trunk/tests/src/org/hornetq/tests/integration/client/MessageDurabilityTest.java
trunk/tests/src/org/hornetq/tests/integration/client/MessageExpirationTest.java
trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java
trunk/tests/src/org/hornetq/tests/integration/client/PagingTest.java
trunk/tests/src/org/hornetq/tests/integration/client/TransactionDurabilityTest.java
trunk/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeStartTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
trunk/tests/src/org/hornetq/tests/integration/divert/DivertTest.java
trunk/tests/src/org/hornetq/tests/integration/divert/PersistentDivertTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/bridge/JMSBridgeTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/client/PreACKJMSTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/consumer/ConsumerTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java
trunk/tests/src/org/hornetq/tests/integration/management/ManagementTestBase.java
trunk/tests/src/org/hornetq/tests/integration/management/NotificationTest.java
trunk/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java
trunk/tests/src/org/hornetq/tests/integration/management/SecurityNotificationTest.java
trunk/tests/src/org/hornetq/tests/integration/paging/PageCrashTest.java
trunk/tests/src/org/hornetq/tests/integration/scheduling/ScheduledMessageTest.java
trunk/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java
trunk/tests/src/org/hornetq/tests/integration/server/LVQTest.java
trunk/tests/src/org/hornetq/tests/integration/server/PredefinedQueueTest.java
trunk/tests/src/org/hornetq/tests/integration/xa/BasicXaRecoveryTest.java
trunk/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java
trunk/tests/src/org/hornetq/tests/stress/journal/LargeJournalStressTest.java
Log:
replace receive(x) with receiveImmediate in many tests
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java 2009-11-09
15:26:12 UTC (rev 8253)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -213,10 +213,12 @@
{
break;
}
+
// we only force delivery once per call to receive
if (!deliveryForced)
{
session.forceDelivery(id, forceDeliveryCount.incrementAndGet());
+
deliveryForced = true;
}
}
Modified: trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2009-11-09 15:26:12
UTC (rev 8253)
+++ trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2009-11-09 21:20:59
UTC (rev 8254)
@@ -591,7 +591,7 @@
final boolean preAcknowledge,
final boolean xa,
final int sendWindowSize) throws
Exception
- {
+ {
if (!started)
{
throw new HornetQException(HornetQException.SESSION_CREATION_REJECTED,
"Server not started");
Modified: trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java 2009-11-09 15:26:12 UTC
(rev 8253)
+++ trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java 2009-11-09 21:20:59 UTC
(rev 8254)
@@ -496,19 +496,7 @@
public synchronized int getMessageCount()
{
- int count = messageReferences.size() + getScheduledCount() + getDeliveringCount();
-
- // log.info(System.identityHashCode(this) + " message count is " +
- // count +
- // " ( mr:" +
- // messageReferences.size() +
- // " sc:" +
- // getScheduledCount() +
- // " dc:" +
- // getDeliveringCount() +
- // ")");
-
- return count;
+ return messageReferences.size() + getScheduledCount() + getDeliveringCount();
}
public synchronized int getScheduledCount()
@@ -1432,7 +1420,6 @@
}
message.decrementRefCount(store, ref);
-
}
void postRollback(final LinkedList<MessageReference> refs) throws Exception
Modified: trunk/tests/src/org/hornetq/tests/integration/DuplicateDetectionTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/DuplicateDetectionTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++ trunk/tests/src/org/hornetq/tests/integration/DuplicateDetectionTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -83,13 +83,13 @@
message = createMessage(session, 2);
message.putBytesProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID.getData());
producer.send(message);
- message2 = consumer.receive(250);
+ message2 = consumer.receiveImmediate();
assertNull(message2);
message = createMessage(session, 3);
message.putBytesProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID.getData());
producer.send(message);
- message2 = consumer.receive(250);
+ message2 = consumer.receiveImmediate();
assertNull(message2);
// Now try with a different id
@@ -104,13 +104,13 @@
message = createMessage(session, 5);
message.putBytesProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID,
dupID2.getData());
producer.send(message);
- message2 = consumer.receive(1000);
+ message2 = consumer.receiveImmediate();
assertNull(message2);
message = createMessage(session, 6);
message.putBytesProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID.getData());
producer.send(message);
- message2 = consumer.receive(250);
+ message2 = consumer.receiveImmediate();
assertNull(message2);
session.close();
@@ -149,13 +149,13 @@
message = createMessage(session, 2);
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
producer.send(message);
- message2 = consumer.receive(250);
+ message2 = consumer.receiveImmediate();
assertNull(message2);
message = createMessage(session, 3);
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
producer.send(message);
- message2 = consumer.receive(250);
+ message2 = consumer.receiveImmediate();
assertNull(message2);
// Now try with a different id
@@ -170,13 +170,13 @@
message = createMessage(session, 5);
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID2);
producer.send(message);
- message2 = consumer.receive(1000);
+ message2 = consumer.receiveImmediate();
assertNull(message2);
message = createMessage(session, 6);
message.putStringProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID);
producer.send(message);
- message2 = consumer.receive(250);
+ message2 = consumer.receiveImmediate();
assertNull(message2);
session.close();
@@ -253,11 +253,11 @@
producer3.send(message);
}
- ClientMessage message = consumer1.receive(100);
+ ClientMessage message = consumer1.receiveImmediate();
assertNull(message);
- message = consumer2.receive(100);
+ message = consumer2.receiveImmediate();
assertNull(message);
- message = consumer3.receive(100);
+ message = consumer3.receiveImmediate();
assertNull(message);
for (int i = 0; i < cacheSize; i++)
@@ -299,11 +299,11 @@
producer3.send(message);
}
- message = consumer1.receive(100);
+ message = consumer1.receiveImmediate();
assertNull(message);
- message = consumer2.receive(100);
+ message = consumer2.receiveImmediate();
assertNull(message);
- message = consumer3.receive(100);
+ message = consumer3.receiveImmediate();
assertNull(message);
// Should be able to send the first lot again now - since the second lot pushed
the
@@ -379,7 +379,7 @@
message = consumer.receive(250);
assertEquals(1, message.getObjectProperty(propKey));
- message = consumer.receive(250);
+ message = consumer.receiveImmediate();
assertNull(message);
session.close();
@@ -421,7 +421,7 @@
message = consumer.receive(250);
assertEquals(1, message.getObjectProperty(propKey));
- message = consumer.receive(250);
+ message = consumer.receiveImmediate();
assertNull(message);
session.close();
@@ -475,7 +475,7 @@
message = consumer.receive(250);
assertEquals(1, message.getObjectProperty(propKey));
- message = consumer.receive(250);
+ message = consumer.receiveImmediate();
assertNull(message);
session.close();
@@ -536,7 +536,7 @@
message = consumer.receive(250);
assertEquals(0, message.getObjectProperty(propKey));
- message = consumer.receive(250);
+ message = consumer.receiveImmediate();
assertNull(message);
session.close();
@@ -602,7 +602,7 @@
message = consumer.receive(250);
assertEquals(1, message.getObjectProperty(propKey));
- message = consumer.receive(250);
+ message = consumer.receiveImmediate();
assertNull(message);
log.info("ending session");
@@ -679,7 +679,7 @@
message = consumer.receive(250);
assertEquals(1, message.getObjectProperty(propKey));
- message = consumer.receive(250);
+ message = consumer.receiveImmediate();
assertNull(message);
log.info("ending session");
@@ -755,7 +755,7 @@
message = consumer.receive(250);
- message = consumer.receive(250);
+ message = consumer.receiveImmediate();
assertNull(message);
log.info("ending session");
@@ -833,7 +833,7 @@
message = consumer.receive(250);
- message = consumer.receive(250);
+ message = consumer.receiveImmediate();
assertNull(message);
log.info("ending session");
@@ -924,13 +924,13 @@
message = createMessage(session, 1);
message.putBytesProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID.getData());
producer.send(message);
- message2 = consumer.receive(200);
+ message2 = consumer.receiveImmediate();
assertNull(message2);
message = createMessage(session, 2);
message.putBytesProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID,
dupID2.getData());
producer.send(message);
- message2 = consumer.receive(200);
+ message2 = consumer.receiveImmediate();
assertNull(message2);
session.close();
@@ -1006,7 +1006,7 @@
SimpleString dupID = new SimpleString("abcdefg" + i);
message.putBytesProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID,
dupID.getData());
producer.send(message);
- ClientMessage message2 = consumer.receive(100);
+ ClientMessage message2 = consumer.receiveImmediate();
assertNull(message2);
}
@@ -1094,7 +1094,7 @@
}
else
{
- ClientMessage message2 = consumer.receive(100);
+ ClientMessage message2 = consumer.receiveImmediate();
assertNull(message2);
}
}
@@ -1194,7 +1194,7 @@
}
else
{
- ClientMessage message2 = consumer.receive(100);
+ ClientMessage message2 = consumer.receiveImmediate();
assertNull(message2);
}
}
@@ -1448,14 +1448,14 @@
message.putBytesProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID, dupID.getData());
producer.send(message);
session.commit();
- message2 = consumer.receive(200);
+ message2 = consumer.receiveImmediate();
assertNull(message2);
message = createMessage(session, 2);
message.putBytesProperty(MessageImpl.HDR_DUPLICATE_DETECTION_ID,
dupID2.getData());
producer.send(message);
session.commit();
- message2 = consumer.receive(200);
+ message2 = consumer.receiveImmediate();
assertNull(message2);
session.close();
@@ -1749,10 +1749,10 @@
session.start(xid3, XAResource.TMNOFLAGS);
- ClientMessage message2 = consumer.receive(200);
+ ClientMessage message2 = consumer.receiveImmediate();
assertNull(message2);
- message2 = consumer.receive(200);
+ message2 = consumer.receiveImmediate();
assertNull(message2);
session.close();
@@ -1847,10 +1847,10 @@
session.start(xid3, XAResource.TMNOFLAGS);
- ClientMessage message2 = consumer.receive(200);
+ ClientMessage message2 = consumer.receiveImmediate();
assertNull(message2);
- message2 = consumer.receive(200);
+ message2 = consumer.receiveImmediate();
assertNull(message2);
session.close();
Modified: trunk/tests/src/org/hornetq/tests/integration/InterceptorTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/InterceptorTest.java 2009-11-09 15:26:12
UTC (rev 8253)
+++ trunk/tests/src/org/hornetq/tests/integration/InterceptorTest.java 2009-11-09 21:20:59
UTC (rev 8254)
@@ -325,7 +325,7 @@
session.start();
- ClientMessage message = consumer.receive(250);
+ ClientMessage message = consumer.receiveImmediate();
assertNull(message);
@@ -416,7 +416,7 @@
session.start();
- ClientMessage message = consumer.receive(250);
+ ClientMessage message = consumer.receive(100);
assertNull(message);
@@ -500,7 +500,7 @@
producer.send(message);
}
- ClientMessage message = consumer.receive(250);
+ ClientMessage message = consumer.receiveImmediate();
assertNull(message);
@@ -589,7 +589,7 @@
producer.send(message);
}
- ClientMessage message = consumer.receive(250);
+ ClientMessage message = consumer.receive(100);
assertNull(message);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/CompactingTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/CompactingTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++ trunk/tests/src/org/hornetq/tests/integration/client/CompactingTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -383,7 +383,7 @@
cons = sess.createConsumer(Q2);
- assertNull(cons.receive(100));
+ assertNull(cons.receiveImmediate());
cons.close();
Modified: trunk/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -64,7 +64,7 @@
assertEquals(m.getBody().readString(), "heyho!");
// force a cancel
clientSession.rollback();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
clientConsumer.close();
clientConsumer = clientSession.createConsumer(dlq);
@@ -96,7 +96,7 @@
assertEquals(m.getBody().readString(), "heyho!");
// force a cancel
clientSession.rollback();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
clientConsumer.close();
clientConsumer = clientSession.createConsumer(dlq);
@@ -130,7 +130,7 @@
assertEquals(m.getBody().readString(), "heyho!");
// force a cancel
clientSession.rollback();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
clientConsumer.close();
}
@@ -180,7 +180,7 @@
}
assertEquals(0,
((Queue)server.getPostOffice().getBinding(qName).getBindable()).getMessageCount());
- ClientMessage m = clientConsumer.receive(1000);
+ ClientMessage m = clientConsumer.receiveImmediate();
assertNull(m);
// All the messages should now be in the DLQ
@@ -281,7 +281,7 @@
m.acknowledge();
clientSession.rollback();
}
- ClientMessage m = clientConsumer.receive(500);
+ ClientMessage m = clientConsumer.receiveImmediate();
assertNull(m);
clientConsumer.close();
@@ -334,8 +334,8 @@
clientSession.rollback();
}
- assertNull(defaultDeadLetterConsumer.receive(500));
- assertNull(specificDeadLetterConsumer.receive(500));
+ assertNull(defaultDeadLetterConsumer.receiveImmediate());
+ assertNull(specificDeadLetterConsumer.receiveImmediate());
// one more redelivery attempt:
ClientMessage m = clientConsumer.receive(500);
@@ -344,7 +344,7 @@
m.acknowledge();
clientSession.rollback();
- assertNull(defaultDeadLetterConsumer.receive(500));
+ assertNull(defaultDeadLetterConsumer.receiveImmediate());
assertNotNull(specificDeadLetterConsumer.receive(500));
}
Modified: trunk/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++ trunk/tests/src/org/hornetq/tests/integration/client/ExpiryAddressTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -60,10 +60,10 @@
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
- ClientMessage m = clientConsumer.receive(500);
+ ClientMessage m = clientConsumer.receiveImmediate();
assertNull(m);
System.out.println("size3 = " +
server.getPostOffice().getPagingManager().getTotalMemory());
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
clientConsumer.close();
clientConsumer = clientSession.createConsumer(eq);
@@ -100,7 +100,7 @@
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
- ClientMessage m = clientConsumer.receive(500);
+ ClientMessage m = clientConsumer.receiveImmediate();
System.out.println("pageSize after message received = " +
server.getPostOffice().getPagingManager().getTotalMemory());
@@ -155,7 +155,7 @@
producer.send(clientMessage);
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
- ClientMessage m = clientConsumer.receive(500);
+ ClientMessage m = clientConsumer.receiveImmediate();
assertNull(m);
clientConsumer.close();
}
@@ -185,7 +185,7 @@
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
clientSession.start();
- ClientMessage m = clientConsumer.receive(1000);
+ ClientMessage m = clientConsumer.receiveImmediate();
assertNull(m);
// All the messages should now be in the EQ
@@ -227,7 +227,7 @@
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
- ClientMessage m = clientConsumer.receive(500);
+ ClientMessage m = clientConsumer.receiveImmediate();
assertNull(m);
clientConsumer.close();
@@ -257,7 +257,7 @@
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(qName);
- ClientMessage m = clientConsumer.receive(500);
+ ClientMessage m = clientConsumer.receiveImmediate();
assertNull(m);
clientConsumer.close();
@@ -295,12 +295,12 @@
clientSession.start();
ClientConsumer clientConsumer = clientSession.createConsumer(queue);
- ClientMessage m = clientConsumer.receive(500);
+ ClientMessage m = clientConsumer.receiveImmediate();
assertNull(m);
clientConsumer.close();
clientConsumer = clientSession.createConsumer(defaultExpiryQueue);
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
clientConsumer.close();
Modified: trunk/tests/src/org/hornetq/tests/integration/client/LargeMessageTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/LargeMessageTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++ trunk/tests/src/org/hornetq/tests/integration/client/LargeMessageTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -397,7 +397,7 @@
ClientConsumer consumerExpired = session.createConsumer(ADDRESS);
// to kick expiry quicker than waiting reaper thread
- assertNull(consumerExpired.receive(1000));
+ assertNull(consumerExpired.receiveImmediate());
consumerExpired.close();
ClientConsumer consumerExpiry = session.createConsumer(ADDRESS_EXPIRY);
@@ -532,7 +532,7 @@
ClientConsumer consumerExpired = session.createConsumer(ADDRESS);
// to kick expiry quicker than waiting reaper thread
- assertNull(consumerExpired.receive(1000));
+ assertNull(consumerExpired.receiveImmediate());
consumerExpired.close();
ClientConsumer consumerExpiry = session.createConsumer(ADDRESS_EXPIRY);
@@ -666,7 +666,7 @@
// Creating a consumer just to make the expiry process go faster and not have to
wait for the reaper
ClientConsumer consumer2 = session.createConsumer(ADDRESS);
- assertNull(consumer2.receive(1000));
+ assertNull(consumer2.receiveImmediate());
ClientMessage msg1 = consumer.receive(50000);
@@ -1370,7 +1370,7 @@
ClientConsumer consumer = session.createConsumer(queue[1]);
ClientMessage msg = consumer.receive(RECEIVE_WAIT_TIME);
- assertNull(consumer.receive(1000));
+ assertNull(consumer.receiveImmediate());
assertNotNull(msg);
msg.acknowledge();
Modified: trunk/tests/src/org/hornetq/tests/integration/client/MessageDurabilityTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/MessageDurabilityTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/client/MessageDurabilityTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -91,7 +91,7 @@
session.start();
ClientConsumer consumer = session.createConsumer(queue);
- assertNull(consumer.receive(500));
+ assertNull(consumer.receiveImmediate());
consumer.close();
session.deleteQueue(queue);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/MessageExpirationTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/MessageExpirationTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/client/MessageExpirationTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -72,7 +72,7 @@
session.start();
ClientConsumer consumer = session.createConsumer(queue);
- ClientMessage message2 = consumer.receive(500);
+ ClientMessage message2 = consumer.receiveImmediate();
assertNull(message2);
consumer.close();
@@ -100,9 +100,8 @@
assertEquals(0,
((Queue)server.getPostOffice().getBinding(queue).getBindable()).getDeliveringCount());
assertEquals(0,
((Queue)server.getPostOffice().getBinding(queue).getBindable()).getMessageCount());
-
- ClientMessage message2 = consumer.receive(500);
+ ClientMessage message2 = consumer.receiveImmediate();
assertNull(message2);
consumer.close();
@@ -126,7 +125,7 @@
Thread.sleep(EXPIRATION * 2);
ClientConsumer consumer = session.createConsumer(queue);
- ClientMessage message2 = consumer.receive(500);
+ ClientMessage message2 = consumer.receiveImmediate();
assertNull(message2);
assertEquals(0,
((Queue)server.getPostOffice().getBinding(queue).getBindable()).getDeliveringCount());
@@ -166,7 +165,7 @@
session.start();
ClientConsumer consumer = session.createConsumer(queue);
- ClientMessage message2 = consumer.receive(500);
+ ClientMessage message2 = consumer.receiveImmediate();
assertNull(message2);
ClientConsumer expiryConsumer = session.createConsumer(expiryQueue);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -303,7 +303,7 @@
consumer.close();
consumer2.close();
consumer = this.clientSession.createConsumer(qName);
- assertNull(consumer.receive(500));
+ assertNull(consumer.receiveImmediate());
clientSession.close();
}
@@ -372,7 +372,7 @@
i += 2;
}
consumer = this.clientSession.createConsumer(qName);
- assertNull(consumer.receive(500));
+ assertNull(consumer.receiveImmediate());
clientSession.close();
}
@@ -429,7 +429,7 @@
consumer.close();
consumer2.close();
consumer = this.clientSession.createConsumer(qName);
- assertNull(consumer.receive(500));
+ assertNull(consumer.receiveImmediate());
clientSession.close();
}
@@ -506,7 +506,7 @@
i += 2;
}
consumer = this.clientSession.createConsumer(qName);
- assertNull(consumer.receive(500));
+ assertNull(consumer.receiveImmediate());
clientSession.close();
}
Modified: trunk/tests/src/org/hornetq/tests/integration/client/PagingTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/PagingTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++ trunk/tests/src/org/hornetq/tests/integration/client/PagingTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -279,7 +279,7 @@
assertNotNull(msg);
}
- assertNull(consumer.receive(100));
+ assertNull(consumer.receiveImmediate());
consumer.close();
}
@@ -292,7 +292,7 @@
ClientConsumer consumer = session.createConsumer(ADDRESS);
- assertNull(consumer.receive(100));
+ assertNull(consumer.receiveImmediate());
sessionTransacted.commit();
@@ -312,7 +312,7 @@
message.acknowledge();
}
- assertNull(consumer.receive(100));
+ assertNull(consumer.receiveImmediate());
consumer.close();
@@ -524,7 +524,7 @@
session.start();
- assertNull(consumer.receive(100));
+ assertNull(consumer.receiveImmediate());
session.close();
@@ -690,7 +690,7 @@
message2.acknowledge();
}
- assertNull(consumer.receive(100));
+ assertNull(consumer.receiveImmediate());
assertEquals(0, server.getPostOffice().getPagingManager().getTotalMemory());
assertEquals(0,
server.getPostOffice().getPagingManager().getPageStore(ADDRESS).getAddressSize());
@@ -714,7 +714,7 @@
message2.acknowledge();
}
- assertNull(consumer.receive(100));
+ assertNull(consumer.receiveImmediate());
session.close();
@@ -749,7 +749,7 @@
session.commit();
- assertNull(consumer.receive(100));
+ assertNull(consumer.receiveImmediate());
session.close();
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/TransactionDurabilityTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/TransactionDurabilityTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/client/TransactionDurabilityTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -129,7 +129,7 @@
consumer2 = session2.createConsumer(queue2);
- m1 = consumer1.receive(100);
+ m1 = consumer1.receiveImmediate();
assertNull(m1);
@@ -161,11 +161,11 @@
consumer2 = session2.createConsumer(queue2);
- m1 = consumer1.receive(100);
+ m1 = consumer1.receiveImmediate();
assertNull(m1);
- m2 = consumer2.receive(100);
+ m2 = consumer2.receiveImmediate();
assertNull(m2);
Modified: trunk/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/client/WildCardRoutingTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -60,7 +60,7 @@
assertNotNull(m);
assertEquals("m2", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -85,7 +85,7 @@
assertNotNull(m);
assertEquals("m2", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
clientConsumer.close();
clientSession.deleteQueue(queueName);
@@ -118,7 +118,7 @@
assertNotNull(m);
assertEquals("m2", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
clientConsumer.close();
clientSession.deleteQueue(queueName);
@@ -159,7 +159,7 @@
assertNotNull(m);
assertEquals("m2", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -188,7 +188,7 @@
assertNotNull(m);
assertEquals("m2", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -306,7 +306,7 @@
assertNotNull(m);
assertEquals("m9", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
//now remove all the queues
clientSession.deleteQueue(queueName1);
@@ -403,7 +403,7 @@
assertNotNull(m);
assertEquals("m9", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
//now remove all the queues
clientSession.deleteQueue(queueName1);
@@ -445,7 +445,7 @@
assertNotNull(m);
assertEquals("m2", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -474,7 +474,7 @@
assertNotNull(m);
assertEquals("m2", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -504,7 +504,7 @@
assertNotNull(m);
assertEquals("m2", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -533,7 +533,7 @@
assertNotNull(m);
assertEquals("m2", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -558,7 +558,7 @@
assertNotNull(m);
assertEquals("m1", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -610,7 +610,7 @@
assertNotNull(m);
assertEquals("m2", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -635,7 +635,7 @@
assertNotNull(m);
assertEquals("m2", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -660,7 +660,7 @@
assertNotNull(m);
assertEquals("m1", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -685,7 +685,7 @@
assertNotNull(m);
assertEquals("m1", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -710,7 +710,7 @@
assertNotNull(m);
assertEquals("m1", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -742,7 +742,7 @@
assertNotNull(m);
assertEquals("m2", m.getBody().readString());
m.acknowledge();
- m = clientConsumer.receive(500);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
clientConsumer.close();
clientSession.deleteQueue(queueName);
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeStartTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeStartTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeStartTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -143,7 +143,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName);
@@ -158,7 +158,7 @@
producer0.send(message);
}
- assertNull(consumer1.receive(500));
+ assertNull(consumer1.receiveImmediate());
bridge.start();
@@ -173,7 +173,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
session0.close();
@@ -294,7 +294,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
for (int i = 0; i < numMessages; i++)
{
@@ -316,7 +316,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
session1.close();
@@ -364,7 +364,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
session1.close();
@@ -474,7 +474,7 @@
session1.start();
// Won't be received since the bridge was deactivated
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
// Now start the bridge manually
@@ -495,7 +495,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
session1.close();
@@ -605,7 +605,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
// Now stop the bridge manually
@@ -624,7 +624,7 @@
producer0.send(message);
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
bridge.start();
@@ -644,7 +644,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
bridge.stop();
@@ -657,7 +657,7 @@
producer0.send(message);
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
bridge.start();
@@ -672,7 +672,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
session1.close();
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -178,7 +178,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
session0.close();
@@ -341,7 +341,7 @@
producer0.send(message);
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
for (int i = 0; i < numMessages; i++)
{
@@ -375,7 +375,7 @@
}
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
session0.close();
@@ -520,7 +520,7 @@
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
session0.close();
@@ -642,7 +642,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
session0.close();
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -156,7 +156,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName);
@@ -171,7 +171,7 @@
producer0.send(message);
}
- assertNull(consumer1.receive(500));
+ assertNull(consumer1.receiveImmediate());
bridge.start();
@@ -186,7 +186,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
session0.close();
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -171,7 +171,7 @@
return;
}
- Thread.sleep(100);
+ Thread.sleep(10);
}
while (System.currentTimeMillis() - start < WAIT_TIMEOUT);
@@ -191,7 +191,7 @@
{
return;
}
- Thread.sleep(100);
+ Thread.sleep(10);
}
while (System.currentTimeMillis() - start < WAIT_TIMEOUT);
String msg = "Timed out waiting for server starting = " + node;
@@ -259,7 +259,7 @@
return;
}
- Thread.sleep(100);
+ Thread.sleep(10);
}
while (System.currentTimeMillis() - start < WAIT_TIMEOUT);
@@ -983,7 +983,7 @@
throw new IllegalArgumentException("No consumer at " +
consumerIDs[i]);
}
- assertNull("consumer " + i + " received message",
holder.consumer.receive(200));
+ assertNull("consumer " + i + " received message",
holder.consumer.receiveImmediate());
}
}
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -318,7 +318,7 @@
session.start();
- ClientMessage message = consumer.receive(500);
+ ClientMessage message = consumer.receiveImmediate();
assertNull(message);
@@ -399,7 +399,7 @@
}
}
- assertNull(consumer.receive(1000));
+ assertNull(consumer.receiveImmediate());
session.commit();
@@ -488,7 +488,7 @@
}
}
- assertNull(consumer.receive(1000));
+ assertNull(consumer.receiveImmediate());
session.commit();
@@ -666,7 +666,7 @@
session2.commit();
- assertNull(consumer.receive(1000));
+ assertNull(consumer.receiveImmediate());
session1.close();
@@ -736,7 +736,7 @@
session.start();
- ClientMessage message = consumer.receive(500);
+ ClientMessage message = consumer.receiveImmediate();
assertNull(message);
@@ -808,7 +808,7 @@
session.start();
- ClientMessage message = consumer.receive(500);
+ ClientMessage message = consumer.receiveImmediate();
assertNull(message);
@@ -883,7 +883,7 @@
session.start();
- ClientMessage message = consumer.receive(500);
+ ClientMessage message = consumer.receiveImmediate();
assertNull(message);
@@ -1887,7 +1887,7 @@
message.acknowledge();
}
- ClientMessage message = consumer.receive(500);
+ ClientMessage message = consumer.receiveImmediate();
assertNull(message);
@@ -2027,7 +2027,7 @@
message.acknowledge();
}
- ClientMessage message = consumer.receive(500);
+ ClientMessage message = consumer.receiveImmediate();
assertNull(message);
@@ -2134,7 +2134,7 @@
message2.acknowledge();
}
- ClientMessage message3 = consumer.receive(250);
+ ClientMessage message3 = consumer.receiveImmediate();
assertNull(message3);
Modified: trunk/tests/src/org/hornetq/tests/integration/divert/DivertTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/divert/DivertTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++ trunk/tests/src/org/hornetq/tests/integration/divert/DivertTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -118,7 +118,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(500));
+ assertNull(consumer1.receiveImmediate());
for (int i = 0; i < numMessages; i++)
{
@@ -131,7 +131,7 @@
message.acknowledge();
}
- assertNull(consumer2.receive(TIMEOUT));
+ assertNull(consumer2.receiveImmediate());
session.close();
@@ -728,7 +728,7 @@
assertNull(consumer3.receiveImmediate());
- assertNull(consumer4.receive(200));
+ assertNull(consumer4.receiveImmediate());
session.close();
Modified: trunk/tests/src/org/hornetq/tests/integration/divert/PersistentDivertTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/divert/PersistentDivertTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/divert/PersistentDivertTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -133,7 +133,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
for (int i = 0; i < numMessages; i++)
{
@@ -146,7 +146,7 @@
message.acknowledge();
}
- assertNull(consumer2.receive(200));
+ assertNull(consumer2.receiveImmediate());
for (int i = 0; i < numMessages; i++)
{
@@ -159,7 +159,7 @@
message.acknowledge();
}
- assertNull(consumer3.receive(200));
+ assertNull(consumer3.receiveImmediate());
for (int i = 0; i < numMessages; i++)
{
@@ -172,7 +172,7 @@
message.acknowledge();
}
- assertNull(consumer4.receive(200));
+ assertNull(consumer4.receiveImmediate());
session.close();
@@ -285,7 +285,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
for (int i = 0; i < numMessages; i++)
{
@@ -298,7 +298,7 @@
message.acknowledge();
}
- assertNull(consumer2.receive(200));
+ assertNull(consumer2.receiveImmediate());
for (int i = 0; i < numMessages; i++)
{
@@ -311,7 +311,7 @@
message.acknowledge();
}
- assertNull(consumer3.receive(200));
+ assertNull(consumer3.receiveImmediate());
for (int i = 0; i < numMessages; i++)
{
@@ -324,7 +324,7 @@
message.acknowledge();
}
- assertNull(consumer4.receive(200));
+ assertNull(consumer4.receiveImmediate());
session.close();
@@ -348,13 +348,13 @@
consumer4 = session.createConsumer(queueName4);
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
- assertNull(consumer2.receive(200));
+ assertNull(consumer2.receiveImmediate());
- assertNull(consumer3.receive(200));
+ assertNull(consumer3.receiveImmediate());
- assertNull(consumer4.receive(200));
+ assertNull(consumer4.receiveImmediate());
session.close();
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/bridge/JMSBridgeTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/bridge/JMSBridgeTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/bridge/JMSBridgeTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -528,7 +528,7 @@
assertEquals("message" + i, tm.getText());
}
- Message m = cons.receive(1000);
+ Message m = cons.receiveNoWait();
assertNull(m);
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/client/PreACKJMSTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/client/PreACKJMSTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/client/PreACKJMSTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -116,7 +116,7 @@
cons = sess.createConsumer(queue);
- msg2 = (TextMessage)cons.receive(10);
+ msg2 = (TextMessage)cons.receiveNoWait();
assertNull("ConnectionFactory is on PreACK mode, the message shouldn't
be received", msg2);
}
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -134,7 +134,7 @@
assertEquals("message" + i, tm.getText());
}
- TextMessage tm = (TextMessage)consumer.receive(1000);
+ TextMessage tm = (TextMessage)consumer.receiveNoWait();
assertNull(tm);
@@ -219,7 +219,7 @@
assertEquals("message" + i, tm.getText());
}
- TextMessage tm = (TextMessage)consumerBackup.receive(1000);
+ TextMessage tm = (TextMessage)consumerBackup.receiveNoWait();
assertNull(tm);
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/consumer/ConsumerTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/jms/consumer/ConsumerTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/jms/consumer/ConsumerTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -22,6 +22,7 @@
import javax.jms.TextMessage;
import org.hornetq.core.config.TransportConfiguration;
+import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.Queue;
import org.hornetq.jms.HornetQQueue;
import org.hornetq.jms.client.HornetQConnectionFactory;
@@ -34,6 +35,8 @@
*/
public class ConsumerTest extends JMSTestBase
{
+ private static final Logger log = Logger.getLogger(ConsumerTest.class);
+
private static final String Q_NAME = "ConsumerTestQueue";
private HornetQQueue jBossQueue;
@@ -112,6 +115,8 @@
public void testPreCommitAcksWithMessageExpiry() throws Exception
{
+ log.info("starting test");
+
Connection conn = cf.createConnection();
Session session = conn.createSession(false, HornetQSession.PRE_ACKNOWLEDGE);
jBossQueue = new HornetQQueue(Q_NAME);
@@ -128,12 +133,12 @@
Thread.sleep(2);
conn.start();
- Message m = consumer.receive(500);
+
+ Message m = consumer.receiveNoWait();
assertNull(m);
SimpleString queueName = new SimpleString(HornetQQueue.JMS_QUEUE_ADDRESS_PREFIX +
Q_NAME);
- assertEquals(0,
((Queue)server.getPostOffice().getBinding(queueName).getBindable()).getDeliveringCount());
- assertEquals(0,
((Queue)server.getPostOffice().getBinding(queueName).getBindable()).getMessageCount());
+ assertEquals(0,
((Queue)server.getPostOffice().getBinding(queueName).getBindable()).getDeliveringCount());
conn.close();
}
@@ -156,12 +161,11 @@
Thread.sleep(2);
conn.start();
- Message m = consumer.receive(500);
+ Message m = consumer.receiveNoWait();
assertNull(m);
SimpleString queueName = new SimpleString(HornetQQueue.JMS_QUEUE_ADDRESS_PREFIX +
Q_NAME);
- assertEquals(0,
((Queue)server.getPostOffice().getBinding(queueName).getBindable()).getDeliveringCount());
- assertEquals(0,
((Queue)server.getPostOffice().getBinding(queueName).getBindable()).getMessageCount());
+ assertEquals(0,
((Queue)server.getPostOffice().getBinding(queueName).getBindable()).getDeliveringCount());
conn.close();
}
Modified:
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -232,7 +232,7 @@
connection.start();
MessageConsumer consumer = JMSUtil.createConsumer(connection, queue);
- assertNull(consumer.receive(500));
+ assertNull(consumer.receiveNoWait());
connection.close();
}
@@ -379,7 +379,7 @@
assertEquals(msg_2.getJMSMessageID(), message.getJMSMessageID());
assertEquals(unmatchingValue, message.getLongProperty(key));
- assertNull(consumer.receive(500));
+ assertNull(consumer.receiveNoWait());
connection.close();
}
@@ -720,7 +720,7 @@
Message message = consumer.receive(500);
assertNotNull(message);
assertEquals(unmatchingValue, message.getLongProperty(key));
- assertNull(consumer.receive(500));
+ assertNull(consumer.receiveNoWait());
JMSUtil.consumeMessages(1, otherQueue);
Modified:
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -149,7 +149,7 @@
m = consumer.receive(500);
Assert.assertNotNull("expected to received " + expected + "
messages, got only " + (i + 1), m);
}
- m = consumer.receive(500);
+ m = consumer.receiveNoWait();
Assert.assertNull("received one more message than expected (" +
expected + ")", m);
}
finally
Modified:
trunk/tests/src/org/hornetq/tests/integration/management/ManagementTestBase.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/management/ManagementTestBase.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/management/ManagementTestBase.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -55,7 +55,7 @@
m.acknowledge();
}
session.commit();
- m = consumer.receive(500);
+ m = consumer.receiveImmediate();
assertNull("received one more message than expected (" + expected +
")", m);
}
finally
Modified: trunk/tests/src/org/hornetq/tests/integration/management/NotificationTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/management/NotificationTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/management/NotificationTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -259,7 +259,7 @@
messages[i] = m;
m.acknowledge();
}
- m = consumer.receive(500);
+ m = consumer.receiveImmediate();
if (m != null)
{
for (SimpleString key : m.getPropertyNames())
Modified: trunk/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -778,7 +778,7 @@
m.acknowledge();
// check there is no other message to consume:
- m = consumer.receive(500);
+ m = consumer.receiveImmediate();
assertNull(m);
consumer.close();
@@ -928,7 +928,7 @@
m.acknowledge();
// check there is no other message to consume:
- m = consumer.receive(500);
+ m = consumer.receiveImmediate();
assertNull(m);
consumer.close();
Modified:
trunk/tests/src/org/hornetq/tests/integration/management/SecurityNotificationTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/management/SecurityNotificationTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/management/SecurityNotificationTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -212,7 +212,7 @@
messages[i] = m;
m.acknowledge();
}
- m = consumer.receive(500);
+ m = consumer.receiveImmediate();
if (m != null)
{
for (SimpleString key : m.getPropertyNames())
Modified: trunk/tests/src/org/hornetq/tests/integration/paging/PageCrashTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/paging/PageCrashTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++ trunk/tests/src/org/hornetq/tests/integration/paging/PageCrashTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -102,7 +102,7 @@
ClientConsumer consumer = session.createConsumer(ADDRESS);
- assertNull(consumer.receive(200));
+ assertNull(consumer.receiveImmediate());
session.close();
}
Modified:
trunk/tests/src/org/hornetq/tests/integration/scheduling/ScheduledMessageTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/scheduling/ScheduledMessageTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/scheduling/ScheduledMessageTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -156,7 +156,7 @@
// Make sure no more messages
consumer.close();
consumer = session.createConsumer(atestq);
- assertNull(consumer.receive(1000));
+ assertNull(consumer.receiveImmediate());
session.close();
}
@@ -204,7 +204,7 @@
consumer.close();
consumer2.close();
consumer = session.createConsumer(atestq);
- assertNull(consumer.receive(1000));
+ assertNull(consumer.receiveImmediate());
session.close();
}
@@ -266,7 +266,7 @@
consumer.close();
consumer2.close();
consumer = session.createConsumer(atestq);
- assertNull(consumer.receive(1000));
+ assertNull(consumer.receiveImmediate());
session.close();
}
@@ -316,7 +316,7 @@
// Make sure no more messages
consumer.close();
consumer = session.createConsumer(atestq);
- assertNull(consumer.receive(1000));
+ assertNull(consumer.receiveImmediate());
session.close();
}
@@ -396,7 +396,7 @@
// Make sure no more messages
consumer.close();
consumer = session.createConsumer(atestq);
- assertNull(consumer.receive(1000));
+ assertNull(consumer.receiveImmediate());
session.close();
}
@@ -477,7 +477,7 @@
// Make sure no more messages
consumer.close();
consumer = session.createConsumer(atestq);
- assertNull(consumer.receive(1000));
+ assertNull(consumer.receiveImmediate());
session.close();
}
@@ -549,7 +549,7 @@
// Make sure no more messages
consumer.close();
consumer = session.createConsumer(atestq);
- assertNull(consumer.receive(1000));
+ assertNull(consumer.receiveImmediate());
session.close();
}
@@ -602,7 +602,7 @@
consumer.close();
// Make sure no more messages
consumer = session.createConsumer(atestq);
- assertNull(consumer.receive(1000));
+ assertNull(consumer.receiveImmediate());
session.close();
}
Modified: trunk/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++ trunk/tests/src/org/hornetq/tests/integration/server/LVQRecoveryTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -154,7 +154,7 @@
assertNotNull(m);
m.acknowledge();
assertEquals(m.getBody().readString(), "m6");
- m = consumer.receive(1000);
+ m = consumer.receiveImmediate();
assertNull(m);
}
protected void tearDown() throws Exception
Modified: trunk/tests/src/org/hornetq/tests/integration/server/LVQTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/server/LVQTest.java 2009-11-09 15:26:12
UTC (rev 8253)
+++ trunk/tests/src/org/hornetq/tests/integration/server/LVQTest.java 2009-11-09 21:20:59
UTC (rev 8254)
@@ -138,7 +138,7 @@
assertNotNull(m);
assertEquals("m2", m.getBody().readString());
m.acknowledge();
- m = consumer.receive(1000);
+ m = consumer.receiveImmediate();
assertNull(m);
}
@@ -191,7 +191,7 @@
assertNotNull(m);
m.acknowledge();
assertEquals(m.getBody().readString(), "m6");
- m = consumer.receive(1000);
+ m = consumer.receiveImmediate();
assertNull(m);
}
@@ -242,7 +242,7 @@
m.acknowledge();
assertEquals(m.getBody().readString(), "m4");
clientSessionTxReceives.commit();
- m = consumer.receive(1000);
+ m = consumer.receiveImmediate();
assertNull(m);
}
@@ -357,7 +357,7 @@
assertNotNull(m);
m.acknowledge();
assertEquals(m.getBody().readString(), "m6");
- m = consumer.receive(250);
+ m = consumer.receiveImmediate();
assertNull(m);
}
@@ -396,7 +396,7 @@
assertNotNull(m);
m.acknowledge();
assertEquals(m.getBody().readString(), "m6");
- m = consumer.receive(250);
+ m = consumer.receiveImmediate();
assertNull(m);
}
Modified: trunk/tests/src/org/hornetq/tests/integration/server/PredefinedQueueTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/server/PredefinedQueueTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/integration/server/PredefinedQueueTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -190,8 +190,8 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
- assertNull(consumer2.receive(200));
+ assertNull(consumer1.receiveImmediate());
+ assertNull(consumer2.receiveImmediate());
session.close();
@@ -293,9 +293,9 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
- assertNull(consumer2.receive(200));
- assertNull(consumer3.receive(200));
+ assertNull(consumer1.receiveImmediate());
+ assertNull(consumer2.receiveImmediate());
+ assertNull(consumer3.receiveImmediate());
session.close();
@@ -370,7 +370,7 @@
ClientConsumer consumer2 = session.createConsumer(queueName2);
- ClientMessage message = consumer1.receive(200);
+ ClientMessage message = consumer1.receiveImmediate();
assertNull(message);
@@ -382,8 +382,8 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
- assertNull(consumer2.receive(200));
+ assertNull(consumer1.receiveImmediate());
+ assertNull(consumer2.receiveImmediate());
session.close();
@@ -450,7 +450,7 @@
message.acknowledge();
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
for (int i = 0; i < numMessages; i++)
{
@@ -463,7 +463,7 @@
producer.send(message);
}
- assertNull(consumer1.receive(200));
+ assertNull(consumer1.receiveImmediate());
session.close();
Modified: trunk/tests/src/org/hornetq/tests/integration/xa/BasicXaRecoveryTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/xa/BasicXaRecoveryTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++ trunk/tests/src/org/hornetq/tests/integration/xa/BasicXaRecoveryTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -380,7 +380,7 @@
ClientConsumer pageConsumer = clientSession.createConsumer(pageQueue);
- assertNull(pageConsumer.receive(100));
+ assertNull(pageConsumer.receiveImmediate());
long globalSize = this.server.getPostOffice().getPagingManager().getTotalMemory();
// Management message (from createQueue) will not be taken into account again as it
is nonPersistent
@@ -560,8 +560,7 @@
assertEquals(xids.length, 0);
clientSession.rollback(xid);
clientSession.start();
- ClientMessage m = clientConsumer.receive(100);
- log.info("m is " + m);
+ ClientMessage m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -746,7 +745,7 @@
clientSession.rollback(xid);
clientSession.rollback(xid2);
clientSession.start();
- ClientMessage m = clientConsumer.receive(100);
+ ClientMessage m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -810,7 +809,7 @@
m = clientConsumer.receive(1000);
assertNotNull(m);
assertEquals(m.getBody().readString(), "m4");
- m = clientConsumer.receive(100);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -941,7 +940,7 @@
assertEquals(xids.length, 0);
clientSession.commit(xid, true);
clientSession.start();
- m = clientConsumer.receive(100);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -1103,7 +1102,7 @@
assertEquals(xids.length, 0);
clientSession.commit(xid, true);
clientSession.start();
- m = clientConsumer.receive(100);
+ m = clientConsumer.receiveImmediate();
assertNull(m);
}
Modified: trunk/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++ trunk/tests/src/org/hornetq/tests/integration/xa/XaTimeoutTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -153,7 +153,7 @@
assertTrue(e.errorCode == XAException.XAER_NOTA);
}
clientSession.start();
- ClientMessage m = clientConsumer.receive(500);
+ ClientMessage m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -302,7 +302,7 @@
m.acknowledge();
assertNotNull(m);
assertEquals(m.getBody().readString(), "m4");
- m = consumer.receive(500);
+ m = consumer.receiveImmediate();
assertNull(m);
clientSession2.close();
}
@@ -377,7 +377,7 @@
m.acknowledge();
assertNotNull(m);
assertEquals(m.getBody().readString(), "m8");
- m = consumer.receive(500);
+ m = consumer.receiveImmediate();
assertNull(m);
clientSession2.close();
}
@@ -410,7 +410,7 @@
assertTrue(e.errorCode == XAException.XAER_NOTA);
}
clientSession.start();
- ClientMessage m = clientConsumer.receive(500);
+ ClientMessage m = clientConsumer.receiveImmediate();
assertNull(m);
}
@@ -513,7 +513,7 @@
session.close();
}
clientSession.start();
- ClientMessage m = clientConsumer.receive(500);
+ ClientMessage m = clientConsumer.receiveImmediate();
assertNull(m);
}
Modified: trunk/tests/src/org/hornetq/tests/stress/journal/LargeJournalStressTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/stress/journal/LargeJournalStressTest.java 2009-11-09
15:26:12 UTC (rev 8253)
+++
trunk/tests/src/org/hornetq/tests/stress/journal/LargeJournalStressTest.java 2009-11-09
21:20:59 UTC (rev 8254)
@@ -241,7 +241,7 @@
cons = sess.createConsumer(Q2);
- assertNull(cons.receive(100));
+ assertNull(cons.receiveImmediate());
sess.close();