ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 27014] New: - failureproperty parameter in JUnit task does not work when testcase fails
Date Tue, 17 Feb 2004 19:59:24 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27014>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27014

failureproperty parameter in JUnit task does not work when testcase fails

           Summary: failureproperty parameter in JUnit task does not work
                    when testcase fails
           Product: Ant
           Version: 1.6.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: jfischer@voiceobjects.com


A task depending on the failure property throws the following exception (only 
displayed when running ANT in debug mode) when the preceding JUnit task fails:

BUILD FAILED
D:\cvslocal\OVAP\1.0\Build\script\build.xml:677: Following error occured while 
executing this line
D:\cvslocal\OVAP\1.0\Build\script\test.xml:188: if=junit-test-failed
	at org.apache.tools.ant.ProjectHelper.addLocationToBuildException
(ProjectHelper.java:537)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:385)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
	at org.apache.tools.ant.Task.perform(Task.java:364)
	at org.apache.tools.ant.Target.execute(Target.java:301)
	at org.apache.tools.ant.Target.performTasks(Target.java:328)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
	at org.apache.tools.ant.Main.runBuild(Main.java:632)
	at org.apache.tools.ant.Main.startAnt(Main.java:183)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
Caused by: D:\cvslocal\OVAP\1.0\Build\script\test.xml:188: if=junit-test-failed
	at org.apache.tools.ant.taskdefs.Exit.execute(Exit.java:105)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
	at org.apache.tools.ant.Task.perform(Task.java:364)
	at org.apache.tools.ant.Target.execute(Target.java:301)
	at org.apache.tools.ant.Target.performTasks(Target.java:328)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:383)
	... 10 more
--- Nested Exception ---
D:\cvslocal\OVAP\1.0\Build\script\test.xml:188: if=junit-test-failed
	at org.apache.tools.ant.taskdefs.Exit.execute(Exit.java:105)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
	at org.apache.tools.ant.Task.perform(Task.java:364)
	at org.apache.tools.ant.Target.execute(Target.java:301)
	at org.apache.tools.ant.Target.performTasks(Target.java:328)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:383)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
	at org.apache.tools.ant.Task.perform(Task.java:364)
	at org.apache.tools.ant.Target.execute(Target.java:301)
	at org.apache.tools.ant.Target.performTasks(Target.java:328)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
	at org.apache.tools.ant.Main.runBuild(Main.java:632)
	at org.apache.tools.ant.Main.startAnt(Main.java:183)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)

The JUnit task looks as follows:
<target name="execJUnitTest" depends="init">
<junit fork="yes" haltonerror="no" haltonfailure="no" 
printsummary="withOutAndErr" dir="${localTest}" failureproperty="junit-test-
failed"> ..... </junit> ... </target>

Depending task:
<target name="sendJUnitFailureMail" if="junit-test-failed"> ... </target>

This task is called from the main build file:
<target name="junit-test" depends="execJUnitTest, sendJUnitFailureMail">
<fail if="junit-test-failed"/>
</target>

The line number in the error message (test.xml:188) points to a line containing 
a XML comment.

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


Mime
View raw message