"Arquillian has previously been attempted initialized, but failed. See cause for previous exception",
State.getInitializationException())));
}
else
{
TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder.build();
try
{
// 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(State.hasTestAdaptor())
{
TestRunnerAdaptor adaptor = State.getTestAdaptor();
adaptor.afterSuite();
adaptor.shutdown();
}
}
finally
{
State.clean();