ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gregory A. Payne" <kgpa...@earthlink.net>
Subject Problem with java task and JUnit on Linux
Date Tue, 06 Feb 2001 00:28:55 GMT
Hello,

I am trying to use Ant 1.2 with JUnit 3.5 (on linux) with the java task
(since the documention on the junit task says it will not work with
JUnit3.5).  I am trying to get the example from following article to
work:

    http://www-106.ibm.com/developerworks/library/j-ant/?dwzone=java

Which has sample code located at:

    ftp://www6.software.ibm.com/software/developer/library/antsample.zip

The problem is in the following part of the build file:

    <target name="runtests" depends="compiletests" if="junit.present">
        <java fork="yes" classname="junit.textui.TestRunner"
            taskname="junit" failonerror="true">
            <arg value="test.com.company.AllJUnitTests"/>
            <classpath>
                <pathelement location="build/lib/${app.name}.jar" />
                <pathelement location="build/testcases" />
                <pathelement path="" />
                <pathelement path="${java.class.path}" />
            </classpath>
        </java>
    </target>

I have tried using JDK1.2.2 and 1.3.  If the fork property is set to
"no", everything seems to work fine.  If the fork property is set to
"yes", I get the following result:

Searching for build.xml ...
Buildfile: /home/greg/antjunit/sample/build.xml

JUNIT:

compile:

jar:

compiletests:

runtests:

BUILD FAILED

/home/greg/antjunit/sample/build.xml:41: java.io.IOException: java:
cannot execute
java.io.IOException: java: cannot execute
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:137)
        at java.lang.Runtime.execInternal(Native Method)
        at java.lang.Runtime.exec(Runtime.java:551)
        at java.lang.reflect.Method.invoke(Native Method)
        at
org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java)

        at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java)
        at org.apache.tools.ant.taskdefs.Java.run(Java.java)
        at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java)
        at org.apache.tools.ant.taskdefs.Java.execute(Java.java)
        at org.apache.tools.ant.Target.execute(Target.java)
        at org.apache.tools.ant.Project.runTarget(Project.java)
        at org.apache.tools.ant.Project.executeTarget(Project.java)
        at org.apache.tools.ant.Project.executeTargets(Project.java)
        at org.apache.tools.ant.Main.runBuild(Main.java)
        at org.apache.tools.ant.Main.main(Main.java)

Total time: 2 seconds

Any help would be appreciated.

Thanks,
Greg


Mime
View raw message