Author: steve.ebersole(a)jboss.com
Date: 2008-08-18 14:57:39 -0400 (Mon, 18 Aug 2008)
New Revision: 15102
Modified:
core/trunk/testing/src/main/java/org/hibernate/junit/UnitTestCase.java
Log:
fixed validation of failure expected results
Modified: core/trunk/testing/src/main/java/org/hibernate/junit/UnitTestCase.java
===================================================================
--- core/trunk/testing/src/main/java/org/hibernate/junit/UnitTestCase.java 2008-08-18
18:19:09 UTC (rev 15101)
+++ core/trunk/testing/src/main/java/org/hibernate/junit/UnitTestCase.java 2008-08-18
18:57:39 UTC (rev 15102)
@@ -62,9 +62,12 @@
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 @@
}
}
+ 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() );
}
Show replies by date