1
package org.jboss.test.remoting.performance.profiler;
3
import org.jboss.test.remoting.performance.synchronous.PerformanceClientTest;
4
import org.jboss.test.remoting.performance.synchronous.PerformanceServerTest;
5
import org.jboss.test.remoting.performance.synchronous.PerformanceTestCase;
8
* @author <a href="mailto:tom.elrod@jboss.com">Tom Elrod</a>
10
public class ProfileTest2
12
private static int numOfClients = 10;
13
private static int numOfLoops = 100;
15
private String numOfCalls = "1000";
16
// private String numOfCalls = "1000000";
18
private PerformanceServerTest server = null;
21
public void profilerTest() throws Throwable
25
System.setProperty(PerformanceTestCase.NUMBER_OF_CALLS, numOfCalls);
26
System.setProperty(PerformanceTestCase.REMOTING_METADATA, "foo=bar");
28
for(int x = 0; x < numOfClients; x++)
30
new Thread(new Runnable()
36
for(int i = 0; i < numOfLoops;i++)
41
catch(Throwable throwable)
43
throwable.printStackTrace();
49
while(numOfClients > 0)
51
Thread.currentThread().sleep(5000);
59
public void setupServer() throws Exception
61
server = new PerformanceServerTest();
63
System.out.println("Server setup");
67
public void runClientTest() throws Throwable
70
PerformanceClientTest client = new PerformanceClientTest();
72
System.out.println("Client setup");
74
client.testClientCalls();
75
System.out.println("Done with testing client calls");
82
System.out.println("Number of clients = " + numOfClients);
85
public static void main(String[] args)
87
ProfileTest2 test = new ProfileTest2();
92
catch(Throwable throwable)
94
throwable.printStackTrace();