summaryrefslogtreecommitdiff
path: root/cpp/src/tests/MessagingSessionTests.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-11-17 17:35:28 +0000
committerGordon Sim <gsim@apache.org>2009-11-17 17:35:28 +0000
commit74c1740d54360bb4b091b5486c69f0f945d27abd (patch)
tree4eded291096792a62ce1f6546ea01c6e1959f3c8 /cpp/src/tests/MessagingSessionTests.cpp
parent99c896bf60506c66f339d2ce51d4dca2725968af (diff)
downloadqpid-python-74c1740d54360bb4b091b5486c69f0f945d27abd.tar.gz
QPID-664: Add accessors for connection from session, and for session from sender/receiver.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@881395 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/MessagingSessionTests.cpp')
-rw-r--r--cpp/src/tests/MessagingSessionTests.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/cpp/src/tests/MessagingSessionTests.cpp b/cpp/src/tests/MessagingSessionTests.cpp
index 082c639636..09440cc183 100644
--- a/cpp/src/tests/MessagingSessionTests.cpp
+++ b/cpp/src/tests/MessagingSessionTests.cpp
@@ -718,7 +718,7 @@ QPID_AUTO_TEST_CASE(testGetReceiver)
BOOST_CHECK_THROW(fix.session.getReceiver("UnknownReceiver"), qpid::messaging::KeyError);
}
-QPID_AUTO_TEST_CASE(testGetSession)
+QPID_AUTO_TEST_CASE(testGetSessionFromConnection)
{
QueueFixture fix;
fix.connection.newSession("my-session");
@@ -731,6 +731,19 @@ QPID_AUTO_TEST_CASE(testGetSession)
BOOST_CHECK_THROW(fix.connection.getSession("UnknownSession"), qpid::messaging::KeyError);
}
+QPID_AUTO_TEST_CASE(testGetConnectionFromSession)
+{
+ QueueFixture fix;
+ Message out(Uuid(true).str());
+ Sender sender = fix.session.createSender(fix.queue);
+ sender.send(out);
+ Message in;
+ sender.getSession().getConnection().newSession("incoming");
+ BOOST_CHECK(fix.connection.getSession("incoming").createReceiver(fix.queue).fetch(in));
+ BOOST_CHECK_EQUAL(out.getContent(), in.getContent());
+}
+
+
QPID_AUTO_TEST_SUITE_END()
}} // namespace qpid::tests