ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias P. <groups.mpat...@gmx.de>
Subject Error in [if]-task
Date Thu, 05 Jun 2003 08:47:51 GMT
Hi everyone,

in my junit-target i am using the following if-task:

  <target name="test" depends="" description="Run the unit tests."
          unless="avoid.unittests">
    <junit printsummary="false"
           errorProperty="test.failed"
           failureProperty="test.failed">
      <classpath>     
        <path refid="test.classpath"/>
      </classpath>
      <formatter type="plain" usefile="false"/>     
      <formatter type="xml" usefile="true"/>
      <batchtest todir="${test.report.data.dir}" >
        <fileset dir="${test.build.common.dir}" includes="**/*Test.class"/> 
   
        <fileset dir="${test.build.server.dir}" includes="**/*Test.class"/> 
   
        <fileset dir="${test.build.client.dir}" includes="**/*Test.class"/> 
   
      </batchtest>
    </junit>

    <junitreport todir="${test.report.data.dir}">
      <fileset dir="${test.report.data.dir}">
        <include name="TEST-*.xml"/>
      </fileset>
      <report format="frames" todir="${test.report.result.dir}"/>
    </junitreport>

    <if>
      <istrue value="${test.fails.build}"/>
      <then>
        <fail message="Test failed. Check log an/or reports."
if="test.failed"/>
      </then>
    </if>
   
  </target>

This is working well for me. Build is successfull when test.fails.build is
false and fails if it is true. But in the logs i got the following message
when test.fails.build is true:

--snip--
[junitreport] Transform time: 1322ms
       [if] Error in class net.sf.antcontrib.logic.IfTask

BUILD FAILED
file:D:/MIF/Projekte/MIFJavaBuild/Java/build.xml:271: Test failed. Check log
an/or reports.
	at org.apache.tools.ant.taskdefs.Exit.execute(Exit.java:104)
	at org.apache.tools.ant.Task.perform(Task.java:341)
	at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:117)
	at org.apache.tools.ant.Task.perform(Task.java:341)
	at net.sf.antcontrib.logic.IfTask.execute(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:147)
	at org.apache.tools.ant.Task.perform(Task.java:341)
	at org.apache.tools.ant.Target.execute(Target.java:309)
	at org.apache.tools.ant.Target.performTasks(Target.java:336)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
	at org.apache.tools.ant.Main.runBuild(Main.java:609)
	at org.apache.tools.ant.Main.start(Main.java:196)
	at org.apache.tools.ant.Main.main(Main.java:235)
--snip--

Why does the if-task write the above error-message in verbose-mode. What can
i improve?

Thanks,
Matthias

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
Bitte l├Ącheln! Fotogalerie online mit GMX ohne eigene Homepage!


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message