You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ta...@apache.org on 2015/01/26 17:46:16 UTC
qpid-jms git commit: Reduce test duration using some more sensible
default timeouts and reading broker stats instead of blind receive calls.
Repository: qpid-jms
Updated Branches:
refs/heads/master 26257d6bb -> f65bb22ae
Reduce test duration using some more sensible default timeouts and
reading broker stats instead of blind receive calls.
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/f65bb22a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/f65bb22a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/f65bb22a
Branch: refs/heads/master
Commit: f65bb22ae04b1e97a3688586b06ad9a22480c4e3
Parents: 26257d6
Author: Timothy Bish <ta...@gmail.com>
Authored: Mon Jan 26 11:45:44 2015 -0500
Committer: Timothy Bish <ta...@gmail.com>
Committed: Mon Jan 26 11:46:12 2015 -0500
----------------------------------------------------------------------
.../qpid/jms/consumer/JmsMessageConsumerTest.java | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/f65bb22a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsMessageConsumerTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsMessageConsumerTest.java b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsMessageConsumerTest.java
index f2786cc..240f684 100644
--- a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsMessageConsumerTest.java
+++ b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsMessageConsumerTest.java
@@ -197,7 +197,7 @@ public class JmsMessageConsumerTest extends AmqpTestSupport {
@Override
public void run() {
try {
- TimeUnit.SECONDS.sleep(10);
+ TimeUnit.SECONDS.sleep(5);
MessageProducer producer = session.createProducer(queue);
producer.send(session.createTextMessage("Hello"));
} catch (Exception e) {
@@ -345,13 +345,15 @@ public class JmsMessageConsumerTest extends AmqpTestSupport {
// After the first restart we should get all messages sent above
restartPrimaryBroker();
+ QueueViewMBean proxy = getProxyToQueue(name.getMethodName());
+ assertEquals(messagesSent, proxy.getQueueSize());
int messagesReceived = readAllMessages();
assertEquals(messagesSent, messagesReceived);
// This time there should be no messages on this queue
restartPrimaryBroker();
- messagesReceived = readAllMessages();
- assertEquals(0, messagesReceived);
+ proxy = getProxyToQueue(name.getMethodName());
+ assertEquals(0, proxy.getQueueSize());
}
@Test(timeout = 60000)
@@ -376,13 +378,15 @@ public class JmsMessageConsumerTest extends AmqpTestSupport {
// After the first restart we should get all messages sent above
restartPrimaryBroker();
+ QueueViewMBean proxy = getProxyToQueue(name.getMethodName());
+ assertEquals(messagesSent, proxy.getQueueSize());
int messagesReceived = readAllMessages();
assertEquals(messagesSent, messagesReceived);
// This time there should be no messages on this queue
restartPrimaryBroker();
- messagesReceived = readAllMessages();
- assertEquals(0, messagesReceived);
+ proxy = getProxyToQueue(name.getMethodName());
+ assertEquals(0, proxy.getQueueSize());
}
private int readAllMessages() throws Exception {
@@ -404,14 +408,14 @@ public class JmsMessageConsumerTest extends AmqpTestSupport {
consumer = session.createConsumer(queue, selector);
}
- Message msg = consumer.receive(5000);
+ Message msg = consumer.receive(2000);
while (msg != null) {
assertNotNull(msg);
assertTrue(msg instanceof TextMessage);
TextMessage textMessage = (TextMessage) msg;
LOG.debug(">>>> Received [{}]", textMessage.getText());
messagesReceived++;
- msg = consumer.receive(5000);
+ msg = consumer.receive(2000);
}
consumer.close();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org