summaryrefslogtreecommitdiff
path: root/cpp/src/tests/QueueTest.cpp
diff options
context:
space:
mode:
authorCarl C. Trieloff <cctrieloff@apache.org>2007-08-15 19:16:46 +0000
committerCarl C. Trieloff <cctrieloff@apache.org>2007-08-15 19:16:46 +0000
commitcbd5daf4330123a335374be6724309103fc2b41d (patch)
tree06f6c74395db56fea993433423d2720dca593f07 /cpp/src/tests/QueueTest.cpp
parent7c966bd1fcb801e14e001237096470b9c7e87f1f (diff)
downloadqpid-python-cbd5daf4330123a335374be6724309103fc2b41d.tar.gz
- async message fix in dequeue
- addition of test for async enqueue of messages on BrokerQueue git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@566306 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/QueueTest.cpp')
-rw-r--r--cpp/src/tests/QueueTest.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/cpp/src/tests/QueueTest.cpp b/cpp/src/tests/QueueTest.cpp
index fad2702f38..6b30f9ff42 100644
--- a/cpp/src/tests/QueueTest.cpp
+++ b/cpp/src/tests/QueueTest.cpp
@@ -63,6 +63,7 @@ class QueueTest : public CppUnit::TestCase
CPPUNIT_TEST(testRegistry);
CPPUNIT_TEST(testDequeue);
CPPUNIT_TEST(testBound);
+ CPPUNIT_TEST(testAsyncMessage);
CPPUNIT_TEST_SUITE_END();
@@ -72,6 +73,30 @@ class QueueTest : public CppUnit::TestCase
new BasicMessage(0, exchange, routingKey, false, false));
}
+
+ void testAsyncMessage(){
+
+ Queue::shared_ptr queue(new Queue("my_test_queue", true));
+ Message::shared_ptr received;
+
+ TestConsumer c1;
+ queue->consume(&c1);
+
+
+ //Test basic delivery:
+ Message::shared_ptr msg1 = message("e", "A");
+ queue->process(msg1);
+ sleep(2);
+
+ CPPUNIT_ASSERT(!c1.received);
+ msg1->enqueueComplete();
+
+ received = queue->dequeue();
+ CPPUNIT_ASSERT_EQUAL(msg1.get(), received.get());
+
+
+ }
+
void testConsumers(){
Queue::shared_ptr queue(new Queue("my_queue", true));