avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test AbstractHelloTestCase.java
Date Sun, 25 Aug 2002 20:52:14 GMT
hammant     2002/08/25 13:52:14

  Modified:    altrmi   ant.properties.sample build.xml default.properties
               altrmi/src/test/org/apache/excalibur/altrmi/test
                        AbstractHelloTestCase.java
  Log:
  User selectable number of iterations for testSpeed()
  
  Revision  Changes    Path
  1.4       +6 -1      jakarta-avalon-excalibur/altrmi/ant.properties.sample
  
  Index: ant.properties.sample
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/ant.properties.sample,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ant.properties.sample	8 Apr 2002 10:32:07 -0000	1.3
  +++ ant.properties.sample	25 Aug 2002 20:52:14 -0000	1.4
  @@ -47,3 +47,8 @@
   checkstyle.home=${base.path}/checkstyle-2.1
   checkstyle.lib=${checkstyle.home}
   checkstyle.jar=${checkstyle.lib}/checkstyle-all-2.1.jar
  +
  +# Stuff for AltRMI speed testing
  +# uncomment this if you want a different number of iterations for the sped test
  +
  +# speedtest.iterations=10
  
  
  
  1.34      +5 -1      jakarta-avalon-excalibur/altrmi/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/build.xml,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- build.xml	24 Aug 2002 11:39:05 -0000	1.33
  +++ build.xml	25 Aug 2002 20:52:14 -0000	1.34
  @@ -106,8 +106,12 @@
       <target name="compile-test" depends="compile, dependencies-test" description="Compiles
the source code">
           <mkdir dir="${build.testsrc}"/>
   
  +        <filter token="SPEEDTEST-ITERATIONS" value="${speedtest.iterations}"/>  

  +        
  +        <echo>Speed Test Iterations=${speedtest.iterations}</echo>
  +
           <!-- Copy over all of the tests applying test filters -->
  -        <copy todir="${build.testsrc}">
  +        <copy todir="${build.testsrc}" filtering="true">
               <fileset dir="${test.dir}"/>
           </copy>
   
  
  
  
  1.9       +3 -0      jakarta-avalon-excalibur/altrmi/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/default.properties,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- default.properties	8 Aug 2002 14:18:39 -0000	1.8
  +++ default.properties	25 Aug 2002 20:52:14 -0000	1.9
  @@ -83,4 +83,7 @@
   #  property indicating directory where all distribution archives are placed
   dist.base = distributions
   
  +# Stuff for AltRMI speed testing
  +
  +speedtest.iterations=10000
   
  
  
  
  1.3       +17 -2     jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/AbstractHelloTestCase.java
  
  Index: AbstractHelloTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/AbstractHelloTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractHelloTestCase.java	24 Aug 2002 10:05:23 -0000	1.2
  +++ AbstractHelloTestCase.java	25 Aug 2002 20:52:14 -0000	1.3
  @@ -117,9 +117,24 @@
           assertEquals("91", ((SimpleHelloTestServerImpl) testServer).getStoredState("boolean:hello3(short)"));
       }
   
  -    public void testSpeed() throws Exception {
  +    public void testSpeed() throws Exception
  +    {
   
  -        for (int i = 1; i < 10000; i++ ) {
  +        int iterations = 10000; // default
  +        String iterationsStr = "@SPEEDTEST-ITERATIONS@";
  +        try
  +        {
  +            iterations = Integer.parseInt(iterationsStr);
  +        }
  +        catch (NumberFormatException e)
  +        {
  +            // half expected.  The @SPEEDTEST-ITERATIONS@ thing above may be replaced by
the
  +            // the Ant task before the test is run.  However this may be run in a
  +            // IDE, in which case the test is not run.
  +        }
  +
  +
  +        for (int i = 1; i < iterations; i++ ) {
               testClient.testSpeed();
           }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message