qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r964571 - in /qpid/trunk/qpid/cpp/src/tests: MessagingFixture.h MessagingSessionTests.cpp
Date Thu, 15 Jul 2010 20:33:16 GMT
Author: gsim
Date: Thu Jul 15 20:33:16 2010
New Revision: 964571

URL: http://svn.apache.org/viewvc?rev=964571&view=rev
Log:
QPID-2734: Tighter control over sasl related test; now passes when cyrus-sasl not in use.

Modified:
    qpid/trunk/qpid/cpp/src/tests/MessagingFixture.h
    qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp

Modified: qpid/trunk/qpid/cpp/src/tests/MessagingFixture.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/MessagingFixture.h?rev=964571&r1=964570&r2=964571&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/MessagingFixture.h (original)
+++ qpid/trunk/qpid/cpp/src/tests/MessagingFixture.h Thu Jul 15 20:33:16 2010
@@ -113,6 +113,14 @@ struct MessagingFixture : public BrokerF
         return connection;
     }
 
+    /** Open a connection to the broker. */
+    qpid::messaging::Connection newConnection()
+    {
+        qpid::messaging::Connection connection(
+            (boost::format("amqp:tcp:localhost:%1%") % (broker->getPort(qpid::broker::Broker::TCP_TRANSPORT))).str());
+        return connection;
+    }
+
     void ping(const qpid::messaging::Address& address)
     {
         messaging::Receiver r = session.createReceiver(address);

Modified: qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp?rev=964571&r1=964570&r2=964571&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp Thu Jul 15 20:33:16 2010
@@ -772,7 +772,12 @@ QPID_AUTO_TEST_CASE(testExclusiveSubscri
 QPID_AUTO_TEST_CASE(testAuthenticatedUsername)
 {
     MessagingFixture fix;
-    BOOST_CHECK_EQUAL(fix.connection.getAuthenticatedUsername(), std::string("anonymous"));
+    Connection connection = fix.newConnection();
+    connection.setOption("sasl-mechanism", "PLAIN");
+    connection.setOption("username", "test-user");
+    connection.setOption("password", "ignored");
+    connection.open();
+    BOOST_CHECK_EQUAL(connection.getAuthenticatedUsername(), std::string("test-user"));
 }
 
 QPID_AUTO_TEST_CASE(testExceptionOnClosedConnection)



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


Mime
View raw message