You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ro...@apache.org on 2008/04/11 21:35:49 UTC

svn commit: r647276 - /webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/AddNumbersHandlerTests.java

Author: rott
Date: Fri Apr 11 12:35:48 2008
New Revision: 647276

URL: http://svn.apache.org/viewvc?rev=647276&view=rev
Log:
one-way invocations use their own thread, so the client cannot tell when it's done and may read the log too soon

Modified:
    webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/AddNumbersHandlerTests.java

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/AddNumbersHandlerTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/AddNumbersHandlerTests.java?rev=647276&r1=647275&r2=647276&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/AddNumbersHandlerTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/AddNumbersHandlerTests.java Fri Apr 11 12:35:48 2008
@@ -296,7 +296,6 @@
         }
     }
 
-    // TODO: disabled until handler support is more complete
     public void testAddNumbersHandlerWithFault() {
         try{
             TestLogger.logger.debug("----------------------------------");
@@ -694,6 +693,13 @@
                     axisEndpoint);
             proxy.oneWayInt(11);
             
+            // one-way invocations run in their own thread,
+            // and we can't tell here in the client when it
+            // has completed.  So, we need to wait long enough
+            // for the invocation to complete, so our log file
+            // is fully populated.
+            Thread.sleep(1000 * 5); // 5 seconds
+            
             String log = readLogFile();
             String expected_calls = "AddNumbersLogicalHandler2 POST_CONSTRUCT\n"
                 + "AddNumbersProtocolHandler2 GET_HEADERS\n"
@@ -744,6 +750,17 @@
             e.printStackTrace();
             assertEquals(e.getMessage(), "I don't like the value 99");
             
+            // one-way invocations run in their own thread,
+            // and we can't tell here in the client when it
+            // has completed.  So, we need to wait long enough
+            // for the invocation to complete, so our log file
+            // is fully populated.
+            try {
+                Thread.sleep(1000 * 5); // 5 seconds
+            } catch (InterruptedException ie) {
+                // nothing
+            }
+            
             String log = readLogFile();
             String expected_calls = "AddNumbersClientLogicalHandler HANDLE_MESSAGE_OUTBOUND\n"
                 + "AddNumbersClientLogicalHandler CLOSE\n";
@@ -781,6 +798,17 @@
         } catch (Exception e) {
             e.printStackTrace();
             assertEquals(e.getMessage(), "I don't like the value 999");
+            
+            // one-way invocations run in their own thread,
+            // and we can't tell here in the client when it
+            // has completed.  So, we need to wait long enough
+            // for the invocation to complete, so our log file
+            // is fully populated.
+            try {
+                Thread.sleep(1000 * 5); // 5 seconds
+            } catch (InterruptedException ie) {
+                // nothing
+            }
             
             String log = readLogFile();
             String expected_calls = "AddNumbersClientLogicalHandler HANDLE_MESSAGE_OUTBOUND\n"



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org