}
if ( notifier == null ) {
notifier = EmptyNotifier.INSTANCE;
}
this.reteTesterHelper.addImports( testCase.getImports() );
NodeTestCaseResult result = new NodeTestCaseResult( testCase );
for ( NodeTestDef test : testCase.getTests() ) {
notifier.fireTestStarted( test.getDescription() );
NodeTestResult testResult = createTestResult( test,
null );
try {
testResult = run( testCase,
test );
switch ( testResult.result ) {
case SUCCESS :
notifier.fireTestFinished( test.getDescription() );
break;
case ERROR :
case FAILURE :
notifier.fireTestFailure( new Failure( test.getDescription(),
new AssertionError( testResult.errorMsgs ) ) );
break;
}
} catch ( Throwable e ) {
notifier.fireTestFailure( new Failure( test.getDescription(),
e ) );
}
result.add( testResult );
}
return result;
}