public TestResult getTestResult()
{
if (context.getFailedConfigurations().size() > 0)
{
return new TestResult(Status.FAILED,
context.getFailedConfigurations().getAllResults().iterator().next().getThrowable());
}
else if (context.getFailedTests().size() > 0)
{
return new TestResult(Status.FAILED,
context.getFailedTests().getAllResults().iterator().next().getThrowable());
}
else if (context.getSkippedTests().size() > 0)
{
return new TestResult(Status.SKIPPED);
}
if (context.getPassedTests().size() > 0)
{
return new TestResult(Status.PASSED,
context.getPassedTests().getAllResults().iterator().next().getThrowable());
}
return new TestResult(Status.FAILED,
new RuntimeException("Unknown test result: " + context).fillInStackTrace());
}