summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/ClientSessionTest.cpp
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2009-03-25 23:44:30 +0000
committerStephen D. Huston <shuston@apache.org>2009-03-25 23:44:30 +0000
commit67d330f235362bf622b95f8c4d14321272a44ba7 (patch)
tree82153e6fd6c1c77e9defc80cb2e6b34d23de25cf /qpid/cpp/src/tests/ClientSessionTest.cpp
parentb51fd45a4ed81bee144c22c2a57fc0e882d44149 (diff)
downloadqpid-python-67d330f235362bf622b95f8c4d14321272a44ba7.tar.gz
Merge from trunk tag to-cmake-25mar09 (r758432)
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/cmake@758465 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/ClientSessionTest.cpp')
-rw-r--r--qpid/cpp/src/tests/ClientSessionTest.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/qpid/cpp/src/tests/ClientSessionTest.cpp b/qpid/cpp/src/tests/ClientSessionTest.cpp
index 1658f3d4ec..589e1154e1 100644
--- a/qpid/cpp/src/tests/ClientSessionTest.cpp
+++ b/qpid/cpp/src/tests/ClientSessionTest.cpp
@@ -428,8 +428,8 @@ QPID_AUTO_TEST_CASE(testConcurrentSenders)
for (size_t i = 0; i < 5; i++) {
publishers.push_back(new Publisher(connection, message, 100));
}
- for_each(publishers.begin(), publishers.end(), boost::bind(&Publisher::start, _1));
- for_each(publishers.begin(), publishers.end(), boost::bind(&Publisher::join, _1));
+ std::for_each(publishers.begin(), publishers.end(), boost::bind(&Publisher::start, _1));
+ std::for_each(publishers.begin(), publishers.end(), boost::bind(&Publisher::join, _1));
connection.close();
}
@@ -564,6 +564,24 @@ QPID_AUTO_TEST_CASE(testSessionManagerSetFlowControl) {
BOOST_CHECK_EQUAL("my-message", got.getData());
}
+QPID_AUTO_TEST_CASE(testGetThenSubscribe) {
+ ClientSessionFixture fix;
+ std::string name("myqueue");
+ fix.session.queueDeclare(arg::queue=name, arg::exclusive=true, arg::autoDelete=true);
+ fix.session.messageTransfer(arg::content=Message("one", name));
+ fix.session.messageTransfer(arg::content=Message("two", name));
+ Message got;
+ BOOST_CHECK(fix.subs.get(got, name));
+ BOOST_CHECK_EQUAL("one", got.getData());
+
+ DummyListener listener(fix.session, name, 1);
+ listener.run();
+ BOOST_CHECK_EQUAL(1u, listener.messages.size());
+ if (!listener.messages.empty()) {
+ BOOST_CHECK_EQUAL("two", listener.messages[0].getData());
+ }
+}
+
QPID_AUTO_TEST_SUITE_END()