Author: hardy.ferentschik
Date: 2009-06-23 15:09:27 -0400 (Tue, 23 Jun 2009)
New Revision: 16912
Modified:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ValidateTest.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validatorfactory/CustomConstraintValidatorTest.java
Log:
added some explicit casts to make the suite complie against jdk5
Modified:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ValidateTest.java
===================================================================
---
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ValidateTest.java 2009-06-23
18:34:33 UTC (rev 16911)
+++
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ValidateTest.java 2009-06-23
19:09:27 UTC (rev 16912)
@@ -17,6 +17,7 @@
*/
package org.hibernate.jsr303.tck.tests.validation;
+import java.lang.annotation.Annotation;
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.ValidationException;
@@ -142,10 +143,9 @@
assertEquals( violation.getRootBean(), engine, "Wrong root entity." );
assertEquals( violation.getInvalidValue(), "ABCDEFGH1234", "Wrong
validated value" );
assertNotNull( violation.getConstraintDescriptor(), "Constraint descriptor should
not be null" );
- assertEquals(
- violation.getConstraintDescriptor().getAnnotation().annotationType(),
- Pattern.class, "Wrong annotation type"
- );
+ // cast is required for JDK 5 - at least on Mac OS X
+ Annotation ann = ( Annotation ) violation.getConstraintDescriptor().getAnnotation();
+ assertEquals( ann.annotationType(), Pattern.class, "Wrong annotation type"
);
assertCorrectPropertyPaths( constraintViolations, "serialNumber" );
engine.setSerialNumber( "ABCD-EFGH-1234" );
@@ -223,7 +223,7 @@
assertEquals( "Everyone has a last name.", constraintViolation.getMessage(),
"Wrong message" );
assertEquals( constraintViolation.getRootBean(), clint, "Wrong root entity"
);
assertEquals( constraintViolation.getInvalidValue(), morgan.getLastName(), "Wrong
value" );
- assertCorrectPropertyPaths( constraintViolations,
"playedWith[0].playedWith[1].lastName");
+ assertCorrectPropertyPaths( constraintViolations,
"playedWith[0].playedWith[1].lastName" );
}
@Test(expectedExceptions = IllegalArgumentException.class)
Modified:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validatorfactory/CustomConstraintValidatorTest.java
===================================================================
---
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validatorfactory/CustomConstraintValidatorTest.java 2009-06-23
18:34:33 UTC (rev 16911)
+++
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validatorfactory/CustomConstraintValidatorTest.java 2009-06-23
19:09:27 UTC (rev 16912)
@@ -62,7 +62,8 @@
@SpecAssertion(section = "2.5", id = "c")
@Test(expectedExceptions = ValidationException.class)
public void testValidationExceptionIsThrownInCaseFactoryReturnsNull() {
- Configuration<?> config =
Validation.byDefaultProvider().configure().constraintValidatorFactory(
+ // cast is required for JDK 5 - at least on Mac OS X
+ Configuration<?> config = (Configuration<?>)
Validation.byDefaultProvider().configure().constraintValidatorFactory(
new ConstraintValidatorFactory() {
public <T extends ConstraintValidator<?, ?>> T
getInstance(Class<T> key) {
return null;
Show replies by date