Upgrade to TestNG 6.9.12

This commit is contained in:
Sam Brannen
2016-09-09 18:02:47 +02:00
parent e882f739bf
commit 2f2e6dffb4
4 changed files with 21 additions and 5 deletions

View File

@@ -178,7 +178,6 @@ public abstract class AbstractTestNGSpringContextTests implements IHookable, App
beforeCallbacksExecuted = true;
}
catch (Throwable ex) {
testResult.setThrowable(ex);
this.testException = ex;
}
@@ -192,10 +191,13 @@ public abstract class AbstractTestNGSpringContextTests implements IHookable, App
}
catch (Throwable ex) {
if (this.testException == null) {
testResult.setThrowable(ex);
this.testException = ex;
}
}
if (this.testException != null) {
throwAsUncheckedException(this.testException);
}
}
/**
@@ -237,4 +239,16 @@ public abstract class AbstractTestNGSpringContextTests implements IHookable, App
return testResultException;
}
private RuntimeException throwAsUncheckedException(Throwable t) {
throwAs(t);
// Appeasing the compiler: the following line will never be executed.
return null;
}
@SuppressWarnings("unchecked")
private <T extends Throwable> void throwAs(Throwable t) throws T {
throw (T) t;
}
}