ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/junit JUnitTask.java
Date Tue, 27 Apr 2004 07:45:48 GMT
bodewig     2004/04/27 00:45:48

  Modified:    .        Tag: ANT_16_BRANCH WHATSNEW build.xml
               docs/manual/OptionalTasks Tag: ANT_16_BRANCH junit.html
               src/main/org/apache/tools/ant/taskdefs/optional/junit Tag:
                        ANT_16_BRANCH JUnitTask.java
  Log:
  merge
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.503.2.88 +5 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.503.2.87
  retrieving revision 1.503.2.88
  diff -u -r1.503.2.87 -r1.503.2.88
  --- WHATSNEW	26 Apr 2004 19:20:24 -0000	1.503.2.87
  +++ WHATSNEW	27 Apr 2004 07:45:47 -0000	1.503.2.88
  @@ -114,6 +114,11 @@
   
   * New "pattern" attribute for <date> selector.
   
  +* <junit> has a new forkmode attribute that controls the number of
  +  Java VMs that get created when forking tests.  This allows you to
  +  run all tests in a single forked JVM reducing the overhead of VM
  +  creation a lot.  Bugzilla Report 24697.
  +
   Changes from Ant 1.6.0 to Ant 1.6.1
   ===================================
   
  
  
  
  1.392.2.25 +2 -2      ant/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/ant/build.xml,v
  retrieving revision 1.392.2.24
  retrieving revision 1.392.2.25
  diff -u -r1.392.2.24 -r1.392.2.25
  --- build.xml	16 Apr 2004 07:05:32 -0000	1.392.2.24
  +++ build.xml	27 Apr 2004 07:45:47 -0000	1.392.2.25
  @@ -53,7 +53,7 @@
     <property name="junit.filtertrace" value="off"/>
     <property name="junit.summary" value="no"/>
     <property name="test.haltonfailure" value="yes" />
  -  <property name="junit.forkstyle" value="once"/>
  +  <property name="junit.forkmode" value="once"/>
     <property name="unfiltered.files" value="**/*.gif,**/*.jpg,**/*.ico,**/*.pdf,**/*.zip"/>
   
     <!--
  @@ -1428,7 +1428,7 @@
   
       <junit printsummary="${junit.summary}" haltonfailure="${test.haltonfailure}"
              filtertrace="${junit.filtertrace}"
  -           fork="${junit.fork}" forkstyle="${junit.forkstyle}"
  +           fork="${junit.fork}" forkmode="${junit.forkmode}"
              failureproperty="tests.failed">
   <!--      <jvmarg value="-classic"/> -->
         <classpath refid="tests-classpath"/>
  
  
  
  No                   revision
  No                   revision
  1.30.2.5  +18 -0     ant/docs/manual/OptionalTasks/junit.html
  
  Index: junit.html
  ===================================================================
  RCS file: /home/cvs/ant/docs/manual/OptionalTasks/junit.html,v
  retrieving revision 1.30.2.4
  retrieving revision 1.30.2.5
  diff -u -r1.30.2.4 -r1.30.2.5
  --- junit.html	20 Apr 2004 07:29:36 -0000	1.30.2.4
  +++ junit.html	27 Apr 2004 07:45:47 -0000	1.30.2.5
  @@ -69,6 +69,24 @@
       <td align="center" valign="top">No; default is <code>off</code>.</td>
     </tr>
     <tr>
  +    <td valign="top">forkmode</td>
  +    <td valign="top">Controls how many Java Virtual Machines get
  +    created if you want to fork some tests.  Possible values are
  +    &quot;perTest&quot; (the default), &quot;perBatch&quot; and
  +    &quot;once&quot;.  &quot;once&quot; creates only a single Java VM
  +    for all tests while &quot;perTest&quot; creates a new VM for each
  +    TestCase class.  &quot;perBatch&quot; creates a VM for each nested
  +    <code>&lt;batchtest&gt;</code> and one collecting all nested
  +    <code>&lt;test&gt;</code>s.  Note that only tests with the same
  +    settings of <code>filtertrace</code>, <code>haltonerror</code>,
  +    <code>haltonfailure</code>, <code>errorproperty</code> and
  +    <code>failureproperty</code> can share a VM, so even if you set
  +    <code>forkmode</code> to &quot;once&quot;, Ant may have to create
  +    more than a single Java VM.  This attribute is ignored for tests
  +    that don't get forked into a new Java VM.  <em>since Ant 1.6.2</em></td>
  +    <td align="center" valign="top">No; default is <code>perTest</code>.</td>
  +  </tr>
  +  <tr>
       <td valign="top">haltonerror</td>
       <td valign="top">Stop the build process if an error occurs during the test
          run.</td>
  
  
  
  No                   revision
  No                   revision
  1.83.2.12 +10 -10    ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  
  Index: JUnitTask.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
  retrieving revision 1.83.2.11
  retrieving revision 1.83.2.12
  diff -u -r1.83.2.11 -r1.83.2.12
  --- JUnitTask.java	20 Apr 2004 06:53:29 -0000	1.83.2.11
  +++ JUnitTask.java	27 Apr 2004 07:45:47 -0000	1.83.2.12
  @@ -147,7 +147,7 @@
       private File tmpDir;
       private AntClassLoader classLoader = null;
       private Permissions perm = null;
  -    private ForkStyle forkStyle = new ForkStyle("perTest");
  +    private ForkMode forkMode = new ForkMode("perTest");
   
       private static final int STRING_BUFFER_SIZE = 128;
   
  @@ -295,8 +295,8 @@
        *
        * @since Ant 1.6.2
        */
  -    public void setForkStyle(ForkStyle style) {
  -        this.forkStyle = style;
  +    public void setForkMode(ForkMode mode) {
  +        this.forkMode = mode;
       }
   
       /**
  @@ -628,11 +628,11 @@
       public void execute() throws BuildException {
           List testLists = new ArrayList();
   
  -        boolean forkPerTest = forkStyle.getValue().equals(ForkStyle.PER_TEST);
  -        if (forkPerTest || forkStyle.getValue().equals(ForkStyle.ONCE)) {
  +        boolean forkPerTest = forkMode.getValue().equals(ForkMode.PER_TEST);
  +        if (forkPerTest || forkMode.getValue().equals(ForkMode.ONCE)) {
               testLists.addAll(executeOrQueue(getIndividualTests(),
                                               forkPerTest));
  -        } else { /* forkStyle.getValue().equals(ForkStyle.PER_BATCH) */
  +        } else { /* forkMode.getValue().equals(ForkMode.PER_BATCH) */
               final int count = batchTests.size();
               for (int i = 0; i < count; i++) {
                   BatchTest batchtest = (BatchTest) batchTests.elementAt(i);
  @@ -1366,7 +1366,7 @@
        * These are the different forking options
        * @since 1.6.2
        */
  -    public static final class ForkStyle extends EnumeratedAttribute {
  +    public static final class ForkMode extends EnumeratedAttribute {
   
           /**
            * fork once only
  @@ -1381,11 +1381,11 @@
            */
           public static final String PER_BATCH = "perBatch";
   
  -        public ForkStyle() {
  +        public ForkMode() {
               super();
           }
   
  -        public ForkStyle(String value) {
  +        public ForkMode(String value) {
               super();
               setValue(value);
           }
  
  
  

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


Mime
View raw message