Are you picking up your tests.failures property somewhere to fail the build?

e.g. <fail if="tests.failures" />



On Sat, Nov 21, 2009 at 8:43 AM, Ben Cuthbert <bencuthb...@me.com> wrote:
> When one of my unit tests fail the build is still successful. But in my ant
> config I have the following
>
> <junit haltonfailure="yes" haltonerror="yes"
> failureproperty="tests.failures" errorproperty="tests.errors">
>
>                                        <classpath>
>                                                <path refid="classpath.test"
> />
>                                        </classpath>
>
>                                        <formatter type="brief"
> usefile="false" />
>
>                                        <batchtest fork="yes">
>                                                <fileset dir="${src.tests}">
>                                                        <include
> name="**/*UnitTestCase.java" />
>                                                </fileset>
>                                        </batchtest>
>                                </junit>
>
> test:
>     [echo] running unit tests for project
>    [junit] Testsuite: com.test.NetworkServerInitialisationUnitTestCase
>    [junit] Tests run: 4, Failures: 0, Errors: 1, Time elapsed: 0.271 sec
>    [junit]
>    [junit] Testcase:
> TestTheServerIsNotConnected(com.test.NetworkServerInitialisationUnitTestCase):
>     Caused an ERROR
>    [junit]
>    [junit] java.lang.AssertionError:
>    [junit]     at org.junit.Assert.fail(Assert.java:92)
>    [junit]     at org.junit.Assert.assertTrue(Assert.java:44)
>    [junit]     at org.junit.Assert.assertFalse(Assert.java:69)
>    [junit]     at org.junit.Assert.assertFalse(Assert.java:80)
>    [junit]     at
> com.test.NetworkServerInitialisationUnitTestCase.TestTheServerIsNotConnected(NetworkServerInitialisationUnitTestCase.java:77)
>    default:
>
> BUILD SUCCESSFUL
> Total time: 6 seconds
>
>
>

Reply via email to