qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r959721 - in /qpid/trunk/qpid/cpp/src: qpid/client/amqp0_10/ConnectionImpl.cpp tests/MessagingSessionTests.cpp
Date Thu, 01 Jul 2010 16:49:22 GMT
Author: gsim
Date: Thu Jul  1 16:49:22 2010
New Revision: 959721

URL: http://svn.apache.org/viewvc?rev=959721&view=rev
Log:
QPID-664: Translate exceptions to correct type when occuring on creating new session.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp
    qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp?rev=959721&r1=959720&r2=959721&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp Thu Jul  1 16:49:22 2010
@@ -213,6 +213,10 @@ qpid::messaging::Session ConnectionImpl:
             break;
         } catch (const qpid::TransportFailure&) {
             open();
+        } catch (const qpid::SessionException& e) {
+            throw qpid::messaging::SessionError(e.what());
+        } catch (const std::exception& e) {
+            throw qpid::messaging::MessagingException(e.what());            
         }
     }
     return impl;

Modified: qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp?rev=959721&r1=959720&r2=959721&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp Thu Jul  1 16:49:22 2010
@@ -775,6 +775,14 @@ QPID_AUTO_TEST_CASE(testAuthenticatedUse
     BOOST_CHECK_EQUAL(fix.connection.getAuthenticatedUsername(), std::string("anonymous"));
 }
 
+QPID_AUTO_TEST_CASE(testExceptionOnClosedConnection)
+{
+    MessagingFixture fix;
+    fix.connection.close();
+    BOOST_CHECK_THROW(fix.connection.createSession(), MessagingException);
+    Connection connection("blah");
+    BOOST_CHECK_THROW(connection.createSession(), MessagingException);
+}
 
 QPID_AUTO_TEST_SUITE_END()
 



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message