}
catch ( Throwable e )
{
report =
SimpleReportEntry.withException( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
new LegacyPojoStackTraceWriter( testObject.getClass().getName(),
method.getName(), e ) );
reportManager.testFailed( report );
// A return value of true indicates to this class's executeTestMethods
// method that it should abort and not attempt to execute
// any other test methods. The other caller of this method,
// TestRerunner.rerun, ignores this return value, because it is
// only running one test.
return true;
}
// Make sure that tearDownFixture
try
{
method.invoke( testObject, args );
report = new SimpleReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName ) );
reportManager.testSucceeded( report );
}
catch ( InvocationTargetException ite )
{
Throwable t = ite.getTargetException();
report =
SimpleReportEntry.withException( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
new LegacyPojoStackTraceWriter( testObject.getClass().getName(),
method.getName(), t ) );
reportManager.testFailed( report );
// Don't return here, because tearDownFixture should be called even
// if the test method throws an exception.
}
catch ( Throwable t )
{
report =
SimpleReportEntry.withException( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
new LegacyPojoStackTraceWriter( testObject.getClass().getName(),
method.getName(), t ) );
reportManager.testFailed( report );
// Don't return here, because tearDownFixture should be called even
// if the test method throws an exception.
}
try
{
tearDownFixture();
}
catch ( Throwable t )
{
// Treat any exception from tearDownFixture as a failure of the test.
report =
SimpleReportEntry.withException( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
new LegacyPojoStackTraceWriter( testObject.getClass().getName(),
method.getName(), t ) );
reportManager.testFailed( report );
// A return value of true indicates to this class's executeTestMethods