TestResult testResult = new TestResult();
AntUnitTestCase antUnitTestCase = new AntUnitTestCase(nameForInvalidF);
antUnitTestCase.run(testResult);
assertEquals(1 , testResult.errorCount());
TestFailure error = (TestFailure) testResult.errors().nextElement();
assertSame(antUnitTestCase, error.failedTest());
assertTrue("Unexpected error : " + error.exceptionMessage(),
error.exceptionMessage().contains("invalidFile"));
}