[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/performance/synchronous ...

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/synchronous    
                        MultiThreadedPerformanceClientTest.java
                        PerformanceClientTest.java
                        PerformanceServerTest.java PerformanceTestCase.java
  Log:
  JBREM-562 - updated performance tests so can specify the bind host (previously hardcoded to localhost).
  
  Revision  Changes    Path
  1.10      +16 -8     JBossRemoting/src/tests/org/jboss/test/remoting/performance/synchronous/MultiThreadedPerformanceClientTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MultiThreadedPerformanceClientTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/performance/synchronous/MultiThreadedPerformanceClientTest.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- MultiThreadedPerformanceClientTest.java	30 Dec 2005 05:26:44 -0000	1.9
  +++ MultiThreadedPerformanceClientTest.java	18 Aug 2006 17:59:03 -0000	1.10
  @@ -22,8 +22,10 @@
   
   package org.jboss.test.remoting.performance.synchronous;
   
  -import java.util.HashMap;
  -import java.util.Map;
  +import EDU.oswego.cs.dl.util.concurrent.Latch;
  +import EDU.oswego.cs.dl.util.concurrent.SynchronizedInt;
  +import junit.framework.Test;
  +import junit.framework.TestCase;
   import org.jboss.jrunit.controller.ThreadLocalBenchmark;
   import org.jboss.jrunit.decorators.ThreadLocalDecorator;
   import org.jboss.logging.Logger;
  @@ -37,10 +39,8 @@
   import org.jboss.test.remoting.TestUtil;
   import org.jboss.test.remoting.performance.PerformanceReporter;
   
  -import EDU.oswego.cs.dl.util.concurrent.Latch;
  -import EDU.oswego.cs.dl.util.concurrent.SynchronizedInt;
  -import junit.framework.Test;
  -import junit.framework.TestCase;
  +import java.util.HashMap;
  +import java.util.Map;
   
   
   /**
  @@ -76,6 +76,7 @@
   
      private int numOfThreads = 10;
   
  +   protected String host = "localhost";
   
      public static Test suite()
      {
  @@ -86,7 +87,7 @@
      {
         try
         {
  -         String locatorURI = getTransport() + "://localhost:" + getPort();
  +         String locatorURI = getTransport() + "://" + host + ":" + getPort();
            if(metadata != null)
            {
               locatorURI = locatorURI + "/?" + metadata;
  @@ -151,7 +152,7 @@
         log.debug("port = " + port);
   
         connector = new Connector();
  -      String locatorURI = getTransport() + "://localhost:" + port;
  +      String locatorURI = getTransport() + "://" + host + ":" + port;
         if(metadata != null)
         {
            locatorURI = locatorURI + "/?" + metadata;
  @@ -174,6 +175,13 @@
            log.info("Using transport: " + transport);
         }
   
  +      String newHost = System.getProperty(PerformanceTestCase.REMOTING_HOST);
  +      if(newHost != null && newHost.length() > 0)
  +      {
  +         host = newHost;
  +         log.info("Using host: " + host);
  +      }
  +
         String newSerialization = System.getProperty(PerformanceTestCase.REMOTING_SERIALIZATION);
         if(newSerialization != null && newSerialization.length() > 0)
         {
  
  
  
  1.18      +15 -7     JBossRemoting/src/tests/org/jboss/test/remoting/performance/synchronous/PerformanceClientTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PerformanceClientTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/performance/synchronous/PerformanceClientTest.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -b -r1.17 -r1.18
  --- PerformanceClientTest.java	30 Dec 2005 05:26:44 -0000	1.17
  +++ PerformanceClientTest.java	18 Aug 2006 17:59:03 -0000	1.18
  @@ -22,8 +22,9 @@
   
   package org.jboss.test.remoting.performance.synchronous;
   
  -import java.util.HashMap;
  -import java.util.Map;
  +import EDU.oswego.cs.dl.util.concurrent.Latch;
  +import junit.framework.Test;
  +import junit.framework.TestCase;
   import org.jboss.jrunit.controller.ThreadLocalBenchmark;
   import org.jboss.jrunit.decorators.ThreadLocalDecorator;
   import org.jboss.logging.Logger;
  @@ -34,9 +35,8 @@
   import org.jboss.test.remoting.TestUtil;
   import org.jboss.test.remoting.performance.PerformanceReporter;
   
  -import EDU.oswego.cs.dl.util.concurrent.Latch;
  -import junit.framework.Test;
  -import junit.framework.TestCase;
  +import java.util.HashMap;
  +import java.util.Map;
   
   
   /**
  @@ -68,6 +68,7 @@
   
      protected static final Logger log = Logger.getLogger(PerformanceClientTest.class);
   
  +   protected String host = "localhost";
   
      public static Test suite()
      {
  @@ -83,7 +84,7 @@
      {
         try
         {
  -         String locatorURI = getTransport() + "://localhost:" + getPort();
  +         String locatorURI = getTransport() + "://" + host + ":" + getPort();
            if(metadata != null)
            {
               locatorURI = locatorURI + "/?" + metadata;
  @@ -139,7 +140,7 @@
         log.debug("port = " + port);
   
         connector = new Connector();
  -      String locatorURI = getTransport() + "://localhost:" + port;
  +      String locatorURI = getTransport() + "://" + host + ":" + port;
         if(metadata != null)
         {
            locatorURI = locatorURI + "/?" + metadata;
  @@ -162,6 +163,13 @@
            log.info("Using transport: " + transport);
         }
   
  +      String newHost = System.getProperty(PerformanceTestCase.REMOTING_HOST);
  +      if(newHost != null && newHost.length() > 0)
  +      {
  +         host = newHost;
  +         log.info("Using host: " + host);
  +      }
  +
         String newSerialization = System.getProperty(PerformanceTestCase.REMOTING_SERIALIZATION);
         if(newSerialization != null && newSerialization.length() > 0)
         {
  
  
  
  1.11      +8 -1      JBossRemoting/src/tests/org/jboss/test/remoting/performance/synchronous/PerformanceServerTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PerformanceServerTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/performance/synchronous/PerformanceServerTest.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- PerformanceServerTest.java	16 Aug 2006 14:20:17 -0000	1.10
  +++ PerformanceServerTest.java	18 Aug 2006 17:59:03 -0000	1.11
  @@ -42,7 +42,7 @@
      // default transport and port
      private String transport = "socket";
      private int serverPort = 9090;
  -   private String host = "localhost";
  +   protected String host = "localhost";
   
      private Connector connector = null;
   
  @@ -118,6 +118,13 @@
            log.info("Using transport: " + transport);
         }
   
  +      String newHost = System.getProperty(PerformanceTestCase.REMOTING_HOST);
  +      if(newHost != null && newHost.length() > 0)
  +      {
  +         host = newHost;
  +         log.info("Using host: " + host);
  +      }
  +
         Map metadata = new HashMap();
   
         String newMetadata = System.getProperty(PerformanceTestCase.REMOTING_METADATA);
  
  
  
  1.11      +6 -0      JBossRemoting/src/tests/org/jboss/test/remoting/performance/synchronous/PerformanceTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PerformanceTestCase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/performance/synchronous/PerformanceTestCase.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- PerformanceTestCase.java	14 Aug 2006 22:06:35 -0000	1.10
  +++ PerformanceTestCase.java	18 Aug 2006 17:59:03 -0000	1.11
  @@ -43,6 +43,7 @@
      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 +148,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)
         {
  
  
  



More information about the jboss-cvs-commits mailing list