[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/performance/raw/rmi ...
Tom Elrod
tom.elrod at jboss.com
Fri Aug 18 13:59:03 EDT 2006
User: telrod
Date: 06/08/18 13:59:03
Modified: src/tests/org/jboss/test/remoting/performance/raw/rmi
MultiThreadedRMIPerformanceClient.java
RMIHandler.java RMIPerformanceClient.java
RMIPerformanceServer.java
RMIPerformanceTestCase.java RMIServer.java
Log:
JBREM-562 - updated performance tests so can specify the bind host (previously hardcoded to localhost).
Revision Changes Path
1.3 +8 -8 JBossRemoting/src/tests/org/jboss/test/remoting/performance/raw/rmi/MultiThreadedRMIPerformanceClient.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MultiThreadedRMIPerformanceClient.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/performance/raw/rmi/MultiThreadedRMIPerformanceClient.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- MultiThreadedRMIPerformanceClient.java 30 Dec 2005 05:26:44 -0000 1.2
+++ MultiThreadedRMIPerformanceClient.java 18 Aug 2006 17:59:03 -0000 1.3
@@ -22,19 +22,19 @@
package org.jboss.test.remoting.performance.raw.rmi;
-import java.rmi.Remote;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-import java.rmi.server.UID;
-import java.util.Map;
+import EDU.oswego.cs.dl.util.concurrent.Latch;
+import junit.framework.Test;
import org.jboss.jrunit.decorators.ThreadLocalDecorator;
import org.jboss.logging.Logger;
import org.jboss.remoting.InvokerLocator;
import org.jboss.test.remoting.performance.synchronous.MultiThreadedPerformanceClientTest;
import org.jboss.test.remoting.performance.synchronous.PerformanceCallbackKeeper;
-import EDU.oswego.cs.dl.util.concurrent.Latch;
-import junit.framework.Test;
+import java.rmi.Remote;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.rmi.server.UID;
+import java.util.Map;
/**
* @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
@@ -56,7 +56,7 @@
{
//super.init();
- String name = "//localhost/RMIServer";
+ String name = "//" + host+ "/RMIServer";
// RMIServer svr = (RMIServer) Naming.lookup(name);
try
1.4 +6 -5 JBossRemoting/src/tests/org/jboss/test/remoting/performance/raw/rmi/RMIHandler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RMIHandler.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/performance/raw/rmi/RMIHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- RMIHandler.java 30 Dec 2005 05:26:44 -0000 1.3
+++ RMIHandler.java 18 Aug 2006 17:59:03 -0000 1.4
@@ -22,14 +22,15 @@
package org.jboss.test.remoting.performance.raw.rmi;
+import org.jboss.remoting.callback.Callback;
+import org.jboss.remoting.callback.HandleCallbackException;
+import org.jboss.remoting.callback.InvokerCallbackHandler;
+
import java.rmi.NotBoundException;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
-import org.jboss.remoting.callback.Callback;
-import org.jboss.remoting.callback.HandleCallbackException;
-import org.jboss.remoting.callback.InvokerCallbackHandler;
/**
* @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
@@ -38,7 +39,7 @@
{
private RMICallbackServerRemote callbackServer;
- public RMIHandler(String sessionId)
+ public RMIHandler(String host, String sessionId)
{
int rmiPort = 1099;
String name = "//" + sessionId + "/RMICallbackServer";
@@ -46,7 +47,7 @@
try
{
- Registry regsitry = LocateRegistry.getRegistry("localhost", rmiPort);
+ Registry regsitry = LocateRegistry.getRegistry(host, rmiPort);
Remote remoteObj = regsitry.lookup(name);
callbackServer = (RMICallbackServerRemote) remoteObj;
}
1.4 +8 -8 JBossRemoting/src/tests/org/jboss/test/remoting/performance/raw/rmi/RMIPerformanceClient.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RMIPerformanceClient.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/performance/raw/rmi/RMIPerformanceClient.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- RMIPerformanceClient.java 30 Dec 2005 05:26:44 -0000 1.3
+++ RMIPerformanceClient.java 18 Aug 2006 17:59:03 -0000 1.4
@@ -22,19 +22,19 @@
package org.jboss.test.remoting.performance.raw.rmi;
-import java.rmi.Remote;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-import java.rmi.server.UID;
-import java.util.Map;
+import EDU.oswego.cs.dl.util.concurrent.Latch;
+import junit.framework.Test;
import org.jboss.jrunit.decorators.ThreadLocalDecorator;
import org.jboss.logging.Logger;
import org.jboss.remoting.InvokerLocator;
import org.jboss.test.remoting.performance.synchronous.PerformanceCallbackKeeper;
import org.jboss.test.remoting.performance.synchronous.PerformanceClientTest;
-import EDU.oswego.cs.dl.util.concurrent.Latch;
-import junit.framework.Test;
+import java.rmi.Remote;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.rmi.server.UID;
+import java.util.Map;
/**
* @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
@@ -56,7 +56,7 @@
{
//super.init();
- String name = "//localhost/RMIServer";
+ String name = "//" + host + "/RMIServer";
// RMIServer svr = (RMIServer) Naming.lookup(name);
try
1.3 +5 -5 JBossRemoting/src/tests/org/jboss/test/remoting/performance/raw/rmi/RMIPerformanceServer.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RMIPerformanceServer.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/performance/raw/rmi/RMIPerformanceServer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- RMIPerformanceServer.java 30 Dec 2005 05:26:44 -0000 1.2
+++ RMIPerformanceServer.java 18 Aug 2006 17:59:03 -0000 1.3
@@ -22,11 +22,12 @@
package org.jboss.test.remoting.performance.raw.rmi;
+import org.jboss.test.remoting.performance.synchronous.PerformanceServerTest;
+
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.Map;
-import org.jboss.test.remoting.performance.synchronous.PerformanceServerTest;
/**
* @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
@@ -35,7 +36,6 @@
{
private int rmiPort = 1099;
private Registry registry = null;
- private String name = "//localhost/RMIServer";
public void init(Map metatdata) throws Exception
{
@@ -46,9 +46,9 @@
registry = LocateRegistry.createRegistry(rmiPort);
- RMIServerRemote engine = new RMIServer();
+ RMIServerRemote engine = new RMIServer(host);
// Naming.rebind(name, engine);
- registry.rebind(name, engine);
+ registry.rebind("//" + host + "/RMIServer", engine);
}
catch(RemoteException e)
{
@@ -60,7 +60,7 @@
public void tearDown() throws Exception
{
super.tearDown();
- registry.unbind(name);
+ registry.unbind("//" + host + "/RMIServer");
}
public static void main(String[] args)
1.3 +9 -1 JBossRemoting/src/tests/org/jboss/test/remoting/performance/raw/rmi/RMIPerformanceTestCase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RMIPerformanceTestCase.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/performance/raw/rmi/RMIPerformanceTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- RMIPerformanceTestCase.java 30 Dec 2005 05:26:44 -0000 1.2
+++ RMIPerformanceTestCase.java 18 Aug 2006 17:59:03 -0000 1.3
@@ -22,10 +22,11 @@
package org.jboss.test.remoting.performance.raw.rmi;
-import java.io.IOException;
import org.apache.log4j.Level;
import org.jboss.jrunit.harness.BenchmarkTestDriver;
+import java.io.IOException;
+
/**
* @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
*/
@@ -43,6 +44,8 @@
public static final String RESULT_TIMEOUT = "jrunit.result_timeout";
public static final String TEAR_DOWN_TIMEOUT = "jrunit.tear_down_timeout";
public static final String RUN_TEST_TIMEOUT = "jrunit.run_test_timeout";
+ public static final String REMOTING_HOST = "remoting.host";
+
public void declareTestClasses()
{
@@ -147,6 +150,11 @@
{
vmArgs = "-D" + REMOTING_TRANSPORT + "=" + transport;
}
+ String host = System.getProperty(REMOTING_HOST);
+ if(host != null && host.length() > 0)
+ {
+ vmArgs = "-D" + REMOTING_HOST + "=" + host;
+ }
String serialization = System.getProperty(REMOTING_SERIALIZATION);
if(serialization != null && serialization.length() > 0)
{
1.5 +14 -10 JBossRemoting/src/tests/org/jboss/test/remoting/performance/raw/rmi/RMIServer.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RMIServer.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/performance/raw/rmi/RMIServer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- RMIServer.java 30 Dec 2005 05:26:44 -0000 1.4
+++ RMIServer.java 18 Aug 2006 17:59:03 -0000 1.5
@@ -22,16 +22,16 @@
package org.jboss.test.remoting.performance.raw.rmi;
+import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
+import org.jboss.logging.Logger;
+import org.jboss.test.remoting.performance.synchronous.CallTracker;
+import org.jboss.test.remoting.performance.synchronous.Payload;
+
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import java.util.Map;
-import org.jboss.logging.Logger;
-import org.jboss.test.remoting.performance.synchronous.CallTracker;
-import org.jboss.test.remoting.performance.synchronous.Payload;
-
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
/**
* @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
@@ -42,9 +42,12 @@
private Map callTrackers = new ConcurrentHashMap();
- public RMIServer() throws RemoteException
+ private String host = "localhost";
+
+ public RMIServer(String host) throws RemoteException
{
super();
+ this.host = host;
}
public Object sendNumberOfCalls(Object obj, Object param) throws RemoteException
@@ -61,7 +64,7 @@
}
else
{
- RMIHandler callbackHandler = new RMIHandler(sessionId);
+ RMIHandler callbackHandler = new RMIHandler(host, sessionId);
tracker = new CallTracker(sessionId, callbackHandler);
callTrackers.put(sessionId, tracker);
tracker.createTotalCount(totalCount);
@@ -102,9 +105,9 @@
int port = 1099;
Registry registry = LocateRegistry.createRegistry(port);
- String name = "//localhost/RMIServer";
+ String name = "//" + host + "/RMIServer";
- RMIServerRemote engine = new RMIServer();
+ RMIServerRemote engine = new RMIServer(host);
// Naming.rebind(name, engine);
registry.rebind(name, this);
System.out.println("RMIServer bound");
@@ -120,7 +123,8 @@
{
try
{
- RMIServer server = new RMIServer();
+ String host = "localhost";
+ RMIServer server = new RMIServer(host);
server.start();
}
catch(RemoteException e)
More information about the jboss-cvs-commits
mailing list