From 2a669d697451b965e70f562ed8b66cd1eee38446 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 26 Jun 2008 12:25:58 +0000 Subject: 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@671877 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/tests/ClientSessionTest.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'qpid/cpp/src/tests/ClientSessionTest.cpp') diff --git a/qpid/cpp/src/tests/ClientSessionTest.cpp b/qpid/cpp/src/tests/ClientSessionTest.cpp index 0475350d6a..505f3248a4 100644 --- a/qpid/cpp/src/tests/ClientSessionTest.cpp +++ b/qpid/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() -- cgit v1.2.1