incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1136134 - /incubator/bval/sandbox/lang3-work/bval-jsr303/src/test/java/org/apache/bval/jsr303/ValidationTest.java
Date Wed, 15 Jun 2011 17:47:01 GMT
Author: mbenson
Date: Wed Jun 15 17:47:00 2011
New Revision: 1136134

URL: http://svn.apache.org/viewvc?rev=1136134&view=rev
Log:
organize imports; format

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=1136134&r1=1136133&r2=1136134&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
Wed Jun 15 17:47:00 2011
@@ -18,11 +18,11 @@
  */
 package org.apache.bval.jsr303;
 
-import junit.framework.Assert;
-import junit.framework.TestCase;
-import org.apache.bval.constraints.NotNullValidator;
-import org.apache.bval.jsr303.example.*;
-import org.apache.bval.jsr303.util.TestUtils;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Set;
 
 import javax.validation.ConstraintViolation;
 import javax.validation.Validation;
@@ -34,11 +34,23 @@ import javax.validation.groups.Default;
 import javax.validation.metadata.BeanDescriptor;
 import javax.validation.metadata.ConstraintDescriptor;
 import javax.validation.metadata.PropertyDescriptor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Set;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.bval.constraints.NotNullValidator;
+import org.apache.bval.jsr303.example.AccessTestBusinessObject;
+import org.apache.bval.jsr303.example.AccessTestBusinessObjectSub;
+import org.apache.bval.jsr303.example.Address;
+import org.apache.bval.jsr303.example.Author;
+import org.apache.bval.jsr303.example.Book;
+import org.apache.bval.jsr303.example.BusinessAddress;
+import org.apache.bval.jsr303.example.Continent;
+import org.apache.bval.jsr303.example.Country;
+import org.apache.bval.jsr303.example.First;
+import org.apache.bval.jsr303.example.Last;
+import org.apache.bval.jsr303.example.RecursiveFoo;
+import org.apache.bval.jsr303.util.TestUtils;
 
 /**
  * Description: <br/>
@@ -149,9 +161,8 @@ public class ValidationTest extends Test
     }
 
     /**
-     * test: - dynamic resolution of associated object types. - inheritance of
-     * validation constraints - complex valiation, different groups, nested
-     * object net
+     * test: - dynamic resolution of associated object types. - inheritance of validation
constraints - complex
+     * valiation, different groups, nested object net
      */
     public void testValidAnnotation() {
         Author a = new Author();
@@ -231,13 +242,13 @@ public class ValidationTest extends Test
     }
 
     public void testPropertyPathRecursive() {
-        RecursiveFoo foo1 = new RecursiveFoo(); //root
+        RecursiveFoo foo1 = new RecursiveFoo(); // root
         RecursiveFoo foo11 = new RecursiveFoo();
-        foo1.getFoos().add(foo11); //foos[0]
+        foo1.getFoos().add(foo11); // foos[0]
         RecursiveFoo foo12 = new RecursiveFoo();
-        foo1.getFoos().add(foo12); //foos[1]
+        foo1.getFoos().add(foo12); // foos[1]
         RecursiveFoo foo2 = new RecursiveFoo();
-        foo11.getFoos().add(foo2); //foos[0].foos[0]
+        foo11.getFoos().add(foo2); // foos[0].foos[0]
 
         Set<ConstraintViolation<RecursiveFoo>> constraints = validator.validate(foo1);
         assertPropertyPath("foos[0].foos[0].foos", constraints);
@@ -284,10 +295,9 @@ public class ValidationTest extends Test
     }
 
     /**
-     * Example 2.14. Using the fluent API to build custom constraint violations.
-     * test that: the
-     * {@link org.apache.bval.constraints.ZipCodeCityCoherenceValidator} adds
-     * custom messages to the context and suppresses the default message
+     * Example 2.14. Using the fluent API to build custom constraint violations. test that:
the
+     * {@link org.apache.bval.constraints.ZipCodeCityCoherenceValidator} adds custom messages
to the context and
+     * suppresses the default message
      */
     public void testConstraintValidatorContextFluentAPI() {
         Address ad = new Address();
@@ -424,7 +434,7 @@ public class ValidationTest extends Test
 
     public void testValidateCascadingNestedTipProperty() {
         final String propPath = "addresses[0].country.name";
-        
+
         CascadingPropertyValidator v = validator.unwrap(CascadingPropertyValidator.class);
         Author author = new Author();
         author.setAddresses(new ArrayList<Address>());
@@ -436,7 +446,7 @@ public class ValidationTest extends Test
 
         Set<ConstraintViolation<Author>> iv = v.validateProperty(author, propPath);
         Assert.assertEquals(1, iv.size());
-        
+
         iv = v.validateProperty(author, propPath, true);
         Assert.assertEquals(1, iv.size());
     }
@@ -457,7 +467,7 @@ public class ValidationTest extends Test
 
     public void testValidateCascadingPropertyWithMultipleGroupsIgnoresSiblingProperties()
{
         final String propPath = "addresses[0].country";
-        
+
         CascadingPropertyValidator v = validator.unwrap(CascadingPropertyValidator.class);
         Author author = new Author();
         author.setAddresses(new ArrayList<Address>());
@@ -465,7 +475,7 @@ public class ValidationTest extends Test
         author.getAddresses().add(adr);
         Country country = new Country();
         adr.setCountry(country);
-        
+
         Set<ConstraintViolation<Author>> iv = v.validateProperty(author, propPath,
true, Default.class, Foo.class);
         Assert.assertEquals(1, iv.size());
     }



Mime
View raw message