diff options
author | Alan Conway <aconway@apache.org> | 2007-08-27 20:39:35 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-08-27 20:39:35 +0000 |
commit | d52cb3fdccb2c18fa91c8331b4a09e4ea032ff1c (patch) | |
tree | fd21a8d5693446309ecaac3d73d2d3f7a01af284 /cpp/src/tests | |
parent | 7959f701c9420511009d3124a6d86fd8c652b439 (diff) | |
download | qpid-python-d52cb3fdccb2c18fa91c8331b4a09e4ea032ff1c.tar.gz |
* src/qpid/framing/FrameDefaultVisitor.h:
A visitor for all concrete frame body types.
* src/qpid/broker/SessionState.h: 3 states - closed, active, suspended.
* src/qpid/broker/SessionAdapter.h, .cpp: Session handler, implements
session class commands. In progres..
* rubygen/templates/MethodBodyDefaultVisitor.rb:
A visitor for all method body types.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@570236 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rw-r--r-- | cpp/src/tests/Session.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cpp/src/tests/Session.cpp b/cpp/src/tests/Session.cpp index 445f612111..e33ec6e50c 100644 --- a/cpp/src/tests/Session.cpp +++ b/cpp/src/tests/Session.cpp @@ -29,24 +29,28 @@ using namespace qpid::sys; BOOST_AUTO_TEST_CASE(testSuspendedSessions) { SuspendedSessions suspended; - SessionState s(0); // 0 timeout - BOOST_CHECK(s.isActive()); + SessionState s; + BOOST_CHECK_EQUAL(s.getState(), SessionState::CLOSED); + s.open(0); + BOOST_CHECK_EQUAL(s.getState(), SessionState::ACTIVE); + BOOST_CHECK(!s.getId().empty()); suspended.suspend(s); - BOOST_CHECK(!s.isActive()); + BOOST_CHECK(s.getState() == SessionState::CLOSED); try { s = suspended.resume(s.getId()); BOOST_FAIL("Expected session to be timed out."); } catch (...) {} - s = SessionState(1); // New session, 1 sec timeout. + s.close(); + s.open(1); // New session, 1 sec timeout. try { suspended.resume(s.getId()); BOOST_FAIL("Expeced exception: non-existent session."); } catch (...) {} suspended.suspend(s); - BOOST_CHECK(!s.isActive()); + BOOST_CHECK(s.getState() == SessionState::SUSPENDED); s = suspended.resume(s.getId()); - BOOST_CHECK(s.isActive()); + BOOST_CHECK(s.getState() == SessionState::ACTIVE); suspended.suspend(s); // Real timeout sleep(2); |