From ffb80b688a12d4e60ab4be466ec0b3e396bb0078 Mon Sep 17 00:00:00 2001
From: Jaikiran Pai listener elements.
+ The fork nested element can be used to run the test in a newly forked + JVM. +
+Define a number of tests based on pattern matching.
@@ -514,6 +519,115 @@ elements. +
+ The fork nested element can be used to run the tests in a newly forked
+ JVM. All tests that are part of this testclasses element will run in one single
+ instance of the newly forked JVM.
+
Since Ant 1.10.6
+ +Tests launched using thejunitlauncher task, by default, run in the same JVM that
+initiates the task. This behaviour can be changed using the fork element.
+The fork element and its attributes define the characteristics of
+the new JVM instance that will be created to launch the tests.
+
+| Attribute | +Description | +Required | +
|---|---|---|
| dir | +The user working directory that will be used for the forked JVM | +No | +
| timeout | +A value in milliseconds, specifying a maximum duration, the test + running in this forked JVM is allowed to run. If the test runs longer + than this configured value, then the JVM is killed | +No | +
fork element allows the following nested elements:
+
+
+ Additional JVM arguments may be passed to the forked JVM via the jvmarg elements.
+ For example:
+
+ <fork ...> + <jvmarg value="-Djava.compiler=NONE"/> + ... + </fork> ++ + +
+ jvmarg allows all attributes described in Command-line Arguments
+
+ The sysproperty elements allow passing Java system properties to the forked JVM:
+
+ <fork> + <sysproperty key="greeting" value="hello world"/> + ... + </fork> ++ +
+ The attributes for this element are the same as for environment variables +
+ ++ You can specify a set of properties to be used as system properties with + syspropertyset(s) +
+ + +
+ It is possible to specify environment variables to pass to the forked JVM via
+ nested env elements. For a description of the env
+ element's attributes, see the description in the exec task.
+
+ The location of Java modules can be specified using the modulepath element,
+ which is a path-like structure.
+
+<fork> + <modulepath> + <pathelement location="lib"/> + <pathelement location="dist/test.jar"/> + </modulepath> + ... +</fork> ++ +
+ The location of Java modules, that replace upgradeable modules in the runtime, can be specified
+ using the upgrademodulepath element, which is a path-like
+ structure.
+