bodewig 2004/04/27 00:44:48
Modified: . WHATSNEW build.xml
docs/manual/OptionalTasks junit.html
src/main/org/apache/tools/ant/taskdefs/optional/junit
JUnitTask.java
Log:
forkstyle -> forkmode
Revision Changes Path
1.602 +5 -0 ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/ant/WHATSNEW,v
retrieving revision 1.601
retrieving revision 1.602
diff -u -r1.601 -r1.602
--- WHATSNEW 26 Apr 2004 19:23:53 -0000 1.601
+++ WHATSNEW 27 Apr 2004 07:44:46 -0000 1.602
@@ -161,6 +161,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.418 +2 -2 ant/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/ant/build.xml,v
retrieving revision 1.417
retrieving revision 1.418
diff -u -r1.417 -r1.418
--- build.xml 23 Apr 2004 10:03:49 -0000 1.417
+++ build.xml 27 Apr 2004 07:44:46 -0000 1.418
@@ -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"/>
<!--
@@ -1429,7 +1429,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"/>
1.35 +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.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- junit.html 20 Apr 2004 07:27:21 -0000 1.34
+++ junit.html 27 Apr 2004 07:44:47 -0000 1.35
@@ -68,6 +68,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
+ "perTest" (the default), "perBatch" and
+ "once". "once" creates only a single Java VM
+ for all tests while "perTest" creates a new VM for each
+ TestCase class. "perBatch" creates a VM for each nested
+ <code><batchtest></code> and one collecting all nested
+ <code><test></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 "once", 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.</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>
1.99 +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.98
retrieving revision 1.99
diff -u -r1.98 -r1.99
--- JUnitTask.java 20 Apr 2004 06:52:48 -0000 1.98
+++ JUnitTask.java 27 Apr 2004 07:44:47 -0000 1.99
@@ -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;
}
/**
@@ -641,11 +641,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);
@@ -1379,7 +1379,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
@@ -1394,11 +1394,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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]