summaryrefslogtreecommitdiff
path: root/cpp/src/tests/ClientSessionTest.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-06-26 12:25:58 +0000
committerGordon Sim <gsim@apache.org>2008-06-26 12:25:58 +0000
commita6cddcf74022b7475202c49eb030b10b497a05b3 (patch)
tree8f7079ffa05263430b7f4a9b9be9cd976a7de2d7 /cpp/src/tests/ClientSessionTest.cpp
parent09d5c6124935cd46f0afbd6a916b4731836b45d8 (diff)
downloadqpid-python-a6cddcf74022b7475202c49eb030b10b497a05b3.tar.gz
QPID-1137: don't treat connection as opened if the open never succeeds
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@671877 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/ClientSessionTest.cpp')
-rw-r--r--cpp/src/tests/ClientSessionTest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/cpp/src/tests/ClientSessionTest.cpp b/cpp/src/tests/ClientSessionTest.cpp
index 0475350d6a..505f3248a4 100644
--- a/cpp/src/tests/ClientSessionTest.cpp
+++ b/cpp/src/tests/ClientSessionTest.cpp
@@ -246,6 +246,21 @@ QPID_AUTO_TEST_CASE(testGet) {
BOOST_CHECK_EQUAL("foo1", fix.subs.get("getq").getData());
}
+QPID_AUTO_TEST_CASE(testOpenFailure) {
+ BrokerFixture b;
+ Connection c;
+ string host("unknowable-host");
+ try {
+ c.open(host);
+ } catch (const Exception&) {
+ BOOST_CHECK(!c.isOpen());
+ }
+ b.open(c);
+ BOOST_CHECK(c.isOpen());
+ c.close();
+ BOOST_CHECK(!c.isOpen());
+}
+
QPID_AUTO_TEST_SUITE_END()