Browse Source

Maybe java simply isn't on the PATH on the Jenkins boxes

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1310667 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 13 years ago
parent
commit
22f08c2960
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      src/tests/antunit/taskdefs/exec/exec-test.xml

+ 10
- 2
src/tests/antunit/taskdefs/exec/exec-test.xml View File

@@ -630,16 +630,24 @@
<target name="testDoesntWaitForChildren" <target name="testDoesntWaitForChildren"
description="https://issues.apache.org/bugzilla/show_bug.cgi?id=5003"> description="https://issues.apache.org/bugzilla/show_bug.cgi?id=5003">
<condition property="java"
value="${java.home}/bin/javaw.exe"
else="${java.home}/bin/java">
<os family="dos"/>
</condition>
<mkdir dir="${input}/org/example"/> <mkdir dir="${input}/org/example"/>
<pathconvert dirsep="/" property="out"> <pathconvert dirsep="/" property="out">
<path location="${output}"/> <path location="${output}"/>
</pathconvert> </pathconvert>
<pathconvert dirsep="/" property="javaP">
<path location="${java}"/>
</pathconvert>
<echo file="${input}/org/example/CallHello.java"><![CDATA[ <echo file="${input}/org/example/CallHello.java"><![CDATA[
package org.example; package org.example;
public class CallHello { public class CallHello {
public static void main(String[] args) public static void main(String[] args)
throws Exception { throws Exception {
Runtime.getRuntime().exec("java -cp ${out} org.example.Hello");
Runtime.getRuntime().exec("${javaP} -cp ${out} org.example.Hello");
Thread.sleep(1 * 1000); Thread.sleep(1 * 1000);
System.out.println("finished"); System.out.println("finished");
} }
@@ -658,7 +666,7 @@ public class Hello {
}]]></echo> }]]></echo>
<mkdir dir="${output}"/> <mkdir dir="${output}"/>
<javac srcdir="${input}" destdir="${output}"/> <javac srcdir="${input}" destdir="${output}"/>
<exec executable="java" failonerror="true">
<exec executable="${java}" failonerror="true">
<arg line="-cp ${output} org.example.CallHello"/> <arg line="-cp ${output} org.example.CallHello"/>
</exec> </exec>
<au:assertLogContains text="finished"/> <au:assertLogContains text="finished"/>


Loading…
Cancel
Save