Browse Source

Allow tests (and tasks) to run when java is not in the path

PR:	15998


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273891 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 22 years ago
parent
commit
d957fddf76
2 changed files with 3 additions and 2 deletions
  1. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java
  2. +1
    -1
      src/testcases/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java

+ 2
- 1
src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java View File

@@ -67,6 +67,7 @@ import org.apache.tools.ant.taskdefs.LogStreamHandler;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.CommandlineJava;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.util.JavaEnvUtils;

/**
* Invokes the ANTLR Translator generator on a grammar file.
@@ -110,7 +111,7 @@ public class ANTLR extends Task {
private File workingdir = null;

public ANTLR() {
commandline.setVm("java");
commandline.setVm(JavaEnvUtils.getJdkExecutable("java"));
commandline.setClassname("antlr.Tool");
}



+ 1
- 1
src/testcases/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java View File

@@ -108,7 +108,7 @@ public class ExecuteWatchdogTest extends TestCase {

private Process getProcess(int timetorun) throws Exception {
String[] cmdArray = {
"java", "-classpath", TEST_CLASSPATH,
JavaEnvUtils.getJdkExecutable("java"), "-classpath", TEST_CLASSPATH,
TimeProcess.class.getName(), String.valueOf(timetorun)
};
//System.out.println("Testing with classpath: " + System.getProperty("java.class.path"));


Loading…
Cancel
Save