[hibernate-commits] Hibernate SVN: r17448 - beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Thu Aug 27 13:28:54 EDT 2009


Author: epbernard
Date: 2009-08-27 13:28:53 -0400 (Thu, 27 Aug 2009)
New Revision: 17448

Modified:
   beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/ValidatorResolutionTest.java
Log:
fix assertions too strict on the implementation

Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/ValidatorResolutionTest.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/ValidatorResolutionTest.java	2009-08-27 17:03:45 UTC (rev 17447)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/ValidatorResolutionTest.java	2009-08-27 17:28:53 UTC (rev 17448)
@@ -30,6 +30,7 @@
 import org.jboss.testharness.impl.packaging.ArtifactType;
 import org.jboss.testharness.impl.packaging.Classes;
 import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 import org.testng.annotations.Test;
 
@@ -56,14 +57,13 @@
 		assertEquals(
 				CustomConstraint.ValidatorForCustomInterface.callCounter,
 				0,
-				"The validate method of ValidatorForCustomInterface should have been called yet."
+				"The validate method of ValidatorForCustomInterface should not have been called yet."
 		);
 
 		validator.validate( new CustomInterfaceImpl() );
 
-		assertEquals(
-				CustomConstraint.ValidatorForCustomInterface.callCounter,
-				1,
+		assertTrue(
+				CustomConstraint.ValidatorForCustomInterface.callCounter > 0,
 				"The validate method of ValidatorForCustomInterface should have been called."
 		);
 	}
@@ -77,14 +77,13 @@
 		assertEquals(
 				CustomConstraint.ValidatorForCustomClass.callCounter,
 				0,
-				"The validate method of ValidatorForCustomClass should have been called yet."
+				"The validate method of ValidatorForCustomClass should not have been called yet."
 		);
 
 		validator.validate( new CustomClass() );
 
-		assertEquals(
-				CustomConstraint.ValidatorForCustomClass.callCounter,
-				1,
+		assertTrue(
+				CustomConstraint.ValidatorForCustomClass.callCounter > 0,
 				"The validate method of ValidatorForCustomClass should have been called."
 		);
 	}
@@ -98,14 +97,13 @@
 		assertEquals(
 				CustomConstraint.ValidatorForSubClassA.callCounter,
 				0,
-				"The validate method of ValidatorForSubClassA should have been called yet."
+				"The validate method of ValidatorForSubClassA should not have been called yet."
 		);
 
 		validator.validate( new SubClassAHolder( new SubClassA() ) );
 
-		assertEquals(
-				CustomConstraint.ValidatorForSubClassA.callCounter,
-				1,
+		assertTrue(
+				CustomConstraint.ValidatorForSubClassA.callCounter > 0,
 				"The validate method of ValidatorForSubClassA should have been called."
 		);
 	}
@@ -118,14 +116,13 @@
 		assertEquals(
 				CustomConstraint.ValidatorForSubClassB.callCounter,
 				0,
-				"The validate method of ValidatorForSubClassB should have been called yet."
+				"The validate method of ValidatorForSubClassB should not have been called yet."
 		);
 
 		validator.validate( new SubClassBHolder( new SubClassB() ) );
 
-		assertEquals(
-				CustomConstraint.ValidatorForSubClassB.callCounter,
-				1,
+		assertTrue(
+				CustomConstraint.ValidatorForSubClassB.callCounter > 0,
 				"The validate method of ValidatorForSubClassB should have been called."
 		);
 	}



More information about the hibernate-commits mailing list