diff options
author | Carl C. Trieloff <cctrieloff@apache.org> | 2007-08-17 14:51:24 +0000 |
---|---|---|
committer | Carl C. Trieloff <cctrieloff@apache.org> | 2007-08-17 14:51:24 +0000 |
commit | 3fc22899cf5a4c5a26daef65d720c3bb1de3884d (patch) | |
tree | 20bcc3a9ad51040e2823b5310d62b8f55ae95c2b /cpp/src/tests/QueueTest.cpp | |
parent | 3e009cb10063457115db198b8faea1b395365b89 (diff) | |
download | qpid-python-3fc22899cf5a4c5a26daef65d720c3bb1de3884d.tar.gz |
- corrected getMessageCount() for async messages
- added test for async message count.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@567059 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/QueueTest.cpp')
-rw-r--r-- | cpp/src/tests/QueueTest.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cpp/src/tests/QueueTest.cpp b/cpp/src/tests/QueueTest.cpp index 6b30f9ff42..e7ca124631 100644 --- a/cpp/src/tests/QueueTest.cpp +++ b/cpp/src/tests/QueueTest.cpp @@ -64,6 +64,7 @@ class QueueTest : public CppUnit::TestCase CPPUNIT_TEST(testDequeue); CPPUNIT_TEST(testBound); CPPUNIT_TEST(testAsyncMessage); + CPPUNIT_TEST(testAsyncMessageCount); CPPUNIT_TEST_SUITE_END(); @@ -97,6 +98,21 @@ class QueueTest : public CppUnit::TestCase } + + void testAsyncMessageCount(){ + Queue::shared_ptr queue(new Queue("my_test_queue", true)); + Message::shared_ptr msg1 = message("e", "A"); + + queue->process(msg1); + sleep(2); + uint32_t compval=0; + CPPUNIT_ASSERT_EQUAL(compval, queue->getMessageCount()); + msg1->enqueueComplete(); + compval=1; + CPPUNIT_ASSERT_EQUAL(compval, queue->getMessageCount()); + + } + void testConsumers(){ Queue::shared_ptr queue(new Queue("my_queue", true)); |