ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/rjunit ClientElement.java ResultFormatterElement.java ServerElement.java
Date Sun, 10 Feb 2002 22:25:44 GMT
sbailliez    02/02/10 14:25:44

  Modified:    proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/rjunit
                        ClientElement.java ResultFormatterElement.java
                        ServerElement.java
  Log:
  Code cleanup
  
  Revision  Changes    Path
  1.4       +4 -3      jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/rjunit/ClientElement.java
  
  Index: ClientElement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/rjunit/ClientElement.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ClientElement.java	3 Feb 2002 13:52:31 -0000	1.3
  +++ ClientElement.java	10 Feb 2002 22:25:44 -0000	1.4
  @@ -163,8 +163,9 @@
        * @return all collected tests specified with test elements.
        */
       protected Enumeration collectTests() {
  -        Enumeration[] tests = new Enumeration[testCollectors.size()];
  -        for (int i = 0; i < testCollectors.size(); i++) {
  +        final int count = testCollectors.size();
  +        final Enumeration[] tests = new Enumeration[count];
  +        for (int i = 0; i < count; i++) {
               TestCollector te = (TestCollector) testCollectors.get(i);
               tests[i] = te.collectTests();
           }
  @@ -241,7 +242,7 @@
   
       /** classpath to be set for running tests */
       public Path createClasspath() {
  -        return cmd.createClasspath(project);
  +        return cmd.createClasspath(getProject());
       }
   
       /** add a single test element */
  
  
  
  1.3       +8 -7      jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/rjunit/ResultFormatterElement.java
  
  Index: ResultFormatterElement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/rjunit/ResultFormatterElement.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ResultFormatterElement.java	10 Feb 2002 20:33:40 -0000	1.2
  +++ ResultFormatterElement.java	10 Feb 2002 22:25:44 -0000	1.3
  @@ -53,17 +53,14 @@
    */
   package org.apache.tools.ant.taskdefs.optional.rjunit;
   
  -import java.io.OutputStream;
   import java.io.File;
  +import java.io.OutputStream;
   import java.util.Properties;
   import java.util.StringTokenizer;
   import java.util.Vector;
   
   import org.apache.tools.ant.BuildException;
  -import org.apache.tools.ant.taskdefs.optional.rjunit.formatter.BriefFormatter;
   import org.apache.tools.ant.taskdefs.optional.rjunit.formatter.Formatter;
  -import org.apache.tools.ant.taskdefs.optional.rjunit.formatter.XMLFormatter;
  -import org.apache.tools.ant.taskdefs.optional.rjunit.formatter.PlainFormatter;
   import org.apache.tools.ant.types.EnumeratedAttribute;
   
   /**
  @@ -178,8 +175,8 @@
   
           // create properties from parameters
           Properties props = new Properties();
  -        for (int i = 0; i < params.size(); i++){
  -            Parameter param = (Parameter)params.elementAt(i);
  +        for (int i = 0; i < params.size(); i++) {
  +            Parameter param = (Parameter) params.elementAt(i);
               props.put(param.getName(), param.getValue());
           }
           // it is assumed here that the filters are chaining til the
  @@ -194,7 +191,11 @@
        */
       public final static class TypeAttribute extends EnumeratedAttribute {
           private final static String[] VALUES = {"plain", "xml", "brief"};
  -        private final static String[] CLASSNAMES = {PlainFormatter.class.getName(), XMLFormatter.class.getName(),
BriefFormatter.class.getName()};
  +        private final static String[] CLASSNAMES = {
  +            "org.apache.tools.ant.taskdefs.optional.rjunit.formatter.PlainFormatter",
  +            "org.apache.tools.ant.taskdefs.optional.rjunit.formatter.XMLFormatter",
  +            "org.apache.tools.ant.taskdefs.optional.rjunit.formatter.BriefFormatter"
  +        };
   
           public String[] getValues() {
               return VALUES;
  
  
  
  1.3       +2 -1      jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/rjunit/ServerElement.java
  
  Index: ServerElement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/rjunit/ServerElement.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServerElement.java	3 Feb 2002 13:52:31 -0000	1.2
  +++ ServerElement.java	10 Feb 2002 22:25:44 -0000	1.3
  @@ -110,9 +110,10 @@
           // and run it. It will stop once a client has finished.
           try {
               server.start(false); // do not loop
  -            server.shutdown();
           } catch (IOException e) {
               throw new BuildException(e);
  +        } finally {
  +            server.shutdown();
           }
       }
   
  
  
  

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


Mime
View raw message