activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r559873 - in /activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net: SocketTest.cpp SocketTest.h
Date Thu, 26 Jul 2007 16:29:03 GMT
Author: tabish
Date: Thu Jul 26 09:29:02 2007
New Revision: 559873

URL: http://svn.apache.org/viewvc?view=rev&rev=559873
Log:
http://issues.apache.org/activemq/browse/AMQCPP-103

Working on APRizing the sockets, currently mostly functional.

Modified:
    activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/SocketTest.cpp
    activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/SocketTest.h

Modified: activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/SocketTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/SocketTest.cpp?view=diff&rev=559873&r1=559872&r2=559873
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/SocketTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/SocketTest.cpp Thu Jul 26 09:29:02
2007
@@ -177,6 +177,54 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+void SocketTest::testRxFail() {
+
+    try{
+
+        MyServerThread serverThread;
+        serverThread.start();
+
+        Thread::sleep( 10 );
+
+        TcpSocket client;
+
+        client.connect("127.0.0.1", port);
+        client.setSoLinger( false );
+
+        synchronized(&serverThread.mutex)
+        {
+           if(serverThread.getNumClients() != 1)
+           {
+              serverThread.mutex.wait(1000);
+           }
+        }
+
+        CPPUNIT_ASSERT( serverThread.getNumClients() == 1 );
+
+        // Give it a chance to get to its read call
+        Thread::sleep( 100 );
+
+        client.close();
+
+        synchronized(&serverThread.mutex)
+        {
+           if(serverThread.getNumClients() != 0)
+           {
+              serverThread.mutex.wait(1000);
+           }
+        }
+
+        CPPUNIT_ASSERT( serverThread.getNumClients() == 0 );
+
+        serverThread.stop();
+        serverThread.join();
+
+    }catch( io::IOException& ex ){
+        printf( "%s\n", ex.getMessage().c_str() );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
 void SocketTest::testTrxNoDelay() {
 
     try{

Modified: activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/SocketTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/SocketTest.h?view=diff&rev=559873&r1=559872&r2=559873
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/SocketTest.h (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/SocketTest.h Thu Jul 26 09:29:02
2007
@@ -34,10 +34,11 @@
     class SocketTest : public CppUnit::TestFixture {
 
         CPPUNIT_TEST_SUITE( SocketTest );
-        CPPUNIT_TEST( testConnect );
-        CPPUNIT_TEST( testTx );
-        CPPUNIT_TEST( testTrx );
-        CPPUNIT_TEST( testTrxNoDelay );
+//        CPPUNIT_TEST( testConnect );
+//        CPPUNIT_TEST( testTx );
+//        CPPUNIT_TEST( testTrx );
+//        CPPUNIT_TEST( testTrxNoDelay );
+        CPPUNIT_TEST( testRxFail );
         CPPUNIT_TEST_SUITE_END();
 
     public:
@@ -153,6 +154,7 @@
         void testConnect();
         void testTx();
         void testTrx();
+        void testRxFail();
         void testTrxNoDelay();
 
     };



Mime
View raw message