summaryrefslogtreecommitdiff
path: root/src/main/org/apache/tools/ant
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/org/apache/tools/ant')
-rw-r--r--src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/ForkDefinition.java18
-rw-r--r--src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/StandaloneLauncher.java3
2 files changed, 16 insertions, 5 deletions
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/ForkDefinition.java b/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/ForkDefinition.java
index bda3381db..c5c95cc0d 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/ForkDefinition.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/ForkDefinition.java
@@ -41,7 +41,7 @@ import java.io.File;
public class ForkDefinition {
private boolean includeAntRuntimeLibraries = true;
- private boolean includeJunitPlatformLibraries = true;
+ private boolean includeJUnitPlatformLibraries = true;
private final CommandlineJava commandLineJava;
private final Environment env = new Environment();
@@ -69,6 +69,14 @@ public class ForkDefinition {
return this.timeout;
}
+ public void setIncludeJUnitPlatformLibraries(final boolean include) {
+ this.includeJUnitPlatformLibraries = include;
+ }
+
+ public void setIncludeAntRuntimeLibraries(final boolean include) {
+ this.includeAntRuntimeLibraries = include;
+ }
+
public Commandline.Argument createJvmArg() {
return this.commandLineJava.createVmArgument();
}
@@ -121,19 +129,23 @@ public class ForkDefinition {
addAntRuntimeResourceSource(antRuntimeResourceSources, task, toResourceName(AntMain.class));
addAntRuntimeResourceSource(antRuntimeResourceSources, task, toResourceName(Task.class));
addAntRuntimeResourceSource(antRuntimeResourceSources, task, toResourceName(JUnitLauncherTask.class));
+ } else {
+ task.log("Excluding Ant runtime libraries from forked JVM classpath", Project.MSG_DEBUG);
}
-
- if (this.includeJunitPlatformLibraries) {
+ if (this.includeJUnitPlatformLibraries) {
// platform-engine
addAntRuntimeResourceSource(antRuntimeResourceSources, task, toResourceName(TestEngine.class));
// platform-launcher
addAntRuntimeResourceSource(antRuntimeResourceSources, task, toResourceName(LauncherFactory.class));
// platform-commons
addAntRuntimeResourceSource(antRuntimeResourceSources, task, toResourceName(Testable.class));
+ } else {
+ task.log("Excluding JUnit platform libraries from forked JVM classpath", Project.MSG_DEBUG);
}
final Path classPath = cmdLine.createClasspath(project);
classPath.createPath().append(antRuntimeResourceSources);
+
return cmdLine;
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/StandaloneLauncher.java b/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/StandaloneLauncher.java
index 8f43da373..69a1556c8 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/StandaloneLauncher.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/StandaloneLauncher.java
@@ -98,7 +98,6 @@ public class StandaloneLauncher {
i = i + numArgsConsumed;
}
-
launchDefinition.setTestExecutionContext(forkedExecution);
final LauncherSupport launcherSupport = new LauncherSupport(launchDefinition);
try {
@@ -106,8 +105,8 @@ public class StandaloneLauncher {
} catch (Throwable t) {
if (launcherSupport.hasTestFailures()) {
System.exit(Constants.FORK_EXIT_CODE_TESTS_FAILED);
- throw t;
}
+ throw t;
}
if (launcherSupport.hasTestFailures()) {
System.exit(Constants.FORK_EXIT_CODE_TESTS_FAILED);