bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r992154 - /incubator/bval/sandbox/lang3-work/bval-jsr303/src/test/java/org/apache/bval/jsr303/ValidationTest.java
Date Thu, 02 Sep 2010 23:20:44 GMT
Author: mbenson
Date: Thu Sep  2 23:20:43 2010
New Revision: 992154

URL: http://svn.apache.org/viewvc?rev=992154&view=rev
Log:
add assertions exhibiting existing bug whereby a constraint violation's property path is not
set when validating a property path

Modified:
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/test/java/org/apache/bval/jsr303/ValidationTest.java

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303/src/test/java/org/apache/bval/jsr303/ValidationTest.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303/src/test/java/org/apache/bval/jsr303/ValidationTest.java?rev=992154&r1=992153&r2=992154&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303/src/test/java/org/apache/bval/jsr303/ValidationTest.java
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303/src/test/java/org/apache/bval/jsr303/ValidationTest.java
Thu Sep  2 23:20:43 2010
@@ -312,11 +312,22 @@ public class ValidationTest extends Test
 
         Set<ConstraintViolation<Author>> iv = v.validateProperty(author, propPath);
         Assert.assertEquals(1, iv.size());
+        ConstraintViolation<Author> vio = iv.iterator().next();
+        assertEquals(propPath, vio.getPropertyPath().toString());
+        assertSame(author, vio.getRootBean());
+        assertSame(author.getAddresses().get(0).getCountry(), vio.getLeafBean());
+
         country.setISO2Code("23");
         iv = v.validateProperty(author, propPath);
         Assert.assertEquals(0, iv.size());
+
         iv = v.validateValue(Author.class, propPath, "345");
         Assert.assertEquals(1, iv.size());
+        vio = iv.iterator().next();
+        assertEquals(propPath, vio.getPropertyPath().toString());
+        assertNull(vio.getRootBean());
+        assertNull(vio.getLeafBean());
+
         iv = v.validateValue(Author.class, propPath, "34");
         Assert.assertEquals(0, iv.size());
     }



Mime
View raw message