summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/Session.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-09-24 21:15:46 +0000
committerAlan Conway <aconway@apache.org>2007-09-24 21:15:46 +0000
commit0bd4da2ecbf28c95b9c9263ea21f710bcae558ab (patch)
treea967c54542efe4dd9f0206ae52e346dd6e2e5536 /qpid/cpp/src/tests/Session.cpp
parent066554c281480c3ab989cc9b07180d71125aa86e (diff)
downloadqpid-python-0bd4da2ecbf28c95b9c9263ea21f710bcae558ab.tar.gz
2007-09-24 Alan Conway <aconway@redhat.com>
* cpp/src/qpid/broker/SessionManager.cpp: Manage suspended sessions. Replaces SuspendedSessions. * cpp/src/qpid/broker/SessionState.cpp: Work with SessionManager. * cpp/src/qpid/broker/SessionHandler.cpp: Owns SessionState. * cpp/src/qpid/broker/Connection.h, .cpp: Owns session handlers. * cpp/src/qpid/broker/Broker.h: Added SessionManager member. * cpp/src/Makefile.am: Added broker/SessionManager.cpp * amqp.0-10-preview.xml: Added session-busy and channel-busy constants. * cpp/src/tests/.valgrind.supp-default: Added suppresssions for F7. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@578975 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/Session.cpp')
-rw-r--r--qpid/cpp/src/tests/Session.cpp63
1 files changed, 0 insertions, 63 deletions
diff --git a/qpid/cpp/src/tests/Session.cpp b/qpid/cpp/src/tests/Session.cpp
deleted file mode 100644
index e33ec6e50c..0000000000
--- a/qpid/cpp/src/tests/Session.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "qpid/broker/SuspendedSessions.h"
-
-#define BOOST_AUTO_TEST_MAIN
-#include <boost/test/auto_unit_test.hpp>
-
-using namespace std;
-using namespace qpid::framing;
-using namespace qpid::broker;
-using namespace qpid::sys;
-
-BOOST_AUTO_TEST_CASE(testSuspendedSessions) {
- SuspendedSessions suspended;
-
- 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.getState() == SessionState::CLOSED);
- try {
- s = suspended.resume(s.getId());
- BOOST_FAIL("Expected session to be timed out.");
- } catch (...) {}
-
- 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.getState() == SessionState::SUSPENDED);
- s = suspended.resume(s.getId());
- BOOST_CHECK(s.getState() == SessionState::ACTIVE);
-
- suspended.suspend(s); // Real timeout
- sleep(2);
- try {
- suspended.resume(s.getId());
- BOOST_FAIL("Expeced timeout.");
- } catch (...) {}
-}
-
-