[hibernate-commits] Hibernate SVN: r15107 - core/branches/Branch_3_3/testing/src/main/java/org/hibernate/junit.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Mon Aug 18 15:24:24 EDT 2008


Author: steve.ebersole at jboss.com
Date: 2008-08-18 15:24:24 -0400 (Mon, 18 Aug 2008)
New Revision: 15107

Modified:
   core/branches/Branch_3_3/testing/src/main/java/org/hibernate/junit/UnitTestCase.java
Log:
fixed validation of failure expected results

Modified: core/branches/Branch_3_3/testing/src/main/java/org/hibernate/junit/UnitTestCase.java
===================================================================
--- core/branches/Branch_3_3/testing/src/main/java/org/hibernate/junit/UnitTestCase.java	2008-08-18 19:22:41 UTC (rev 15106)
+++ core/branches/Branch_3_3/testing/src/main/java/org/hibernate/junit/UnitTestCase.java	2008-08-18 19:24:24 UTC (rev 15107)
@@ -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();
 			}
 		}
+		catch ( FailureExpectedTestPassedException t ) {
+			throw t;
+		}
 		catch( Throwable t ) {
 			if ( doValidate ) {
 				skipExpectedFailure( t );
@@ -78,6 +81,12 @@
 		}
 	}
 
+	private static class FailureExpectedTestPassedException extends Exception {
+		public FailureExpectedTestPassedException() {
+			super( "Test marked as FailureExpected, but did not fail!" );
+		}
+	}
+
 	protected void skipExpectedFailure(Throwable error) {
 		reportSkip( "ignoring *FailuredExpected methods", "Failed with: " + error.toString() );
 	}




More information about the hibernate-commits mailing list