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 2014/12/10 21:59:55 UTC
qpid-jms git commit: Add another test that checks broker stats for
zero prefetch to see if pulling one message works without causing more to go
dispatched.
Repository: qpid-jms
Updated Branches:
refs/heads/master 85f926628 -> e62deaacf
Add another test that checks broker stats for zero prefetch to see if
pulling one message works without causing more to go dispatched.
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/e62deaac
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/e62deaac
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/e62deaac
Branch: refs/heads/master
Commit: e62deaacfb193cd34f2081d164ce72eb7ca9958b
Parents: 85f9266
Author: Timothy Bish <ta...@gmail.com>
Authored: Wed Dec 10 15:59:49 2014 -0500
Committer: Timothy Bish <ta...@gmail.com>
Committed: Wed Dec 10 15:59:49 2014 -0500
----------------------------------------------------------------------
.../qpid/jms/consumer/JmsClientAckTest.java | 1 +
.../qpid/jms/consumer/JmsZeroPrefetchTest.java | 42 ++++++++++++++++++++
2 files changed, 43 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/e62deaac/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsClientAckTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsClientAckTest.java b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsClientAckTest.java
index 699f9ea..57c3ae0 100644
--- a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsClientAckTest.java
+++ b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsClientAckTest.java
@@ -360,6 +360,7 @@ public class JmsClientAckTest extends AmqpTestSupport {
assertTrue("we got 6 redeliveries", redelivery.await(20, TimeUnit.SECONDS));
}
+ // TODO - Enable once broker prefetch is fully worked out.
@Ignore("Fails until Broker get it's prefetch issues resolved.")
@Test(timeout=60000)
public void testConsumeBeyondInitialPrefetch() throws Exception {
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/e62deaac/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsZeroPrefetchTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsZeroPrefetchTest.java b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsZeroPrefetchTest.java
index eef250b..e06336d 100644
--- a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsZeroPrefetchTest.java
+++ b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/consumer/JmsZeroPrefetchTest.java
@@ -19,6 +19,7 @@ package org.apache.qpid.jms.consumer;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import javax.jms.JMSException;
import javax.jms.Message;
@@ -29,8 +30,10 @@ import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
+import org.apache.activemq.broker.jmx.QueueViewMBean;
import org.apache.qpid.jms.JmsConnection;
import org.apache.qpid.jms.support.AmqpTestSupport;
+import org.apache.qpid.jms.support.Wait;
import org.junit.Ignore;
import org.junit.Test;
@@ -80,6 +83,45 @@ public class JmsZeroPrefetchTest extends AmqpTestSupport {
assertNull("Should have not received a message!", answer);
}
+ // TODO - Enable once broker side credit handling is fixed
+ @Ignore // ActiveMQ doesn't honor link credit.
+ @Test(timeout = 60000)
+ public void testPullConsumerOnlyRequestsOneMessage() throws Exception {
+ connection = createAmqpConnection();
+ ((JmsConnection)connection).getPrefetchPolicy().setAll(0);
+ connection.start();
+
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Queue queue = session.createQueue(name.getMethodName());
+ MessageProducer producer = session.createProducer(queue);
+ producer.send(session.createTextMessage("Hello World! 1"));
+ producer.send(session.createTextMessage("Hello World! 2"));
+
+ final QueueViewMBean queueView = getProxyToQueue(name.getMethodName());
+
+ // Check initial Queue State
+ assertEquals(2, queueView.getQueueSize());
+ assertEquals(0, queueView.getInFlightCount());
+
+ // now lets receive it
+ MessageConsumer consumer = session.createConsumer(queue);
+ Message answer = consumer.receive(5000);
+ assertNotNull("Should have received a message!", answer);
+
+ // Assert that we only pulled one message and that we didn't cause
+ // the other message to be dispatched.
+ assertTrue(Wait.waitFor(new Wait.Condition() {
+
+ @Override
+ public boolean isSatisified() throws Exception {
+ return queueView.getQueueSize() == 1;
+ }
+ }));
+
+ assertEquals(0, queueView.getInFlightCount());
+ }
+
+ // TODO - Enable once broker side credit handling is fixed
@Ignore // ActiveMQ doesn't honor link credit.
@Test(timeout = 60000)
public void testTwoConsumers() throws Exception {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org