incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1209602 - in /incubator/bval/trunk/bval-jsr303/src: main/java/org/apache/bval/jsr303/util/ValidationContextTraversal.java test/java/org/apache/bval/jsr303/groups/redefining/RedefiningDefaultGroupTest.java
Date Fri, 02 Dec 2011 17:46:47 GMT
Author: mbenson
Date: Fri Dec  2 17:46:47 2011
New Revision: 1209602

URL: http://svn.apache.org/viewvc?rev=1209602&view=rev
Log:
fix tck breakage, adding some extras tests into our own suite

Modified:
    incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ValidationContextTraversal.java
    incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/RedefiningDefaultGroupTest.java

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ValidationContextTraversal.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ValidationContextTraversal.java?rev=1209602&r1=1209601&r2=1209602&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ValidationContextTraversal.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ValidationContextTraversal.java
Fri Dec  2 17:46:47 2011
@@ -120,6 +120,7 @@ public class ValidationContextTraversal 
 
         if (metaBean instanceof DynamicMetaBean) {
             metaBean = metaBean.resolveMetaBean(ObjectUtils.defaultIfNull(validationContext.getBean(),
rawType));
+            validationContext.setMetaBean(metaBean);
         }
         MetaProperty mp = metaBean.getProperty(token);
         if (mp == null) {

Modified: incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/RedefiningDefaultGroupTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/RedefiningDefaultGroupTest.java?rev=1209602&r1=1209601&r2=1209602&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/RedefiningDefaultGroupTest.java
(original)
+++ incubator/bval/trunk/bval-jsr303/src/test/java/org/apache/bval/jsr303/groups/redefining/RedefiningDefaultGroupTest.java
Fri Dec  2 17:46:47 2011
@@ -74,6 +74,22 @@ public class RedefiningDefaultGroupTest 
               1, violations.size());
     }
 
+    public void testValidateProperty() {
+        Address address = new Address();
+        address.setStreet1("");
+        Set<ConstraintViolation<Address>> violations = validator.validateProperty(address,
"street1");
+        //prove that ExtraCareful group was validated:
+        assertEquals(1, violations.size());
+        assertNotNull(TestUtils.getViolation(violations, "street1"));
+    }
+
+    public void testValidateValue() {
+        Set<ConstraintViolation<Address>> violations = validator.validateValue(Address.class,
"street1", "");
+        //prove that ExtraCareful group was validated:
+        assertEquals(1, violations.size());
+        assertNotNull(TestUtils.getViolation(violations, "street1"));
+    }
+    
     public void testRaiseGroupDefinitionException() {
         InvalidRedefinedDefaultGroupAddress address =
               new InvalidRedefinedDefaultGroupAddress();



Mime
View raw message