dlr         02/02/19 14:41:37

  Modified:    src/test/org/apache/xmlrpc ClientServerRpcTest.java
  Log:
  Added timing information to testServer().
  
  Revision  Changes    Path
  1.7       +14 -2     xml-rpc/src/test/org/apache/xmlrpc/ClientServerRpcTest.java
  
  Index: ClientServerRpcTest.java
  ===================================================================
  RCS file: /home/cvs/xml-rpc/src/test/org/apache/xmlrpc/ClientServerRpcTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -u -r1.6 -r1.7
  --- ClientServerRpcTest.java  19 Feb 2002 05:00:16 -0000      1.6
  +++ ClientServerRpcTest.java  19 Feb 2002 22:41:37 -0000      1.7
  @@ -68,7 +68,7 @@
    * Tests XmlRpc run-time.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Daniel Rall</a>
  - * @version $Id: ClientServerRpcTest.java,v 1.6 2002/02/19 05:00:16 dlr Exp $
  + * @version $Id: ClientServerRpcTest.java,v 1.7 2002/02/19 22:41:37 dlr Exp $
    */
   public class ClientServerRpcTest
       extends TestCase 
  @@ -79,6 +79,11 @@
       private static final String HANDLER_NAME = "TestHandler";
   
       /**
  +     * The number of RPCs to make for each test.
  +     */
  +    private static final int NBR_REQUESTS = 1000;
  +
  +    /**
        * The value to use in our request parameter.
        */
       private static final String REQUEST_PARAM_VALUE = "foobar";
  @@ -165,7 +170,8 @@
       {
           try
           {
  -            for (int i = 0; i < 300; i++)
  +            long time = System.currentTimeMillis();
  +            for (int i = 0; i < NBR_REQUESTS; i++)
               {
                   InputStream in =
                       new ByteArrayInputStream(RPC_REQUEST.getBytes());
  @@ -173,6 +179,11 @@
                   assertTrue("Response did not contain " + REQUEST_PARAM_XML,
                              response.indexOf(REQUEST_PARAM_XML) != -1);
               }
  +            time = System.currentTimeMillis() - time;
  +            System.out.println("Total time elapsed for " + NBR_REQUESTS +
  +                               " iterations: " + time + " milliseconds");
  +            System.out.println("Average time: " + (time / NBR_REQUESTS) +
  +                               " milliseconds");
           }
           catch (Exception e)
           {
  @@ -186,6 +197,7 @@
        */
       public void testRpc()
       {
  +        int nbrIterations = 300;
           try
           {
               throw new Exception("testRpc() not implemented");
  
  
  


Reply via email to