Upgrade to TestNG 6.9.12
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user