From 31cc48c6f70b8c24f79aa5f17f80c32f8480e2f9 Mon Sep 17 00:00:00 2001
From: Stefan Bodewig
since Ant 1.6.
+The location of modules can be specified using this PATH like structure.
+The modulepath requires fork to be set to true.
+
+
since Ant 1.10
+ +The location of modules that replace upgradeable modules in the runtime image
+can be specified using this PATH like structure.
+The upgrademodulepath requires fork to be set to true.
+
+
since Ant 1.10
+The results of the tests can be printed in different
@@ -796,7 +811,47 @@ the single <test/> will run. So only the failing test cases a
The two nested formatters are for displaying (for the user) and for updating the collector
class.
+ <junit fork="true"
+ jvm="${platform.java}">
+ <jvmarg value="-Xpatch:${module.name}=${build.test.classes}"/>
+ <jvmarg line="-addmods ${module.name}"/>
+ <jvmarg value="-XaddReads:${module.name}=ALL-UNNAMED"/>
+ <jvmarg value="-XaddExports:${module.name}/my.test=ALL-UNNAMED"/>
+ <classpath>
+ <pathelement path="${libs.junit}"/>
+ </classpath>
+ <modulepath>
+ <pathelement path="${modules}:${build.classes}"/>
+ </modulepath>
+ <formatter type="plain"/>
+ <test name="my.test.TestCase"/>
+ </junit>
+
+Runs my.test.TestCase as a white-box test in the forked VM given by the platform.java property.
+The junit library is a part of an unnamed module while the tested project and required modules are on the module path. The tests
+do not have module-info file and are executed in the project module given by module.name property.
+The -Xpatch java option executes the tests built into ${build.test.classes} in a module given
+by module.name property.
+The -addmods java option enables the tested module.
+The -XaddReads java option makes the unnamed module containing the junit readable by tested module.
+The -XaddExports java option makes the non-exported test package my.test accessible from the unnamed module containing the junit.
+
+ <junit fork="true"
+ jvm="${platform.java}">
+ <jvmarg line="-addmods ${test.module.name}"/>
+ <jvmarg value="-XaddExports:${test.module.name}/my.test=junit,ALL-UNNAMED"/>
+ <modulepath>
+ <pathelement path="${modules}:${build.classes}:${libs.junit}"/>
+ </modulepath>
+ <formatter type="plain"/>
+ <test name="my.test.TestCase"/>
+ </junit>
+
+Runs my.test.TestCase as a black-box test in the forked VM given by the platform.java property.
+The junit library is used as an automatic module. The tests module-info requires the tested module and junit.
+The -addmods java option enables the test module.
+The -XaddExports java option makes the non-exported test package my.test accessible from the junit module and Ant's test runner.
+Another possibility is to export the test package in the tests module-info by exports my.test directive.