[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/shutdown ...
Ron Sigal
ron_sigal at yahoo.com
Wed Nov 7 03:41:48 EST 2007
User: rsigal
Date: 07/11/07 03:41:48
Modified: src/tests/org/jboss/test/remoting/shutdown Tag:
remoting_2_x ShutdownTestParent.java
AbstractClient.java
Log:
JBREM-807: Allows subclassing of ClosingClient and HangingClient so that transport specific callback arguments can be added.
Revision Changes Path
No revision
No revision
1.1.2.4 +19 -7 JBossRemoting/src/tests/org/jboss/test/remoting/shutdown/ShutdownTestParent.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ShutdownTestParent.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/shutdown/ShutdownTestParent.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -b -r1.1.2.3 -r1.1.2.4
--- ShutdownTestParent.java 23 Jun 2007 07:23:34 -0000 1.1.2.3
+++ ShutdownTestParent.java 7 Nov 2007 08:41:48 -0000 1.1.2.4
@@ -40,14 +40,14 @@
* (http://jira.jboss.com/jira/browse/JBREM-674)
*
* @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
- * @version $Revision: 1.1.2.3 $
+ * @version $Revision: 1.1.2.4 $
* <p>
* Copyright Jan 19, 2007
* </p>
*/
public abstract class ShutdownTestParent extends TestCase
{
- private Logger log = Logger.getLogger(ShutdownTestParent.class);
+ protected Logger log = Logger.getLogger(ShutdownTestParent.class);
protected boolean serverSuccessful;
protected boolean clientSuccessful;
@@ -69,14 +69,14 @@
*/
public void testHangingClient() throws Throwable
{
- log.info("entering testShutdown()");
+ log.info("entering testHangingClient()");
port = PortUtil.findFreePort(InetAddress.getLocalHost().getHostName());
String command = "java -cp \"" + System.getProperty("java.class.path") + "\" ";
command += getJVMArguments() + " -Dport=" + port + " ";
String serverCommand = command + ShutdownTestServer.class.getName() + " " + getTransport();
serverCommand += " " + getServerArgs();
- String clientCommand = command + HangingClient.class.getName() + " " + getTransport();
+ String clientCommand = command + getHangingClientClassName() + " " + getTransport();
clientCommand += " " + getClientArgs();
new Executor(serverCommand, true).start();
Thread.sleep(1000);
@@ -96,19 +96,19 @@
*/
public void testClosingClient() throws Throwable
{
- log.info("entering testShutdown()");
+ log.info("entering testClosingClient()");
port = PortUtil.findFreePort(InetAddress.getLocalHost().getHostName());
String command = "java -cp \"" + System.getProperty("java.class.path") + "\" ";
command += getJVMArguments() + " -Dport=" + port + " ";
String serverCommand = command + ShutdownTestServer.class.getName() + " " + getTransport();
serverCommand += " " + getServerArgs();
- String clientCommand = command + ClosingClient.class.getName() + " " + getTransport();
+ String clientCommand = command + getClosingClientClassName() + " " + getTransport();
clientCommand += " " + getClientArgs();
new Executor(serverCommand, true).start();
Thread.sleep(1000);
new Executor(clientCommand, false).start();
- Thread.sleep(8000);
+ Thread.sleep(6000);
assertTrue(serverSuccessful);
assertTrue(clientSuccessful);
log.info(getName() + " PASSES");
@@ -133,6 +133,18 @@
}
+ protected String getHangingClientClassName()
+ {
+ return HangingClient.class.getName();
+ }
+
+
+ protected String getClosingClientClassName()
+ {
+ return ClosingClient.class.getName();
+ }
+
+
abstract protected String getTransport();
1.1.2.7 +11 -1 JBossRemoting/src/tests/org/jboss/test/remoting/shutdown/AbstractClient.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AbstractClient.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/shutdown/AbstractClient.java,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -b -r1.1.2.6 -r1.1.2.7
--- AbstractClient.java 9 Jul 2007 22:22:08 -0000 1.1.2.6
+++ AbstractClient.java 7 Nov 2007 08:41:48 -0000 1.1.2.7
@@ -39,7 +39,7 @@
/**
* @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
- * @version $Revision: 1.1.2.6 $
+ * @version $Revision: 1.1.2.7 $
* <p>
* Copyright Jan 19, 2007
* </p>
@@ -96,12 +96,16 @@
HashMap metadata = new HashMap();
metadata.put(ServerInvoker.BLOCKING_TIMEOUT, "2000");
metadata.put(ServerInvoker.BLOCKING_MODE, ServerInvoker.BLOCKING);
+ addCallbackArgs(metadata);
+ log.info("metadata: " + metadata);
client.addListener(callbackHandler1, metadata, null, false);
log.info("added blocking listener 1");
TestCallbackHandler callbackHandler2 = new TestCallbackHandler();
metadata.clear();
metadata.put(CallbackPoller.CALLBACK_POLL_PERIOD, "500");
metadata.put(ServerInvoker.BLOCKING_MODE, ServerInvoker.NONBLOCKING);
+ addCallbackArgs(metadata);
+ log.info("metadata: " + metadata);
client.addListener(callbackHandler2, metadata, null, false);
log.info("added nonblocking listener 2");
Thread.sleep(2000);
@@ -149,6 +153,12 @@
abstract protected boolean daemon();
+ protected void addCallbackArgs(Map map)
+ {
+ return;
+ }
+
+
protected static void getConfig(Map config, String configs)
{
int start = 0;
More information about the jboss-cvs-commits
mailing list