KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > remoting > performance > asynchronous > PerformanceClientSideTestCase


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.test.remoting.performance.asynchronous;
8
9 import java.io.IOException JavaDoc;
10 import org.apache.log4j.Level;
11 import org.jboss.test.remoting.performance.synchronous.PerformanceServerTest;
12 import org.jboss.test.remoting.performance.synchronous.PerformanceTestCase;
13
14 /**
15  * @author <a HREF="mailto:tom.elrod@jboss.com">Tom Elrod</a>
16  */

17 public class PerformanceClientSideTestCase extends PerformanceTestCase
18 {
19    public void declareTestClasses()
20    {
21       //**************** LOGGING ***********************
22
org.apache.log4j.BasicConfigurator.configure();
23       org.apache.log4j.Category.getRoot().setLevel(Level.DEBUG);
24       //org.apache.log4j.Category.getInstance("org.jboss.remoting").setLevel(Level.DEBUG);
25

26       org.apache.log4j.SimpleLayout layout = new org.apache.log4j.SimpleLayout();
27
28       try
29       {
30          org.apache.log4j.FileAppender fileAppender = new org.apache.log4j.FileAppender(layout, "debug_output.log");
31          fileAppender.setThreshold(Level.DEBUG);
32          fileAppender.setAppend(false);
33          org.apache.log4j.Category.getRoot().addAppender(fileAppender);
34       }
35       catch(IOException JavaDoc e)
36       {
37          e.printStackTrace();
38       }
39       //*************** END LOGGING ***********************
40

41
42
43       String JavaDoc numOfClients = System.getProperty(NUMBER_OF_CLIENTS);
44       if(numOfClients != null && numOfClients.length() > 0)
45       {
46          try
47          {
48             numberOfClients = Integer.parseInt(numOfClients);
49          }
50          catch(NumberFormatException JavaDoc e)
51          {
52             e.printStackTrace();
53          }
54       }
55
56       addTestClasses(PerformanceClientSideClientTest.class.getName(),
57                      numberOfClients,
58                      PerformanceServerTest.class.getName());
59    }
60
61 }
Popular Tags