diff options
author | Alan Conway <aconway@apache.org> | 2008-02-05 20:44:14 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-02-05 20:44:14 +0000 |
commit | 32f04433aebc19c9dcc89f3f5a3cf313b8100672 (patch) | |
tree | 1dea4ef59b49fa226bc6f638df407de20928a989 /cpp/src/tests/ClientSessionTest.cpp | |
parent | 89bfec4dc6c5ef0b23dc89744e22caa16a4216e3 (diff) | |
download | qpid-python-32f04433aebc19c9dcc89f3f5a3cf313b8100672.tar.gz |
Added testSendToSelf for https://bugzilla.redhat.com/show_bug.cgi?id=410551
M src/tests/ClientSessionTest.cpp
Disabled management for BrokerFixture - management singleton assumes
only one broker per process, causes shutdown races with fixtures.
M src/tests/BrokerFixture.h
Made Timer::stop() idempotent
M src/qpid/broker/Timer.cpp
M src/qpid/broker/Timer.h
Added STL-style size() and empty()
M src/qpid/sys/BlockingQueue.h
M src/qpid/client/LocalQueue.cpp
M src/qpid/client/LocalQueue.h
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@618770 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/ClientSessionTest.cpp')
-rw-r--r-- | cpp/src/tests/ClientSessionTest.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cpp/src/tests/ClientSessionTest.cpp b/cpp/src/tests/ClientSessionTest.cpp index f9de3b7619..60cfe04510 100644 --- a/cpp/src/tests/ClientSessionTest.cpp +++ b/cpp/src/tests/ClientSessionTest.cpp @@ -167,5 +167,22 @@ BOOST_FIXTURE_TEST_CASE(testSuspendResume, ClientSessionFixture) BOOST_CHECK_EQUAL(string("my-message"), msg->getContent()); } +BOOST_FIXTURE_TEST_CASE(testSendToSelf, SessionFixture) { + // https://bugzilla.redhat.com/show_bug.cgi?id=410551 + // Deadlock if SubscriptionManager run() concurrent with session ack. + LocalQueue myq; + session.queueDeclare(queue="myq", exclusive=true, autoDelete=true); + subs.subscribe(myq, "myq"); + string data("msg"); + Message msg(data, "myq"); + const int count=100; // Verified with count=100000 in a loop. + for (int i = 0; i < count; ++i) + session.messageTransfer(content=msg); + for (int j = 0; j < count; ++j) { + Message m=myq.pop(); + BOOST_CHECK_EQUAL(m.getData(), data); + } +} + QPID_AUTO_TEST_SUITE_END() |