Hibernate SVN: r16021 - beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-02-23 05:17:40 -0500 (Mon, 23 Feb 2009)
New Revision: 16021
Removed:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertFalses.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertTrues.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Futures.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Maxs.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Mins.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/NotNulls.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Nulls.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pasts.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Patterns.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Sizes.java
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertFalse.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertTrue.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Digits.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Future.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Max.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Min.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/NotNull.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Null.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Past.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pattern.java
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Size.java
Log:
BVAL-121 add plural forms
Modified: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertFalse.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertFalse.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertFalse.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -40,4 +40,17 @@
String message() default "{validator.assertFalse}";
Class<?>[] groups() default { };
+
+ /**
+ * Defines several @AssertFalse annotations on the same element
+ * @see javax.validation.constraints.AssertFalse
+ *
+ * @author Emmanuel Bernard
+ */
+ @Target({ METHOD, FIELD, ANNOTATION_TYPE })
+ @Retention(RUNTIME)
+ @Documented
+ @interface List {
+ AssertFalse[] value();
+ }
}
\ No newline at end of file
Deleted: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertFalses.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertFalses.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertFalses.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -1,22 +0,0 @@
-package javax.validation.constraints;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Documented;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-
-/**
- * Defines several @AssertFalse annotations on the same element
- * @see javax.validation.constraints.AssertFalse
- *
- * @author Emmanuel Bernard
- */
-@Target({ METHOD, FIELD, ANNOTATION_TYPE })
-@Retention(RUNTIME)
-@Documented
-public @interface AssertFalses {
- AssertFalse[] value();
-}
Modified: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertTrue.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertTrue.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertTrue.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -40,4 +40,17 @@
String message() default "{validator.assertTrue}";
Class<?>[] groups() default { };
+
+ /**
+ * Defines several @AssertTrue annotations on the same element
+ * @see AssertTrue
+ *
+ * @author Emmanuel Bernard
+ */
+ @Target({ METHOD, FIELD, ANNOTATION_TYPE })
+ @Retention(RUNTIME)
+ @Documented
+ @interface List {
+ AssertTrue[] value();
+ }
}
\ No newline at end of file
Deleted: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertTrues.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertTrues.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/AssertTrues.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -1,22 +0,0 @@
-package javax.validation.constraints;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Documented;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-
-/**
- * Defines several @AssertTrue annotations on the same element
- * @see AssertTrue
- *
- * @author Emmanuel Bernard
- */
-@Target({ METHOD, FIELD, ANNOTATION_TYPE })
-@Retention(RUNTIME)
-@Documented
-public @interface AssertTrues {
- AssertTrue[] value();
-}
\ No newline at end of file
Modified: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Digits.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Digits.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Digits.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -60,4 +60,17 @@
* @return maximum number of fractional digits accepted for this number.
*/
int fraction();
+
+ /**
+ * Defines several @Digits annotations on the same element
+ * @see Digits
+ *
+ * @author Emmanuel Bernard
+ */
+ @Target({ METHOD, FIELD, ANNOTATION_TYPE })
+ @Retention(RUNTIME)
+ @Documented
+ @interface List {
+ Size[] value();
+ }
}
\ No newline at end of file
Modified: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Future.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Future.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Future.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -51,4 +51,17 @@
String message() default "{validator.future}";
Class<?>[] groups() default { };
+
+ /**
+ * Defines several @Future annotations on the same element
+ * @see javax.validation.constraints.Future
+ *
+ * @author Emmanuel Bernard
+ */
+ @Target({ METHOD, FIELD, ANNOTATION_TYPE })
+ @Retention(RUNTIME)
+ @Documented
+ @interface List {
+ Future[] value();
+ }
}
\ No newline at end of file
Deleted: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Futures.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Futures.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Futures.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -1,22 +0,0 @@
-package javax.validation.constraints;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Documented;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-
-/**
- * Defines several @Future annotations on the same element
- * @see javax.validation.constraints.Future
- *
- * @author Emmanuel Bernard
- */
-@Target({ METHOD, FIELD, ANNOTATION_TYPE })
-@Retention(RUNTIME)
-@Documented
-public @interface Futures {
- Future[] value();
-}
\ No newline at end of file
Modified: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Max.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Max.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Max.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -56,4 +56,17 @@
* @return Value the element must be lower or equal to
*/
long value();
+
+ /**
+ * Defines several @Max annotations on the same element
+ * @see Max
+ *
+ * @author Emmanuel Bernard
+ */
+ @Target({ METHOD, FIELD, ANNOTATION_TYPE })
+ @Retention(RUNTIME)
+ @Documented
+ @interface List {
+ Max[] value();
+ }
}
\ No newline at end of file
Deleted: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Maxs.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Maxs.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Maxs.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -1,22 +0,0 @@
-package javax.validation.constraints;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Documented;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-
-/**
- * Defines several @Max annotations on the same element
- * @see Max
- *
- * @author Emmanuel Bernard
- */
-@Target({ METHOD, FIELD, ANNOTATION_TYPE })
-@Retention(RUNTIME)
-@Documented
-public @interface Maxs {
- public abstract Max[] value();
-}
\ No newline at end of file
Modified: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Min.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Min.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Min.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -56,4 +56,17 @@
* @return Value the element must be higher or equal to
*/
long value();
+
+ /**
+ * Defines several @Min annotations on the same element
+ * @see javax.validation.constraints.Min
+ *
+ * @author Emmanuel Bernard
+ */
+ @Target({ METHOD, FIELD, ANNOTATION_TYPE })
+ @Retention(RUNTIME)
+ @Documented
+ @interface List {
+ Min[] value();
+ }
}
\ No newline at end of file
Deleted: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Mins.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Mins.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Mins.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -1,22 +0,0 @@
-package javax.validation.constraints;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Documented;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-
-/**
- * Defines several @Min annotations on the same element
- * @see javax.validation.constraints.Min
- *
- * @author Emmanuel Bernard
- */
-@Target({ METHOD, FIELD, ANNOTATION_TYPE })
-@Retention(RUNTIME)
-@Documented
-public @interface Mins {
- public abstract Min[] value();
-}
\ No newline at end of file
Modified: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/NotNull.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/NotNull.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/NotNull.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -38,4 +38,17 @@
String message() default "{validator.notNull}";
Class<?>[] groups() default { };
+
+ /**
+ * Defines several @NotNull annotations on the same element
+ * @see javax.validation.constraints.NotNull
+ *
+ * @author Emmanuel Bernard
+ */
+ @Target({ METHOD, FIELD, ANNOTATION_TYPE })
+ @Retention(RUNTIME)
+ @Documented
+ @interface List {
+ NotNull[] value();
+ }
}
Deleted: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/NotNulls.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/NotNulls.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/NotNulls.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -1,22 +0,0 @@
-package javax.validation.constraints;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Documented;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-
-/**
- * Defines several @NotNull annotations on the same element
- * @see javax.validation.constraints.NotNull
- *
- * @author Emmanuel Bernard
- */
-@Target({ METHOD, FIELD, ANNOTATION_TYPE })
-@Retention(RUNTIME)
-@Documented
-public @interface NotNulls {
- public abstract NotNull[] value();
-}
\ No newline at end of file
Modified: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Null.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Null.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Null.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -38,5 +38,18 @@
String message() default "{validator.null}";
Class<?>[] groups() default { };
+
+ /**
+ * Defines several @Null annotations on the same element
+ * @see javax.validation.constraints.Null
+ *
+ * @author Emmanuel Bernard
+ */
+ @Target({ METHOD, FIELD, ANNOTATION_TYPE })
+ @Retention(RUNTIME)
+ @Documented
+ @interface List {
+ Null[] value();
+ }
}
Deleted: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Nulls.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Nulls.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Nulls.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -1,22 +0,0 @@
-package javax.validation.constraints;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Documented;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-
-/**
- * Defines several @Null annotations on the same element
- * @see javax.validation.constraints.Null
- *
- * @author Emmanuel Bernard
- */
-@Target({ METHOD, FIELD, ANNOTATION_TYPE })
-@Retention(RUNTIME)
-@Documented
-public @interface Nulls {
- public abstract Null[] value();
-}
\ No newline at end of file
Modified: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Past.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Past.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Past.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -51,4 +51,17 @@
String message() default "{validator.past}";
Class<?>[] groups() default { };
+
+ /**
+ * Defines several @NotNull annotations on the same element
+ * @see Past
+ *
+ * @author Emmanuel Bernard
+ */
+ @Target({ METHOD, FIELD, ANNOTATION_TYPE })
+ @Retention(RUNTIME)
+ @Documented
+ @interface List {
+ Past[] value();
+ }
}
\ No newline at end of file
Deleted: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pasts.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pasts.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pasts.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -1,22 +0,0 @@
-package javax.validation.constraints;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Documented;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-
-/**
- * Defines several @NotNull annotations on the same element
- * @see Past
- *
- * @author Emmanuel Bernard
- */
-@Target({ METHOD, FIELD, ANNOTATION_TYPE })
-@Retention(RUNTIME)
-@Documented
-public @interface Pasts {
- public abstract Past[] value();
-}
\ No newline at end of file
Modified: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pattern.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pattern.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pattern.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -87,4 +87,17 @@
*/
CANON_EQ,
}
+
+ /**
+ * Defines several @Pattern annotations on the same element
+ * @see javax.validation.constraints.Pattern
+ *
+ * @author Emmanuel Bernard
+ */
+ @Target({ METHOD, FIELD, ANNOTATION_TYPE })
+ @Retention(RUNTIME)
+ @Documented
+ @interface List {
+ Pattern[] value();
+ }
}
Deleted: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Patterns.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Patterns.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Patterns.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -1,22 +0,0 @@
-package javax.validation.constraints;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Documented;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-
-/**
- * Defines several @Pattern annotations on the same element
- * @see javax.validation.constraints.Pattern
- *
- * @author Emmanuel Bernard
- */
-@Target({ METHOD, FIELD, ANNOTATION_TYPE })
-@Retention(RUNTIME)
-@Documented
-public @interface Patterns {
- public abstract Pattern[] value();
-}
\ No newline at end of file
Modified: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Size.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Size.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Size.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -55,4 +55,17 @@
* @return size the element must be lower or equal to
*/
int max() default Integer.MAX_VALUE;
+
+ /**
+ * Defines several @Size annotations on the same element
+ * @see Size
+ *
+ * @author Emmanuel Bernard
+ */
+ @Target({ METHOD, FIELD, ANNOTATION_TYPE })
+ @Retention(RUNTIME)
+ @Documented
+ @interface List {
+ Size[] value();
+ }
}
\ No newline at end of file
Deleted: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Sizes.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Sizes.java 2009-02-23 09:40:29 UTC (rev 16020)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Sizes.java 2009-02-23 10:17:40 UTC (rev 16021)
@@ -1,22 +0,0 @@
-package javax.validation.constraints;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Documented;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-
-/**
- * Defines several @Size annotations on the same element
- * @see Size
- *
- * @author Emmanuel Bernard
- */
-@Target({ METHOD, FIELD, ANNOTATION_TYPE })
-@Retention(RUNTIME)
-@Documented
-public @interface Sizes {
- public abstract Size[] value();
-}
\ No newline at end of file
15 years, 9 months
Hibernate SVN: r16020 - beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-02-23 04:40:29 -0500 (Mon, 23 Feb 2009)
New Revision: 16020
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Size.java
Log:
BVAL-125 @Size.min=0 by default
Modified: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Size.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Size.java 2009-02-22 17:28:24 UTC (rev 16019)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Size.java 2009-02-23 09:40:29 UTC (rev 16020)
@@ -49,7 +49,7 @@
/**
* @return size the element must be higher or equal to
*/
- int min() default Integer.MIN_VALUE;
+ int min() default 0;
/**
* @return size the element must be lower or equal to
15 years, 9 months
Hibernate SVN: r16019 - validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-02-22 12:28:24 -0500 (Sun, 22 Feb 2009)
New Revision: 16019
Modified:
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java
Log:
HV-120 Added a test to confirm that Default group is returned.
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java 2009-02-22 17:08:30 UTC (rev 16018)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java 2009-02-22 17:28:24 UTC (rev 16019)
@@ -18,9 +18,13 @@
package org.hibernate.validation.engine;
import java.util.Set;
+import javax.validation.BeanDescriptor;
+import javax.validation.ConstraintDescriptor;
import javax.validation.ConstraintViolation;
+import javax.validation.PropertyDescriptor;
import javax.validation.ValidationException;
import javax.validation.Validator;
+import javax.validation.groups.Default;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -36,7 +40,6 @@
import org.hibernate.validation.eg.Order;
import org.hibernate.validation.eg.Person;
import org.hibernate.validation.eg.UnconstraintEntity;
-import org.hibernate.validation.engine.groups.User;
import org.hibernate.validation.util.LoggerFactory;
import org.hibernate.validation.util.TestUtil;
import static org.hibernate.validation.util.TestUtil.assertConstraintViolation;
@@ -332,4 +335,26 @@
constraintViolations = validator.validate( person );
assertEquals( "Wrong number of constraints", 0, constraintViolations.size() );
}
+
+ /**
+ * HV-120
+ */
+ @Test
+ public void testConstraintDescriptorWithoutExplicitGroup() {
+ Validator validator = TestUtil.getValidator();
+
+ BeanDescriptor beanDescriptor = validator.getConstraintsForClass( Order.class );
+ PropertyDescriptor propertyDescriptor = beanDescriptor.getConstraintsForProperty( "orderNumber" );
+ Set<ConstraintDescriptor> descriptors = propertyDescriptor.getConstraintDescriptors();
+
+ assertEquals( "There should be only one constraint descriptor", 1, descriptors.size() );
+ ConstraintDescriptor descriptor = descriptors.iterator().next();
+ Set<Class<?>> groups = descriptor.getGroups();
+ assertTrue( "There should be only one group", groups.size() == 1 );
+ assertEquals(
+ "The declared constraint does not explicitly define a group, hence Default is expected",
+ Default.class,
+ groups.iterator().next()
+ );
+ }
}
15 years, 9 months
Hibernate SVN: r16018 - validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/groups.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-02-22 12:08:30 -0500 (Sun, 22 Feb 2009)
New Revision: 16018
Modified:
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/groups/GroupTest.java
Log:
updated a test
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/groups/GroupTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/groups/GroupTest.java 2009-02-22 16:34:02 UTC (rev 16017)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/groups/GroupTest.java 2009-02-22 17:08:30 UTC (rev 16018)
@@ -38,6 +38,8 @@
import org.hibernate.validation.util.TestUtil;
import static org.hibernate.validation.util.TestUtil.assertConstraintViolation;
+import static junit.framework.Assert.fail;
+
/**
* Tests for the group and group sequence feature.
*
@@ -279,21 +281,29 @@
);
Iterator<ConstraintViolation<User>> iter = constraintViolations.iterator();
-
- assertConstraintViolation(
- iter.next(),
- "may not be null",
- User.class,
- null,
- "defaultCreditCard"
- );
-
- assertConstraintViolation(
- iter.next(),
- "must match \"[0-9 -]?\"",
- User.class,
- "+46 123-456",
- "phoneNumber"
- );
+ while ( iter.hasNext() ) {
+ ConstraintViolation<User> violation = iter.next();
+ if ( violation.getPropertyPath().equals( "defaultCreditCard" ) ) {
+ assertConstraintViolation(
+ violation,
+ "may not be null",
+ User.class,
+ null,
+ "defaultCreditCard"
+ );
+ }
+ else if ( violation.getPropertyPath().equals( "phoneNumber" ) ) {
+ assertConstraintViolation(
+ violation,
+ "must match \"[0-9 -]?\"",
+ User.class,
+ "+46 123-456",
+ "phoneNumber"
+ );
+ }
+ else {
+ fail( "Unexpected violation" );
+ }
+ }
}
}
\ No newline at end of file
15 years, 9 months
Hibernate SVN: r16017 - validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report.
by hibernate-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-02-22 11:34:02 -0500 (Sun, 22 Feb 2009)
New Revision: 16017
Modified:
validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/CoverageReport.java
Log:
Fix coverage percent to not include untestable
Modified: validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/CoverageReport.java
===================================================================
--- validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/CoverageReport.java 2009-02-22 02:07:14 UTC (rev 16016)
+++ validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/CoverageReport.java 2009-02-22 16:34:02 UTC (rev 16017)
@@ -10,6 +10,7 @@
import java.util.Map;
import org.hibernate.tck.config.RuntimeProperties;
+import org.hibernate.tck.config.Strings;
/**
* Generates the TCK spec coverage report
@@ -454,8 +455,10 @@
}
}
- double coveragePercent = assertions > 0 ? ((coverage * 1.0) / assertions) * 100 : -1;
+ int coveredAndUnTestable = coverage + (assertions - testable);
+ double coveragePercent = assertions > 0 ? ((coveredAndUnTestable * 1.0) / (assertions)) * 100 : -1;
+
sb.append("<td align=\"center\">");
sb.append(assertions);
sb.append("</td>");
@@ -538,7 +541,14 @@
sb.append(" <div class=\"results\">");
sb.append("<p class=\"description\">");
- sb.append(assertion.getText());
+ if (!Strings.isEmpty(assertion.getNote()))
+ {
+ sb.append("<a title=\"" + assertion.getNote() + "\">").append(assertion.getText()).append("</a>");
+ }
+ else
+ {
+ sb.append(assertion.getText());
+ }
sb.append("</p>\n");
if (assertion.isTestable())
15 years, 9 months
Hibernate SVN: r16016 - validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report.
by hibernate-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-02-21 21:07:14 -0500 (Sat, 21 Feb 2009)
New Revision: 16016
Modified:
validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/CoverageReport.java
Log:
added chapter summary
Modified: validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/CoverageReport.java
===================================================================
--- validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/CoverageReport.java 2009-02-20 17:18:17 UTC (rev 16015)
+++ validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/CoverageReport.java 2009-02-22 02:07:14 UTC (rev 16016)
@@ -85,6 +85,7 @@
writeHeader(out);
writeContents(out);
writeMasterSummary(out);
+ writeChapterSummary(out);
writeSectionSummary(out);
writeCoverage(out);
writeUnmatched(out);
@@ -196,6 +197,7 @@
sb.append("<h3>Contents</h3>");
sb.append("<div><a href=\"#masterSummary\">Master Summary</a></div>");
+ sb.append("<div><a href=\"#chapterSummary\">Chapter Summary</a></div>");
sb.append("<div><a href=\"#sectionSummary\">Section Summary</a></div>");
sb.append("<div><a href=\"#coverageDetail\">Coverage Detail</a></div>");
sb.append("<div><a href=\"#unmatched\">Unmatched Tests</a></div>");
@@ -282,7 +284,122 @@
out.write(sb.toString().getBytes());
}
+
+ private void writeChapterSummary(OutputStream out) throws IOException {
+ StringBuilder sb = new StringBuilder();
+
+ sb.append("<h3 id=\"chapterSummary\">Chapter Summary</h3>\n");
+ sb.append("<table width=\"100%\">");
+
+ sb.append("<tr style=\"background-color:#dddddd\">");
+ sb.append("<th align=\"left\">Chapter</th>");
+ sb.append("<th>Assertions</th>");
+ sb.append("<th>Testable</th>");
+ sb.append("<th>Tested</th>");
+ sb.append("<th>Coverage %</th>");
+ sb.append("</tr>");
+
+ boolean odd = true;
+
+ for (String sectionId : auditParser.getSectionIds()) {
+
+ // Chapters have no .'s in their id
+ if (sectionId.split("[.]").length == 1)
+ {
+ String prefix = sectionId + ".";
+
+ int assertions = auditParser.getAssertionsForSection(sectionId).size();
+ int testable = 0;
+ int coverage = 0;
+
+ for (AuditAssertion assertion : auditParser.getAssertionsForSection(sectionId))
+ {
+ if (assertion.isTestable()) testable++;
+
+ if (!getCoverageForAssertion(sectionId, assertion.getId()).isEmpty())
+ {
+ coverage++;
+ }
+ }
+
+ // Gather stats here
+ for (String subSectionId : auditParser.getSectionIds())
+ {
+ if (subSectionId.startsWith(prefix))
+ {
+ assertions += auditParser.getAssertionsForSection(subSectionId).size();
+
+ for (AuditAssertion assertion : auditParser.getAssertionsForSection(subSectionId))
+ {
+ if (assertion.isTestable()) testable++;
+
+ if (!getCoverageForAssertion(subSectionId, assertion.getId()).isEmpty())
+ {
+ coverage++;
+ }
+ }
+ }
+ }
+
+ if (odd)
+ {
+ sb.append("<tr style=\"background-color:#f7f7f7\">");
+ }
+ else
+ {
+ sb.append("<tr>");
+ }
+
+ odd = !odd;
+
+ int margin = (sectionId.split("[.]").length - 1) * 16;
+
+ sb.append("<td style=\"padding-left:" + margin + "px\">");
+ sb.append("<a href=\"#" + sectionId + "\">");
+ sb.append(sectionId);
+ sb.append(" ");
+ sb.append(auditParser.getSectionTitle(sectionId));
+ sb.append("</a>");
+ sb.append("</td>");
+
+ double coveragePercent = assertions > 0 ? ((coverage * 1.0) / assertions) * 100 : -1;
+
+ sb.append("<td align=\"center\">");
+ sb.append(assertions);
+ sb.append("</td>");
+
+ sb.append("<td align=\"center\">");
+ sb.append(testable);
+ sb.append("</td>");
+
+ sb.append("<td align=\"center\">");
+ sb.append(coverage);
+ sb.append("</td>");
+
+ if (coveragePercent >= 0)
+ {
+ String bgColor = coveragePercent < 60 ? "#ffaaaa" : coveragePercent < 80 ? "#ffffaa" : "#aaffaa" ;
+
+ sb.append("<td align=\"center\" style=\"background-color:" + bgColor + "\">");
+ sb.append(String.format("%.2f%%", coveragePercent));
+ sb.append("</td>");
+ }
+ else
+ {
+ sb.append("<td />");
+ }
+
+ sb.append("</tr>");
+
+ }
+
+ }
+
+ sb.append("</table>");
+ out.write(sb.toString().getBytes());
+ }
+
private void writeSectionSummary(OutputStream out) throws IOException {
StringBuilder sb = new StringBuilder();
@@ -324,17 +441,13 @@
sb.append("</td>");
int assertions = auditParser.getAssertionsForSection(sectionId).size();
- int testable = 0;
-
- for (AuditAssertion a : auditParser.getAssertionsForSection(sectionId))
- {
- if (a.isTestable()) testable++;
- }
-
+ int testable = 0;
int coverage = 0;
for (AuditAssertion assertion : auditParser.getAssertionsForSection(sectionId))
{
+ if (assertion.isTestable()) testable++;
+
if (!getCoverageForAssertion(sectionId, assertion.getId()).isEmpty())
{
coverage++;
15 years, 9 months
Hibernate SVN: r16015 - branches/Branch_3_2/HibernateExt/tools/src/testsupport.
by hibernate-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2009-02-20 12:18:17 -0500 (Fri, 20 Feb 2009)
New Revision: 16015
Modified:
branches/Branch_3_2/HibernateExt/tools/src/testsupport/NoopReverseEngineeringStrategy.java
Log:
remove java5 specific code
Modified: branches/Branch_3_2/HibernateExt/tools/src/testsupport/NoopReverseEngineeringStrategy.java
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/testsupport/NoopReverseEngineeringStrategy.java 2009-02-20 17:10:42 UTC (rev 16014)
+++ branches/Branch_3_2/HibernateExt/tools/src/testsupport/NoopReverseEngineeringStrategy.java 2009-02-20 17:18:17 UTC (rev 16015)
@@ -169,13 +169,13 @@
return false;
}
- @Override
+
public AssociationInfo foreignKeyToAssociationInfo(ForeignKey foreignKey) {
// TODO Auto-generated method stub
return null;
}
- @Override
+
public String foreignKeyToInverseEntityName(String keyname,
TableIdentifier fromTable, List fromColumnNames,
TableIdentifier referencedTable, List referencedColumnNames,
@@ -184,7 +184,7 @@
return null;
}
- @Override
+
public AssociationInfo foreignKeyToInverseAssociationInfo(ForeignKey foreignKey) {
// TODO Auto-generated method stub
return null;
15 years, 9 months
Hibernate SVN: r16014 - in validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine: groups and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-02-20 12:10:42 -0500 (Fri, 20 Feb 2009)
New Revision: 16014
Modified:
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/groups/GroupTest.java
Log:
Added testcase for HV-108
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java 2009-02-20 16:47:47 UTC (rev 16013)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java 2009-02-20 17:10:42 UTC (rev 16014)
@@ -34,9 +34,12 @@
import org.hibernate.validation.eg.Customer;
import org.hibernate.validation.eg.Engine;
import org.hibernate.validation.eg.Order;
+import org.hibernate.validation.eg.Person;
import org.hibernate.validation.eg.UnconstraintEntity;
+import org.hibernate.validation.engine.groups.User;
import org.hibernate.validation.util.LoggerFactory;
import org.hibernate.validation.util.TestUtil;
+import static org.hibernate.validation.util.TestUtil.assertConstraintViolation;
/**
* Tests for the implementation of <code>Validator</code>.
@@ -62,7 +65,6 @@
}
}
-
@Test(expected = IllegalArgumentException.class)
public void testNullParamterToValidatorImplConstructor() {
TestUtil.getValidator().getConstraintsForClass( null );
@@ -232,7 +234,6 @@
}
@Test
- // @SpecAssertion( section = "2.2" )
public void testMultiValueConstraint() {
Validator validator = TestUtil.getValidator();
@@ -251,7 +252,6 @@
}
@Test
- // @SpecAssertion( section = "3.5.1" )
public void testGraphValidation() {
Validator validator = TestUtil.getValidator();
@@ -299,4 +299,37 @@
constraintViolations = validator.validateValue( Customer.class, "orderList[0].orderNumber", "1234" );
assertEquals( "Wrong number of constraints", 0, constraintViolations.size() );
}
+
+ /**
+ * HV-108
+ */
+ @Test
+ public void testValidationIsPolymorphic() {
+ Validator validator = TestUtil.getValidator();
+
+ Customer customer = new Customer();
+ customer.setFirstName( "Foo" );
+ customer.setLastName( "Bar" );
+
+ Order order = new Order();
+ customer.addOrder( order );
+
+ Person person = customer;
+
+ Set<ConstraintViolation<Person>> constraintViolations = validator.validate( person );
+ assertEquals( "Wrong number of constraints", 1, constraintViolations.size() );
+
+ assertConstraintViolation(
+ constraintViolations.iterator().next(),
+ "may not be null",
+ Customer.class,
+ null,
+ "orderList[0].orderNumber"
+ );
+
+ order.setOrderNumber( 123 );
+
+ constraintViolations = validator.validate( person );
+ assertEquals( "Wrong number of constraints", 0, constraintViolations.size() );
+ }
}
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/groups/GroupTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/groups/GroupTest.java 2009-02-20 16:47:47 UTC (rev 16013)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/groups/GroupTest.java 2009-02-20 17:10:42 UTC (rev 16014)
@@ -257,6 +257,9 @@
);
}
+ /**
+ * HV-85
+ */
@Test
public void testGroupSequenceFollowedByGroup() {
User user = new User();
15 years, 9 months
Hibernate SVN: r16013 - validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/groups.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-02-20 11:47:47 -0500 (Fri, 20 Feb 2009)
New Revision: 16013
Modified:
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/groups/GroupTest.java
Log:
Removed obsolete import
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/groups/GroupTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/groups/GroupTest.java 2009-02-20 16:46:58 UTC (rev 16012)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/groups/GroupTest.java 2009-02-20 16:47:47 UTC (rev 16013)
@@ -18,11 +18,10 @@
package org.hibernate.validation.engine.groups;
import java.util.HashSet;
-import java.util.Set;
import java.util.Iterator;
+import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
-import javax.validation.constraints.NotNull;
import javax.validation.groups.Default;
import static org.junit.Assert.assertEquals;
@@ -33,7 +32,6 @@
import org.hibernate.validation.eg.Book;
import org.hibernate.validation.eg.DefaultAlias;
import org.hibernate.validation.eg.Dictonary;
-import org.hibernate.validation.eg.FrenchAddress;
import org.hibernate.validation.eg.groups.First;
import org.hibernate.validation.eg.groups.Last;
import org.hibernate.validation.eg.groups.Second;
15 years, 9 months