summaryrefslogtreecommitdiff
path: root/cpp/src/tests/ClientSessionTest.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-09-28 16:21:34 +0000
committerAlan Conway <aconway@apache.org>2007-09-28 16:21:34 +0000
commit8b82aef0397d65de0c7278476e4f409fcc636306 (patch)
treea25d9bbb01203335bc1450a5e5ed0c29074913ae /cpp/src/tests/ClientSessionTest.cpp
parentf689c47486b4cfc7655e37da2b232fe27be1cc42 (diff)
downloadqpid-python-8b82aef0397d65de0c7278476e4f409fcc636306.tar.gz
* src/tests/ClientSessionTest.cpp: Suspend/resume tests.
* broker/SessionManager.cpp, broker/SessionHandler.cpp: Implement suspend/resume * client/ScopedAssociation.h, SessionCore.h, SessionHandler.h: Simplified relationships. - Removed ScopedAssociation. - SessionHandler: is now a member of SessionCore. - SessionCore: shared_ptr ownership by Session(s) and ConnectionImpl. - Using framing::FrameHandler interfaces. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@580403 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/ClientSessionTest.cpp')
-rw-r--r--cpp/src/tests/ClientSessionTest.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/cpp/src/tests/ClientSessionTest.cpp b/cpp/src/tests/ClientSessionTest.cpp
index 1d59fbed33..2495a06fa4 100644
--- a/cpp/src/tests/ClientSessionTest.cpp
+++ b/cpp/src/tests/ClientSessionTest.cpp
@@ -60,6 +60,8 @@ class ClientSessionTest : public CppUnit::TestCase
CPPUNIT_TEST(testQueueQuery);
CPPUNIT_TEST(testTransfer);
CPPUNIT_TEST(testDispatcher);
+ CPPUNIT_TEST(testSuspendResume);
+ CPPUNIT_TEST(testSuspendResumeErrors);
CPPUNIT_TEST_SUITE_END();
boost::shared_ptr<Connector> broker;
@@ -139,6 +141,28 @@ public:
}
void testSuspendResume() {
+ session = connection.newSession(60);
+ session.suspend();
+ try {
+ session.exchangeQuery_(name="amq.fanout");
+ CPPUNIT_FAIL("Expected session suspended exception");
+ } catch(...) {}
+ connection.resume(session);
+ session.exchangeQuery_(name="amq.fanout");
+ // FIXME aconway 2007-09-25: build up session state and confirm
+ //it survives the resume
+ }
+
+ void testSuspendResumeErrors() {
+ session.suspend(); // session has 0 timeout.
+ try {
+ session.exchangeQuery_(name="amq.fanout");
+ CPPUNIT_FAIL("Expected suspended session exception");
+ } catch(...) {}
+ try {
+ connection.resume(session);
+ CPPUNIT_FAIL("Expected no such session exception.");
+ } catch(...) {}
}
};