[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch ...
Ron Sigal
ron_sigal at yahoo.com
Fri Jul 6 21:12:43 EDT 2007
User: rsigal
Date: 07/07/06 21:12:43
Modified: src/tests/org/jboss/test/remoting/callback/asynch Tag:
remoting_2_x AsynchCallbackTestClientRoot.java
Log:
JBREM-706: Added done flag to SampleCallbackHandler.
Revision Changes Path
No revision
No revision
1.1.2.2 +9 -1 JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/AsynchCallbackTestClientRoot.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AsynchCallbackTestClientRoot.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/callback/asynch/AsynchCallbackTestClientRoot.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -b -r1.1.2.1 -r1.1.2.2
--- AsynchCallbackTestClientRoot.java 4 Feb 2007 08:00:29 -0000 1.1.2.1
+++ AsynchCallbackTestClientRoot.java 7 Jul 2007 01:12:43 -0000 1.1.2.2
@@ -39,7 +39,7 @@
* for a set of transport specific tests of the asynchronous callback facility.
*
* @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
- * @version $Revision: 1.1.2.1 $
+ * @version $Revision: 1.1.2.2 $
* <p>
* Copyright Nov 25, 2006
* </p>
@@ -130,10 +130,16 @@
log.info("client added callback handler");
client.invokeOneway(AsynchCallbackTestServerRoot.ASYNCHRONOUS_SERVER_SIDE_TEST);
Thread.sleep(500);
+
// Should have returned.
Boolean done = (Boolean) client.invoke(AsynchCallbackTestServerRoot.GET_STATUS);
assertTrue(done.booleanValue());
assertTrue(callbackHandler.receivedCallback);
+ Thread.sleep(2000);
+
+ // 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);
@@ -154,6 +160,7 @@
static class SampleCallbackHandler implements InvokerCallbackHandler
{
boolean receivedCallback;
+ boolean done;
public void handleCallback(Callback callback) throws HandleCallbackException
{
@@ -166,6 +173,7 @@
catch (InterruptedException e)
{
}
+ done = true;
}
}
}
More information about the jboss-cvs-commits
mailing list