[jboss-remoting-commits] JBoss Remoting SVN: r4285 - remoting2/branches/2.2/src/tests/org/jboss/test/remoting/callback/asynch.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Tue Jun 10 21:16:26 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-06-10 21:16:26 -0400 (Tue, 10 Jun 2008)
New Revision: 4285

Modified:
   remoting2/branches/2.2/src/tests/org/jboss/test/remoting/callback/asynch/AsynchCallbackTestClientRoot.java
Log:
JBREM-995: Extended wait times.

Modified: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/callback/asynch/AsynchCallbackTestClientRoot.java
===================================================================
--- remoting2/branches/2.2/src/tests/org/jboss/test/remoting/callback/asynch/AsynchCallbackTestClientRoot.java	2008-06-10 05:48:55 UTC (rev 4284)
+++ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/callback/asynch/AsynchCallbackTestClientRoot.java	2008-06-11 01:16:26 UTC (rev 4285)
@@ -51,6 +51,7 @@
    
    public void testSynchronousCallback() throws Throwable
    {
+      log.info("entering " + getName());
       String transport = getTransport();
       String host = InetAddress.getLocalHost().getHostName();
       int port = AsynchCallbackTestServerRoot.port;
@@ -71,7 +72,7 @@
       Boolean done = (Boolean) client.invoke(AsynchCallbackTestServerRoot.GET_STATUS);
       log.info("done 1: " + done);
       assertFalse(done.booleanValue());
-      Thread.sleep(2000);
+      Thread.sleep(8000);
       done = (Boolean) client.invoke(AsynchCallbackTestServerRoot.GET_STATUS);
       log.info("done 2: " + done);
       assertTrue(done.booleanValue());
@@ -81,11 +82,13 @@
       log.info("disconnecting");
       client.disconnect();
       log.info("disconnected");
+      log.info(getName() + " PASSES");
    }
    
    
    public void testASynchronousCallbackClientSide() throws Throwable
    {
+      log.info("entering " + getName());
       String transport = getTransport();
       String host = InetAddress.getLocalHost().getHostName();
       int port = AsynchCallbackTestServerRoot.port;
@@ -101,7 +104,7 @@
       client.addListener(callbackHandler, null, null, true);
       log.info("client added callback handler");
       client.invokeOneway(AsynchCallbackTestServerRoot.ASYNCHRONOUS_CLIENT_SIDE_TEST);
-      Thread.sleep(500);
+      Thread.sleep(4000);
       // Should have returned.
       Boolean done = (Boolean) client.invoke(AsynchCallbackTestServerRoot.GET_STATUS);
       assertTrue(done.booleanValue());
@@ -109,11 +112,13 @@
       client.invoke(AsynchCallbackTestServerRoot.RESET);
       client.removeListener(callbackHandler);
       client.disconnect();
+      log.info(getName() + " PASSES");
    }
    
    
    public void testASynchronousCallbackServerSide() throws Throwable
    {
+      log.info("entering " + getName());
       String transport = getTransport();
       String host = InetAddress.getLocalHost().getHostName();
       int port = AsynchCallbackTestServerRoot.port;
@@ -129,11 +134,17 @@
       client.addListener(callbackHandler, null, null, true);
       log.info("client added callback handler");
       client.invokeOneway(AsynchCallbackTestServerRoot.ASYNCHRONOUS_SERVER_SIDE_TEST);
-      Thread.sleep(500);
+      Thread.sleep(4000);
+      
       // Should have returned.
       Boolean done = (Boolean) client.invoke(AsynchCallbackTestServerRoot.GET_STATUS);
       assertTrue(done.booleanValue());
       assertTrue(callbackHandler.receivedCallback);
+      Thread.sleep(5000);
+      
+      // Callback should be handled.
+      assertTrue(callbackHandler.done);
+      
       String threadCount = (String) client.invoke(AsynchCallbackTestServerRoot.GET_THREAD_COUNT);
       assertEquals(AsynchCallbackTestServerRoot.THREAD_COUNT, threadCount);
       String queueSize = (String) client.invoke(AsynchCallbackTestServerRoot.GET_QUEUE_SIZE);
@@ -141,6 +152,7 @@
       client.invoke(AsynchCallbackTestServerRoot.RESET);
       client.removeListener(callbackHandler);
       client.disconnect();
+      log.info(getName() + " PASSES");
    }
    
    
@@ -154,6 +166,7 @@
    static class SampleCallbackHandler implements InvokerCallbackHandler
    {
       boolean receivedCallback;
+      boolean done;
       
       public void handleCallback(Callback callback) throws HandleCallbackException
       {
@@ -161,11 +174,12 @@
          receivedCallback = true;
          try
          {
-            Thread.sleep(2000);
+            Thread.sleep(5000);
          }
          catch (InterruptedException e)
          {
          }
+         done = true;
       }
    }
 }




More information about the jboss-remoting-commits mailing list