[jbossws-commits] JBossWS SVN: r3896 - trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Mon Jul 16 10:43:28 EDT 2007


Author: heiko.braun at jboss.com
Date: 2007-07-16 10:43:28 -0400 (Mon, 16 Jul 2007)
New Revision: 3896

Modified:
   trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkDocEJBTestCase.java
   trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkDocJSETestCase.java
   trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkRpcEJBTestCase.java
   trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkRpcJSETestCase.java
Log:
Use dynamic server host assignment in benchmark/jaxrpc tests

Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkDocEJBTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkDocEJBTestCase.java	2007-07-16 13:27:36 UTC (rev 3895)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkDocEJBTestCase.java	2007-07-16 14:43:28 UTC (rev 3896)
@@ -28,6 +28,7 @@
 
 import javax.naming.InitialContext;
 import javax.xml.rpc.Service;
+import javax.xml.rpc.Stub;
 
 /**
  * Test Benchmark EJB Service
@@ -37,52 +38,54 @@
  */
 public class BenchmarkDocEJBTestCase extends JBossWSTest
 {
-    private static BenchmarkService endpoint;
+   private static BenchmarkService endpoint;
 
-    public static Test suite()
-    {
-        return new JBossWSTestSetup(BenchmarkDocEJBTestCase.class, "jaxrpc-benchmark-doclit.jar, jaxrpc-benchmark-doclit-client.jar");
-    }
+   public static Test suite()
+   {
+      return new JBossWSTestSetup(BenchmarkDocEJBTestCase.class, "jaxrpc-benchmark-doclit.jar, jaxrpc-benchmark-doclit-client.jar");
+   }
 
-    protected void setUp() throws Exception
-    {
-        super.setUp();
+   protected void setUp() throws Exception
+   {
+      super.setUp();
 
-        if (endpoint == null)
-        {
-            InitialContext iniCtx = getInitialContext("benchmark-client");
-            Service service = (Service)iniCtx.lookup("java:comp/env/service/BenchmarkEJB");
-            endpoint = (BenchmarkService)service.getPort(BenchmarkService.class);            
-        }
+      if (endpoint == null)
+      {
+         InitialContext iniCtx = getInitialContext("benchmark-client");
+         Service service = (Service)iniCtx.lookup("java:comp/env/service/BenchmarkEJB");
+         endpoint = (BenchmarkService)service.getPort(BenchmarkService.class);
 
+         ((Stub)endpoint)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxrpc-benchmark-doc-ejb");
+      }
 
-    }
 
-    public void testEchoSimpleType() throws Exception
-    {
-        SimpleUserType userType = new SimpleUserType(1, 1.0f, "test");
-        SimpleUserType retObj = endpoint.echoSimpleType(userType);
-        assertEquals(userType.getS()+userType.getF()+userType.getI(), retObj.getS()+retObj.getF()+retObj.getI());
-    }
+   }
 
-    public void testEchoArrayOfSimpleUserType() throws Exception
-    {
-        SimpleUserType[] array = new SimpleUserType[1];
-        array[0] = new SimpleUserType(1, 1.0f, "test");
-        SimpleUserType[] retObj = endpoint.echoArrayOfSimpleUserType(array);
-        assertEquals(array[0].getS()+array[0].getF()+array[0].getI(), retObj[0].getS()+retObj[0].getF()+retObj[0].getI());
-    }
+   public void testEchoSimpleType() throws Exception
+   {
+      SimpleUserType userType = new SimpleUserType(1, 1.0f, "test");
+      SimpleUserType retObj = endpoint.echoSimpleType(userType);
+      assertEquals(userType.getS()+userType.getF()+userType.getI(), retObj.getS()+retObj.getF()+retObj.getI());
+   }
 
-    public void testEchoSynthetic() throws Exception
-    {
-        Synthetic synthetic = new Synthetic("test", new SimpleUserType(1, 1.0f, "test"), "test".getBytes());
-        Synthetic retObj = endpoint.echoSynthetic(synthetic);
-        assertEquals(synthetic.getS()+synthetic.getSut().getS()+synthetic.getSut().getF()+synthetic.getSut().getI(), retObj.getS()+retObj.getSut().getS()+retObj.getSut().getF()+retObj.getSut().getI());
-    }
+   public void testEchoArrayOfSimpleUserType() throws Exception
+   {
+      SimpleUserType[] array = new SimpleUserType[1];
+      array[0] = new SimpleUserType(1, 1.0f, "test");
+      SimpleUserType[] retObj = endpoint.echoArrayOfSimpleUserType(array);
+      assertEquals(array[0].getS()+array[0].getF()+array[0].getI(), retObj[0].getS()+retObj[0].getF()+retObj[0].getI());
+   }
 
-    public void testGetOrder() throws Exception
-    {
-        Order order = endpoint.getOrder(50,1);
-        assertEquals(50,order.getLineItems().length);
-    }
+   public void testEchoSynthetic() throws Exception
+   {
+      Synthetic synthetic = new Synthetic("test", new SimpleUserType(1, 1.0f, "test"), "test".getBytes());
+      Synthetic retObj = endpoint.echoSynthetic(synthetic);
+      assertEquals(synthetic.getS()+synthetic.getSut().getS()+synthetic.getSut().getF()+synthetic.getSut().getI(), retObj.getS()+retObj.getSut().getS()+retObj.getSut().getF()+retObj.getSut().getI());
+   }
+
+   public void testGetOrder() throws Exception
+   {
+      Order order = endpoint.getOrder(50,1);
+      assertEquals(50,order.getLineItems().length);
+   }
 }

Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkDocJSETestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkDocJSETestCase.java	2007-07-16 13:27:36 UTC (rev 3895)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkDocJSETestCase.java	2007-07-16 14:43:28 UTC (rev 3896)
@@ -30,6 +30,7 @@
 import javax.naming.NamingException;
 import javax.xml.rpc.Service;
 import javax.xml.rpc.ServiceException;
+import javax.xml.rpc.Stub;
 
 /**
  * Test Benchmark EJB Service
@@ -57,7 +58,8 @@
               InitialContext iniCtx = getInitialContext("benchmark-client");
               Service service = (Service)iniCtx.lookup("java:comp/env/service/BenchmarkJSE");
               endpoint = (BenchmarkService)service.getPort(BenchmarkService.class);
-              //((Stub)endpoint)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://"+getServerHost()+":8080/jaxrpc-benchmark-doc/jse");
+
+             ((Stub)endpoint)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxrpc-benchmark-doc/jse");
           }
        }
        catch (NamingException e)
@@ -66,7 +68,7 @@
        }
        catch (ServiceException e)
        {
-          e.printStackTrace();  
+          e.printStackTrace();
        }
     }
 

Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkRpcEJBTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkRpcEJBTestCase.java	2007-07-16 13:27:36 UTC (rev 3895)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkRpcEJBTestCase.java	2007-07-16 14:43:28 UTC (rev 3896)
@@ -28,6 +28,7 @@
 
 import javax.naming.InitialContext;
 import javax.xml.rpc.Service;
+import javax.xml.rpc.Stub;
 
 /**
  * Test Benchmark EJB Service
@@ -37,50 +38,52 @@
  */
 public class BenchmarkRpcEJBTestCase extends JBossWSTest
 {
-    private static BenchmarkService endpoint;
+   private static BenchmarkService endpoint;
 
-    public static Test suite()
-    {
-        return new JBossWSTestSetup(BenchmarkRpcEJBTestCase.class, "jaxrpc-benchmark-rpclit.jar, jaxrpc-benchmark-rpclit-client.jar");
-    }
+   public static Test suite()
+   {
+      return new JBossWSTestSetup(BenchmarkRpcEJBTestCase.class, "jaxrpc-benchmark-rpclit.jar, jaxrpc-benchmark-rpclit-client.jar");
+   }
 
-    protected void setUp() throws Exception
-    {
-        super.setUp();
+   protected void setUp() throws Exception
+   {
+      super.setUp();
 
-        if (endpoint == null)
-        {
-            InitialContext iniCtx = getInitialContext("benchmark-client");
-            Service service = (Service)iniCtx.lookup("java:comp/env/service/BenchmarkEJB");
-            endpoint = (BenchmarkService)service.getPort(BenchmarkService.class);         
-        }
-    }
+      if (endpoint == null)
+      {
+         InitialContext iniCtx = getInitialContext("benchmark-client");
+         Service service = (Service)iniCtx.lookup("java:comp/env/service/BenchmarkEJB");
+         endpoint = (BenchmarkService)service.getPort(BenchmarkService.class);
 
-    public void testEchoSimpleType() throws Exception
-    {
-        SimpleUserType userType = new SimpleUserType(1, 1.0f, "test");
-        SimpleUserType retObj = endpoint.echoSimpleType(userType);
-        assertEquals(userType.getS()+userType.getF()+userType.getI(), retObj.getS()+retObj.getF()+retObj.getI());
-    }
+         ((Stub)endpoint)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxrpc-benchmark-rpc-ejb");
+      }
+   }
 
-    public void testEchoArrayOfSimpleUserType() throws Exception
-    {
-        SimpleUserType[] array = new SimpleUserType[1];
-        array[0] = new SimpleUserType(1, 1.0f, "test");
-        SimpleUserType[] retObj = endpoint.echoArrayOfSimpleUserType(array);
-        assertEquals(array[0].getS()+array[0].getF()+array[0].getI(), retObj[0].getS()+retObj[0].getF()+retObj[0].getI());
-    }
+   public void testEchoSimpleType() throws Exception
+   {
+      SimpleUserType userType = new SimpleUserType(1, 1.0f, "test");
+      SimpleUserType retObj = endpoint.echoSimpleType(userType);
+      assertEquals(userType.getS()+userType.getF()+userType.getI(), retObj.getS()+retObj.getF()+retObj.getI());
+   }
 
-    public void testEchoSynthetic() throws Exception
-    {
-        Synthetic synthetic = new Synthetic("test", new SimpleUserType(1, 1.0f, "test"), "test".getBytes());
-        Synthetic retObj = endpoint.echoSynthetic(synthetic);
-        assertEquals(synthetic.getS()+synthetic.getSut().getS()+synthetic.getSut().getF()+synthetic.getSut().getI(), retObj.getS()+retObj.getSut().getS()+retObj.getSut().getF()+retObj.getSut().getI());
-    }
+   public void testEchoArrayOfSimpleUserType() throws Exception
+   {
+      SimpleUserType[] array = new SimpleUserType[1];
+      array[0] = new SimpleUserType(1, 1.0f, "test");
+      SimpleUserType[] retObj = endpoint.echoArrayOfSimpleUserType(array);
+      assertEquals(array[0].getS()+array[0].getF()+array[0].getI(), retObj[0].getS()+retObj[0].getF()+retObj[0].getI());
+   }
 
-    public void testGetOrder() throws Exception
-    {
-        Order order = endpoint.getOrder(50,1);
-        assertEquals(50,order.getLineItems().length);
-    }
+   public void testEchoSynthetic() throws Exception
+   {
+      Synthetic synthetic = new Synthetic("test", new SimpleUserType(1, 1.0f, "test"), "test".getBytes());
+      Synthetic retObj = endpoint.echoSynthetic(synthetic);
+      assertEquals(synthetic.getS()+synthetic.getSut().getS()+synthetic.getSut().getF()+synthetic.getSut().getI(), retObj.getS()+retObj.getSut().getS()+retObj.getSut().getF()+retObj.getSut().getI());
+   }
+
+   public void testGetOrder() throws Exception
+   {
+      Order order = endpoint.getOrder(50,1);
+      assertEquals(50,order.getLineItems().length);
+   }
 }

Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkRpcJSETestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkRpcJSETestCase.java	2007-07-16 13:27:36 UTC (rev 3895)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/benchmark/jaxrpc/BenchmarkRpcJSETestCase.java	2007-07-16 14:43:28 UTC (rev 3896)
@@ -28,6 +28,7 @@
 
 import javax.naming.InitialContext;
 import javax.xml.rpc.Service;
+import javax.xml.rpc.Stub;
 
 /**
  * Test Benchmark EJB Service
@@ -37,50 +38,52 @@
  */
 public class BenchmarkRpcJSETestCase extends JBossWSTest
 {
-    private static BenchmarkService endpoint;
+   private static BenchmarkService endpoint;
 
-    public static Test suite()
-    {
-        return new JBossWSTestSetup(BenchmarkRpcJSETestCase.class, "jaxrpc-benchmark-rpclit.war, jaxrpc-benchmark-rpclit-client.jar");
-    }
+   public static Test suite()
+   {
+      return new JBossWSTestSetup(BenchmarkRpcJSETestCase.class, "jaxrpc-benchmark-rpclit.war, jaxrpc-benchmark-rpclit-client.jar");
+   }
 
-    protected void setUp() throws Exception
-    {
-        super.setUp();
+   protected void setUp() throws Exception
+   {
+      super.setUp();
 
-        if (endpoint == null)
-        {
-            InitialContext iniCtx = getInitialContext("benchmark-client");
-            Service service = (Service)iniCtx.lookup("java:comp/env/service/BenchmarkJSE");
-            endpoint = (BenchmarkService)service.getPort(BenchmarkService.class);         
-        }
-    }
+      if (endpoint == null)
+      {
+         InitialContext iniCtx = getInitialContext("benchmark-client");
+         Service service = (Service)iniCtx.lookup("java:comp/env/service/BenchmarkJSE");
+         endpoint = (BenchmarkService)service.getPort(BenchmarkService.class);
 
-    public void testEchoSimpleType() throws Exception
-    {
-        SimpleUserType userType = new SimpleUserType(1, 1.0f, "test");
-        SimpleUserType retObj = endpoint.echoSimpleType(userType);
-        assertEquals(userType.getS()+userType.getF()+userType.getI(), retObj.getS()+retObj.getF()+retObj.getI());
-    }
+         ((Stub)endpoint)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxrpc-benchmark-rpc");
+      }
+   }
 
-    public void testEchoArrayOfSimpleUserType() throws Exception
-    {
-        SimpleUserType[] array = new SimpleUserType[1];
-        array[0] = new SimpleUserType(1, 1.0f, "test");
-        SimpleUserType[] retObj = endpoint.echoArrayOfSimpleUserType(array);
-        assertEquals(array[0].getS()+array[0].getF()+array[0].getI(), retObj[0].getS()+retObj[0].getF()+retObj[0].getI());
-    }
+   public void testEchoSimpleType() throws Exception
+   {
+      SimpleUserType userType = new SimpleUserType(1, 1.0f, "test");
+      SimpleUserType retObj = endpoint.echoSimpleType(userType);
+      assertEquals(userType.getS()+userType.getF()+userType.getI(), retObj.getS()+retObj.getF()+retObj.getI());
+   }
 
-    public void testEchoSynthetic() throws Exception
-    {
-        Synthetic synthetic = new Synthetic("test", new SimpleUserType(1, 1.0f, "test"), "test".getBytes());
-        Synthetic retObj = endpoint.echoSynthetic(synthetic);
-        assertEquals(synthetic.getS()+synthetic.getSut().getS()+synthetic.getSut().getF()+synthetic.getSut().getI(), retObj.getS()+retObj.getSut().getS()+retObj.getSut().getF()+retObj.getSut().getI());
-    }
+   public void testEchoArrayOfSimpleUserType() throws Exception
+   {
+      SimpleUserType[] array = new SimpleUserType[1];
+      array[0] = new SimpleUserType(1, 1.0f, "test");
+      SimpleUserType[] retObj = endpoint.echoArrayOfSimpleUserType(array);
+      assertEquals(array[0].getS()+array[0].getF()+array[0].getI(), retObj[0].getS()+retObj[0].getF()+retObj[0].getI());
+   }
 
-    public void testGetOrder() throws Exception
-    {
-        Order order = endpoint.getOrder(50,1);
-        assertEquals(50,order.getLineItems().length);
-    }
+   public void testEchoSynthetic() throws Exception
+   {
+      Synthetic synthetic = new Synthetic("test", new SimpleUserType(1, 1.0f, "test"), "test".getBytes());
+      Synthetic retObj = endpoint.echoSynthetic(synthetic);
+      assertEquals(synthetic.getS()+synthetic.getSut().getS()+synthetic.getSut().getF()+synthetic.getSut().getI(), retObj.getS()+retObj.getSut().getS()+retObj.getSut().getF()+retObj.getSut().getI());
+   }
+
+   public void testGetOrder() throws Exception
+   {
+      Order order = endpoint.getOrder(50,1);
+      assertEquals(50,order.getLineItems().length);
+   }
 }




More information about the jbossws-commits mailing list