summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/ClientSessionTest.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-12-10 17:57:49 +0000
committerAlan Conway <aconway@apache.org>2007-12-10 17:57:49 +0000
commitef19d923c46c43e937f1d4dd91c906bda08d64bd (patch)
treee4e8fa91f12edbebccb80f4916d1654fcbae2022 /qpid/cpp/src/tests/ClientSessionTest.cpp
parent92a003c58ae103c30024b588accfe2ef86de561d (diff)
downloadqpid-python-ef19d923c46c43e937f1d4dd91c906bda08d64bd.tar.gz
src/tests/SocketProxy.h: proxy between local client & server to simulate network disconnect.
src/qpid/client/Connector.h: remove friend hack for previous flawed disconnect approach. src/tests/BrokerFixture.h: "" src/tests/ClientSessionTest.cpp, exception_test.cpp: use ProxyConnection git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@602980 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/ClientSessionTest.cpp')
-rw-r--r--qpid/cpp/src/tests/ClientSessionTest.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/qpid/cpp/src/tests/ClientSessionTest.cpp b/qpid/cpp/src/tests/ClientSessionTest.cpp
index 70e8a41074..a960cea230 100644
--- a/qpid/cpp/src/tests/ClientSessionTest.cpp
+++ b/qpid/cpp/src/tests/ClientSessionTest.cpp
@@ -20,6 +20,7 @@
*/
#include "qpid_test_plugin.h"
#include "BrokerFixture.h"
+#include "SocketProxy.h"
#include "qpid/client/Dispatcher.h"
#include "qpid/client/Session_0_10.h"
#include "qpid/framing/TransferContent.h"
@@ -181,14 +182,15 @@ class ClientSessionTest : public CppUnit::TestCase, public BrokerFixture
}
void testDisconnectResume() {
- session =connection.newSession(60);
- session.queueDeclare(queue="before");
+ ProxyConnection c(broker->getPort());
+ Session_0_10 s = c.session;
+ s.queueDeclare(queue="before");
CPPUNIT_ASSERT(queueExists("before"));
- session.queueDeclare(queue=string("after"));
- disconnect(connection);
+ s.queueDeclare(queue=string("after"));
+ c.proxy.client.close(); // Disconnect the client.
Connection c2;
open(c2);
- c2.resume(session);
+ c2.resume(s);
CPPUNIT_ASSERT(queueExists("after"));
c2.close();
}