ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Nordlund <peter.nordl...@lentus.se>
Subject Property dir in junit task fails. (Was Re: property dir needed in java and junit tasks)
Date Thu, 21 Sep 2000 08:14:32 GMT
Thanks for the info!

I tried the java task with the dir property it worked fine.

When I tried the junit task, I got an exception.
Have you tried it out?


See excerpt from the debug output below.

I was using ant 2000-09-20
peternl:twisst>>java -version
java version "1.2.2"
Classic VM (build Linux_JDK_1.2.2_RC4, native threads, sunwjit)
peternl:twisst>>uname -a
Linux peternl 2.2.16-3 #4 Wed Aug 23 15:54:58 CEST 2000 i686 unknown


------------------   
/home/petern/java/mysql/twisst-codebook/twisst/src/java/se/lentus/lentus/questionnaire/DiffTest.java
   
/home/petern/java/mysql/twisst-codebook/twisst/src/java/se/lentus/lentus/questionnaire/OutOfMemTest.java
   
/home/petern/java/mysql/twisst-codebook/twisst/src/java/se/lentus/lentus/questionnaire/QuestionnaireTest.java
   
/home/petern/java/mysql/twisst-codebook/twisst/src/java/se/lentus/lentus/questionnaire/ValidateBoxTest.java
   
/home/petern/java/mysql/twisst-codebook/twisst/src/java/se/lentus/lentus/questionnaire/ValidationTest.java

 +User task: junit    
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask
    [junit] Running se.lentus.lentus.questionnaire.ValidateBoxTest
    [junit] Executing: java -classpath
/net/analytik/dr2/development/java/packages/ant/2000-08-24/lib/ant.jar:/net/analytik/dr2/development/java/packages/xalan/1.2.D02/bsf.jar:/net/analytik/dr2/development/java/packages/xalan/1.2.D02/bsfengines.jar:/net/analytik/dr2/development/java/packages/xalan/1.2.D02/xalan.jar:/net/analytik/dr2/development/java/packages/xalan/1.2.D02/xerces.jar:/net/analytik/dr2/development/java/packages/junit/3.2/junit.jar:/net/analytik/dr2/development/java/packages/junit/3.2:/net/analytik/dr2/development/java/packages/jdbc/mysql/2.0.2/mysql.jar:/home/petern/java/mysql/twisst-codebook/twisst-build/classes
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner
se.lentus.lentus.questionnaire.ValidateBoxTest haltOnError=false
haltOnFailure=false
formatter=org.apache.tools.ant.taskdefs.optional.junit.SummaryJUnitResultFormatter
formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter,/home/petern/java/mysql/twisst-codebook/twisst-build/result.txt
formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,/home/petern/java/mysql/twisst-codebook/twisst-build/result.xml

BUILD FAILED

java.lang.NullPointerException
	at java.lang.Runtime.exec(Runtime.java, Compiled Code)
	at org.apache.tools.ant.taskdefs.Execute.exec(Execute.java, Compiled
Code)
	at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java, Compiled
Code)
	at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java,
Compiled Code)
	at org.apache.tools.ant.Target.execute(Target.java, Compiled Code)
	at org.apache.tools.ant.Project.runTarget(Project.java, Compiled Code)
	at org.apache.tools.ant.Project.executeTarget(Project.java, Compiled
Code)
	at org.apache.tools.ant.Project.executeTargets(Project.java, Compiled
Code)
	at org.apache.tools.ant.Main.runBuild(Main.java, Compiled Code)
	at org.apache.tools.ant.Main.main(Main.java, Compiled Code)

Total time: 9 seconds

-----------------
Excerpt form my build-file:
 <target name="junittestvalidation" depends="test">
     <junit printsummary="yes" haltonfailure="yes" fork="yes"
            dir="${log.dir}">
      <classpath>
           <pathelement path="${classpath.ant}" />
           <pathelement path="${classpath.xalan}" />
           <pathelement path="${classpath.junit}" />
           <pathelement location="${classpath.jdbc.mysql}" />
           <pathelement location="${deploy1.home}/classes" />
      </classpath>
      <formatter type="plain" />

      <test name="se.lentus.lentus.questionnaire.ValidateBoxTest" 
       haltonfailure="no" outfile="${test.outfile}" >
          <formatter type="xml" />
      </test>
     </junit>
  </target>










Stefan Bodewig wrote:
> 
> >>>>> "PN" == Peter Nordlund <peter.nordlund@lentus.se> writes:
> 
>  PN> I feel a need for a "dir" attribute to both the java task and
>  PN> junit task.
> 
> Funy that <java> already had this one, it was just lacking
> documentation. Added one for <junit> as well.
> 
> Stefan

Mime
View raw message