Author: epbernard
Date: 2009-09-10 04:42:57 -0400 (Thu, 10 Sep 2009)
New Revision: 17500
Modified:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/ConstraintValidatorContextTest.java
beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml
Log:
HV-224 the TCK and RI incorrectly assumes that not mapping errors can go through.
I've mapped the assertion contradicting this and updating the TCK test to reflect
that.
The RI needs to be fixed though.
Modified:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/ConstraintValidatorContextTest.java
===================================================================
---
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/ConstraintValidatorContextTest.java 2009-09-09
14:26:23 UTC (rev 17499)
+++
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/ConstraintValidatorContextTest.java 2009-09-10
08:42:57 UTC (rev 17500)
@@ -22,6 +22,7 @@
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
+import javax.validation.ValidationException;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
@@ -59,8 +60,8 @@
assertCorrectConstraintViolationMessages( constraintViolations, "dummy
message" );
}
- @Test
- @SpecAssertion(section = "2.4", id = "m")
+ @Test(expectedExceptions = ValidationException.class)
+ @SpecAssertion(section = "2.4", id = "r")
public void testDisableDefaultErrorWithoutAddingCustomError() {
Validator validator = TestUtil.getValidatorUnderTest();
@@ -71,7 +72,7 @@
DummyBean bean = new DummyBean( "foobar" );
Set<ConstraintViolation<DummyBean>> constraintViolations =
validator.validate( bean );
- assertEquals( constraintViolations.size(), 0, "Wrong number of constraints"
);
+ //assertEquals( constraintViolations.size(), 0, "Wrong number of constraints"
);
}
@Test
Modified: beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml 2009-09-09
14:26:23 UTC (rev 17499)
+++ beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml 2009-09-10
08:42:57 UTC (rev 17500)
@@ -206,6 +206,10 @@
<text>You can point an error to a subpath of this default path by using
the error
builder fluent API.</text>
</assertion>
+ <assertion id="r">
+ <text>If disableDefaultError is called, no custom error is added (using
the error builder)
+ and if the constraint is not valid, a ValidationException is
raised.</text>
+ </assertion>
</section>
<section id="2.5" title="The ConstraintValidatorFactory">
<assertion id="a">
Show replies by date