summaryrefslogtreecommitdiff
path: root/java/systests
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2011-10-18 11:20:53 +0000
committerKeith Wall <kwall@apache.org>2011-10-18 11:20:53 +0000
commit5a5e04545e7e45977efaf077da21b64f870caf04 (patch)
tree86c6788bc7f1db19fb4191eafe5aa4398a449b04 /java/systests
parentb7bc31df25274935c2c00f9afcc1aad37bd93354 (diff)
downloadqpid-python-5a5e04545e7e45977efaf077da21b64f870caf04.tar.gz
QPID-3542: ensure session complete sent for filtered out messages
Applied patch from Andrew MacBean <andymacbean@gmail.com> and myself. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1185580 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests')
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java b/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
index a7a06a357a..826545a23d 100644
--- a/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
@@ -33,6 +33,7 @@ import javax.jms.TopicSession;
import javax.jms.TopicSubscriber;
import org.apache.qpid.client.AMQConnection;
+import org.apache.qpid.client.AMQQueue;
import org.apache.qpid.client.AMQSession;
import org.apache.qpid.client.AMQTopic;
import org.apache.qpid.test.utils.QpidBrokerTestCase;
@@ -320,6 +321,7 @@ public class TopicSessionTest extends QpidBrokerTestCase
final Connection con1 = getConnection();
final Session session1 = con1.createSession(false, Session.AUTO_ACKNOWLEDGE);
final Topic topic1 = session1.createTopic(topicName);
+ final AMQQueue internalNameOnBroker = new AMQQueue("amq.topic", "clientid" + ":" + clientId);
// Setup subscriber with selector
final TopicSubscriber subscriberWithSelector = session1.createDurableSubscriber(topic1, clientId, "Selector = 'select'", false);
@@ -339,13 +341,9 @@ public class TopicSessionTest extends QpidBrokerTestCase
session1.close();
- // Now recreate the session and subscriber (same clientid) but without selector and check that the message still
- // is not received. This defect meant that such a message would be received.
+ // Now verify queue depth on broker.
final Session session2 = con1.createSession(false, Session.AUTO_ACKNOWLEDGE);
- final Topic topic2 = session2.createTopic(topicName);
-
- final TopicSubscriber sameSubscriberWithoutSelector = session2.createDurableSubscriber(topic2, clientId, null, false);
- final Message message2 = sameSubscriberWithoutSelector.receive(1000);
- assertNull("still should not have received message", message2);
+ final long depth = ((AMQSession) session2).getQueueDepth(internalNameOnBroker);
+ assertEquals("Expected queue depth of zero", 0, depth);
}
}