Browse Source

Make Watchdog for JUnitLauncherTask customizable.

This closes #147 pull request at github/apache/ant repo.
master
Aleksei Zotov Jaikiran Pai 4 years ago
parent
commit
e6ab7d025f
4 changed files with 22 additions and 1 deletions
  1. +1
    -0
      CONTRIBUTORS
  2. +11
    -0
      WHATSNEW
  3. +4
    -0
      contributors.xml
  4. +6
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/confined/JUnitLauncherTask.java

+ 1
- 0
CONTRIBUTORS View File

@@ -8,6 +8,7 @@ Adam Sotona
Adrian Nistor
Adrien Grand
Aleksandr Ishutin
Alex
Alex Rosen
Alexander Grund
Alexei Yudichev


+ 11
- 0
WHATSNEW View File

@@ -1,6 +1,17 @@
Changes from Ant 1.10.10 TO Ant 1.10.11
======================================

Fixed bugs:
-----------


Other changes:
--------------

* org.apache.tools.ant.taskdefs.optional.junitlauncher.confined.JUnitLauncherTask now
has a new protected createExecuteWatchdog() method for allowing it to be overriden.
Github Pull Request #147


Changes from Ant 1.10.9 TO Ant 1.10.10
======================================


+ 4
- 0
contributors.xml View File

@@ -62,6 +62,10 @@
<first>Aleksandr</first>
<last>Ishutin</last>
</name>
<name>
<first>Alex</first>
<last></last>
</name>
<name>
<first>Alex</first>
<last>Rosen</last>


+ 6
- 1
src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/confined/JUnitLauncherTask.java View File

@@ -344,7 +344,8 @@ public class JUnitLauncherTask extends Task {
private int executeForkedTest(final ForkDefinition forkDefinition, final CommandlineJava commandlineJava) {
final LogOutputStream outStream = new LogOutputStream(this, Project.MSG_INFO);
final LogOutputStream errStream = new LogOutputStream(this, Project.MSG_WARN);
final ExecuteWatchdog watchdog = forkDefinition.getTimeout() > 0 ? new ExecuteWatchdog(forkDefinition.getTimeout()) : null;
final ExecuteWatchdog watchdog = forkDefinition.getTimeout() > 0
? createExecuteWatchdog(forkDefinition.getTimeout()) : null;
final Execute execute = new Execute(new PumpStreamHandler(outStream, errStream), watchdog);
execute.setCommandline(commandlineJava.getCommandline());
execute.setAntRun(getProject());
@@ -365,6 +366,10 @@ public class JUnitLauncherTask extends Task {
return (watchdog != null && watchdog.killedProcess()) ? Constants.FORK_EXIT_CODE_TIMED_OUT : exitCode;
}

protected ExecuteWatchdog createExecuteWatchdog(long timeout) {
return new ExecuteWatchdog(timeout);
}

private java.nio.file.Path newLaunchDefinitionXml() {
return FileUtils.getFileUtils()
.createTempFile(getProject(), null, ".xml", null, true, true)


Loading…
Cancel
Save