fixed validation of failure expected results
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@15102 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
fbae6db0ab
commit
c7c8a9bfd4
|
@ -62,9 +62,12 @@ public abstract class UnitTestCase extends junit.framework.TestCase {
|
|||
log.info( "Starting test [" + fullTestName() + "]" );
|
||||
super.runBare();
|
||||
if ( doValidate ) {
|
||||
fail( "Test marked as FailureExpected, but did not fail!" );
|
||||
throw new FailureExpectedTestPassedException( "Test marked as FailureExpected, but did not fail!" );
|
||||
}
|
||||
}
|
||||
catch ( FailureExpectedTestPassedException t ) {
|
||||
throw t;
|
||||
}
|
||||
catch( Throwable t ) {
|
||||
if ( doValidate ) {
|
||||
skipExpectedFailure( t );
|
||||
|
@ -78,6 +81,12 @@ public abstract class UnitTestCase extends junit.framework.TestCase {
|
|||
}
|
||||
}
|
||||
|
||||
private static class FailureExpectedTestPassedException extends Exception {
|
||||
public FailureExpectedTestPassedException(String message) {
|
||||
super( message );
|
||||
}
|
||||
}
|
||||
|
||||
protected void skipExpectedFailure(Throwable error) {
|
||||
reportSkip( "ignoring *FailuredExpected methods", "Failed with: " + error.toString() );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue