Bug 43466 - Failure in tearDown does not result in a failed test run
Summary: Failure in tearDown does not result in a failed test run
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: AntUnit (show other bugs)
Version: unspecified
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-24 13:33 UTC by David Jackman
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments
Provides a patch for the code to fix this problem, including tests (30.52 KB, patch)
2007-09-24 14:21 UTC, David Jackman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Jackman 2007-09-24 13:33:05 UTC
Create a build script like the following:

<project name="failed-teardown" default="all"
         xmlns:au="antlib:org.apache.ant.antunit">
  <target name="all">
    <au:antunit>
      <file file="${ant.file}" />
      <au:plainlistener/>
    </au:antunit>
  </target>

  <target name="setUp">
    <echo>setUp</echo>
  </target>

  <target name="test1">
    <echo>test1</echo>
  </target>

  <target name="tearDown">
    <echo>tearDown</echo>
    <fail message="Failure in tearDown" />
  </target>
</project>

Running this test should result in a failed test run, but the test run succeeds
and the failure in tearDown is lost.
Comment 1 David Jackman 2007-09-24 14:21:02 UTC
Created attachment 20874 [details]
Provides a patch for the code to fix this problem, including tests
Comment 2 Kev Jackson 2007-10-03 21:10:48 UTC
Patch applied and tested to antunit svn trunk - thanks!