summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
authorCarl C. Trieloff <cctrieloff@apache.org>2007-08-21 19:11:07 +0000
committerCarl C. Trieloff <cctrieloff@apache.org>2007-08-21 19:11:07 +0000
commit8540702068eda8d37c40992ce6d70e9ab4af3237 (patch)
treea07ec8276da7aa398a203281cb223eb648938f6c /cpp/src/tests
parent084598a88510352d4338329d1c412257a4c30f32 (diff)
downloadqpid-python-8540702068eda8d37c40992ce6d70e9ab4af3237.tar.gz
- header correction for buffer
- added tests for one msg to multiple queue in async mode - added counter for async multiple msg git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@568236 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rw-r--r--cpp/src/tests/BrokerChannelTest.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/cpp/src/tests/BrokerChannelTest.cpp b/cpp/src/tests/BrokerChannelTest.cpp
index 6c9b910637..3253a3d27a 100644
--- a/cpp/src/tests/BrokerChannelTest.cpp
+++ b/cpp/src/tests/BrokerChannelTest.cpp
@@ -75,6 +75,7 @@ class BrokerChannelTest : public CppUnit::TestCase
CPPUNIT_TEST(testStaging);
CPPUNIT_TEST(testQueuePolicy);
CPPUNIT_TEST(testFlow);
+ CPPUNIT_TEST(testAsyncMesgToMoreThanOneQueue);
CPPUNIT_TEST_SUITE_END();
shared_ptr<Broker> broker;
@@ -307,6 +308,38 @@ class BrokerChannelTest : public CppUnit::TestCase
store.check();
}
+
+ //NOTE: message or queue test,
+ //but as it can usefully use the same utility classes as this
+ //class it is defined here for simpllicity
+ void testAsyncMesgToMoreThanOneQueue()
+ {
+ MockMessageStore store;
+ {//must ensure that store is last thing deleted
+ const string data1("abcd");
+ Message::shared_ptr msg1(createMessage("e", "A", "MsgA", data1.size()));
+ addContent(msg1, data1);
+
+ Queue::shared_ptr queue1(new Queue("my_queue1", false, &store, 0));
+ Queue::shared_ptr queue2(new Queue("my_queue2", false, &store, 0));
+ Queue::shared_ptr queue3(new Queue("my_queue3", false, &store, 0));
+ queue1->deliver(msg1);
+ queue2->deliver(msg1);
+ queue3->deliver(msg1);
+ sleep(2);
+
+ Message::shared_ptr next = queue1->dequeue();
+ CPPUNIT_ASSERT_EQUAL(msg1, next);
+ next = queue2->dequeue();
+ CPPUNIT_ASSERT_EQUAL(msg1, next);
+ next = queue3->dequeue();
+ CPPUNIT_ASSERT_EQUAL(msg1, next);
+
+ }
+ }
+
+
+
void testFlow(){
Channel channel(connection, recorder, 7);
channel.open();