summaryrefslogtreecommitdiff
path: root/cpp/src/tests/ExchangeTest.cpp
diff options
context:
space:
mode:
authorCarl C. Trieloff <cctrieloff@apache.org>2008-10-17 01:27:45 +0000
committerCarl C. Trieloff <cctrieloff@apache.org>2008-10-17 01:27:45 +0000
commit5644e4fbfd777921b33874aed13c45d544c8a383 (patch)
tree7f9f1527a43f46ff92a43088ac13d0faf6224719 /cpp/src/tests/ExchangeTest.cpp
parentbf54dc92bf7d46862cbef3113314b7b16797d92e (diff)
downloadqpid-python-5644e4fbfd777921b33874aed13c45d544c8a383.tar.gz
Feature requested by AndrewM for M4...
- provide initial value support, for late joining consumers git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@705443 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/ExchangeTest.cpp')
-rw-r--r--cpp/src/tests/ExchangeTest.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/cpp/src/tests/ExchangeTest.cpp b/cpp/src/tests/ExchangeTest.cpp
index 711fede950..c2f6078b33 100644
--- a/cpp/src/tests/ExchangeTest.cpp
+++ b/cpp/src/tests/ExchangeTest.cpp
@@ -223,4 +223,45 @@ QPID_AUTO_TEST_CASE(testSequenceOptions)
}
+QPID_AUTO_TEST_CASE(testIVEOption)
+{
+ FieldTable args;
+ args.setInt("qpid.ive",1);
+ DirectExchange direct("direct1", false, args);
+ FanOutExchange fanout("fanout1", false, args);
+ HeadersExchange header("headers1", false, args);
+ TopicExchange topic ("topic1", false, args);
+
+ intrusive_ptr<Message> msg1 = cmessage("direct1", "abc");
+ msg1->getProperties<MessageProperties>()->getApplicationHeaders().setString("a", "abc");
+ DeliverableMessage dmsg1(msg1);
+
+ FieldTable args2;
+ args2.setString("x-match", "any");
+ args2.setString("a", "abc");
+
+ direct.route(dmsg1, "abc", 0);
+ fanout.route(dmsg1, "abc", 0);
+ header.route(dmsg1, "abc", &args2);
+ topic.route(dmsg1, "abc", 0);
+ Queue::shared_ptr queue(new Queue("queue", true));
+ Queue::shared_ptr queue1(new Queue("queue1", true));
+ Queue::shared_ptr queue2(new Queue("queue2", true));
+ Queue::shared_ptr queue3(new Queue("queue3", true));
+
+ BOOST_CHECK(HeadersExchange::match(args2, msg1->getProperties<MessageProperties>()->getApplicationHeaders()));
+
+ BOOST_CHECK(direct.bind(queue, "abc", 0));
+ BOOST_CHECK(fanout.bind(queue1, "abc", 0));
+ BOOST_CHECK(header.bind(queue2, "", &args2));
+ BOOST_CHECK(topic.bind(queue3, "abc", 0));
+
+ BOOST_CHECK_EQUAL(1u,queue->getMessageCount());
+ BOOST_CHECK_EQUAL(1u,queue1->getMessageCount());
+ BOOST_CHECK_EQUAL(1u,queue2->getMessageCount());
+ BOOST_CHECK_EQUAL(1u,queue3->getMessageCount());
+
+}
+
+
QPID_AUTO_TEST_SUITE_END()