else
{
try
{
// ARQ-1742 If exceptions happen during boot
TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder.build();
// don't set it if beforeSuite fails
adaptor.beforeSuite();
State.testAdaptor(adaptor);
}
catch (Exception e)
{
// caught exception during BeforeSuite, mark this as failed
State.caughtInitializationException(e);
notifier.fireTestFailure(new Failure(getDescription(), e));
}
}
}
notifier.addListener(new RunListener()
{
@Override
public void testRunFinished(Result result) throws Exception
{
State.runnerFinished();
shutdown();
}
private void shutdown()
{
try
{
if(State.isLastRunner())
{
try
{
if(adaptor != null)
{
adaptor.afterSuite();
adaptor.shutdown();
}
}
finally
{
State.clean();