[hibernate-commits] Hibernate SVN: r15846 - in validator/trunk/hibernate-validator/src: main/resources/org/hibernate/validation and 4 other directories.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Mon Feb 2 06:56:16 EST 2009


Author: hardy.ferentschik
Date: 2009-02-02 06:56:15 -0500 (Mon, 02 Feb 2009)
New Revision: 15846

Added:
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/AssertFalseValidator.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/AssertTrueValidator.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/FutureValidatorForCalendar.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/FutureValidatorForDate.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/LengthValidator.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MaxValidatorForNumber.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MaxValidatorForString.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MinValidatorForNumber.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MinValidatorForString.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NotEmptyValidator.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NullConstraintValidator.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PastConstraintCalendarValidator.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PastConstraintDateValidator.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PatternValidator.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/AssertFalseValidatorTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/AssertTrueValidatorTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/FutureValidatorForCalendarTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/FutureValidatorForDateTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/LengthValidatorTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MaxValidatorForNumberTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MaxValidatorForStringTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MinValidatorForNumberTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MinValidatorForStringTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotEmptyValidatorTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotNullValidatorTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NullValidatorTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PastValidatorForCalendarTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PastValidatorForDateTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PatternValidatorTest.java
Removed:
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/LengthConstraintValidator.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NotEmptyConstraintValidator.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PatternConstraintValidator.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/LengthConstraintTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotEmptyConstraintTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotNullConstraintTest.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PatternConstraintTest.java
Modified:
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/Length.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NotEmpty.java
   validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/Pattern.java
   validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validation/ValidationMessages.properties
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/composition/FrenchZipcode.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/incomplete/NoGroups.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/incomplete/NoGroupsConstraintValidator.java
   validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ConstraintCompositionTest.java
Log:
BVAL-104 Applied patches and changed class names to be consistent.

Added: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/AssertFalseValidator.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/AssertFalseValidator.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/AssertFalseValidator.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,42 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.AssertTrue;
+
+/**
+ * Validates that the value passed is false
+ *
+ * @author Alaa Nassef
+ */
+public class AssertFalseValidator implements ConstraintValidator<AssertTrue, Boolean> {
+
+	public void initialize(AssertTrue constraintAnnotation) {
+	}
+
+	public boolean isValid(Boolean bool, ConstraintValidatorContext constraintValidatorContext) {
+		//null values are valid
+		if ( bool == null ) {
+			return true;
+		}
+		return !bool;
+	}
+
+}


Property changes on: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/AssertFalseValidator.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/AssertTrueValidator.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/AssertTrueValidator.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/AssertTrueValidator.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,42 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.AssertTrue;
+
+/**
+ * Validates that the value passed is true
+ *
+ * @author Alaa Nassef
+ */
+public class AssertTrueValidator implements ConstraintValidator<AssertTrue, Boolean> {
+
+	public void initialize(AssertTrue constraintAnnotation) {
+	}
+
+	public boolean isValid(Boolean bool, ConstraintValidatorContext constraintValidatorContext) {
+		//null values are valid
+		if ( bool == null ) {
+			return true;
+		}
+		return bool;
+	}
+
+}


Property changes on: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/AssertTrueValidator.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/FutureValidatorForCalendar.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/FutureValidatorForCalendar.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/FutureValidatorForCalendar.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,43 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import java.util.Calendar;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Past;
+
+/**
+ * Check that the <code>java.util.Calendar</code> passed to be validated is in
+ * the future.
+ *
+ * @author Alaa Nassef
+ */
+public class FutureValidatorForCalendar implements ConstraintValidator<Past, Calendar> {
+
+	public void initialize(Past constraintAnnotation) {
+	}
+
+	public boolean isValid(Calendar cal, ConstraintValidatorContext constraintValidatorContext) {
+		//null values are valid
+		if ( cal == null ) {
+			return true;
+		}
+		return cal.after( Calendar.getInstance() );
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/FutureValidatorForCalendar.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/FutureValidatorForDate.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/FutureValidatorForDate.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/FutureValidatorForDate.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,43 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import java.util.Date;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Past;
+
+/**
+ * Check that the <code>java.util.Date</code> passed to be validated is in the
+ * future.
+ *
+ * @author Alaa Nassef
+ */
+public class FutureValidatorForDate implements ConstraintValidator<Past, Date> {
+
+	public void initialize(Past constraintAnnotation) {
+	}
+
+	public boolean isValid(Date date, ConstraintValidatorContext constraintValidatorContext) {
+		//null values are valid
+		if ( date == null ) {
+			return true;
+		}
+		return date.after( new Date() );
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/FutureValidatorForDate.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/Length.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/Length.java	2009-02-01 23:25:06 UTC (rev 15845)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/Length.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -32,7 +32,7 @@
  * @author Emmanuel Bernard
  */
 @Documented
- at Constraint(validatedBy = LengthConstraintValidator.class)
+ at Constraint(validatedBy = LengthValidator.class)
 @Target({ METHOD, FIELD, TYPE })
 @Retention(RUNTIME)
 public @interface Length {

Deleted: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/LengthConstraintValidator.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/LengthConstraintValidator.java	2009-02-01 23:25:06 UTC (rev 15845)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/LengthConstraintValidator.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -1,46 +0,0 @@
-// $Id$
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package org.hibernate.validation.constraints;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * Check that a string's length is between min and max.
- *
- * @author Emmanuel Bernard
- * @author Gavin King
- */
-public class LengthConstraintValidator implements ConstraintValidator<Length, String> {
-	private int min;
-	private int max;
-
-	public void initialize(Length parameters) {
-		min = parameters.min();
-		max = parameters.max();
-	}
-
-	public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) {
-		if ( value == null ) {
-			return true;
-		}
-		int length = value.length();
-		return length >= min && length <= max;
-	}
-
-}
\ No newline at end of file

Copied: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/LengthValidator.java (from rev 15845, validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/LengthConstraintValidator.java)
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/LengthValidator.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/LengthValidator.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,46 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+
+/**
+ * Check that a string's length is between min and max.
+ *
+ * @author Emmanuel Bernard
+ * @author Gavin King
+ */
+public class LengthValidator implements ConstraintValidator<Length, String> {
+	private int min;
+	private int max;
+
+	public void initialize(Length parameters) {
+		min = parameters.min();
+		max = parameters.max();
+	}
+
+	public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) {
+		if ( value == null ) {
+			return true;
+		}
+		int length = value.length();
+		return length >= min && length <= max;
+	}
+
+}
\ No newline at end of file


Property changes on: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/LengthValidator.java
___________________________________________________________________
Name: svn:keywords
   + Id

Added: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MaxValidatorForNumber.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MaxValidatorForNumber.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MaxValidatorForNumber.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,59 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Max;
+
+/**
+ * Check that the number being validated is less than or equal to the maximum
+ * value specified.
+ *
+ * @author Alaa Nassef
+ */
+public class MaxValidatorForNumber implements ConstraintValidator<Max, Number> {
+
+	private long maxValue;
+
+	public void initialize(Max maxValue) {
+		this.maxValue = maxValue.value();
+	}
+
+	public boolean isValid(Number value, ConstraintValidatorContext constraintValidatorContext) {
+		//null values are valid
+		if ( value == null ) {
+			return true;
+		}
+		if ( value instanceof BigDecimal ) {
+			return ( ( BigDecimal ) value ).compareTo( BigDecimal.valueOf( maxValue ) ) != 1;
+		}
+		else if ( value instanceof BigInteger ) {
+			return ( ( BigInteger ) value ).compareTo( BigInteger.valueOf( maxValue ) ) != 1;
+		}
+		else if ( value instanceof Number ) {
+			double doubleValue = value.doubleValue();
+			return doubleValue <= maxValue;
+		}
+		else {
+			return false;
+		}
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MaxValidatorForNumber.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MaxValidatorForString.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MaxValidatorForString.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MaxValidatorForString.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,51 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import java.math.BigDecimal;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Max;
+
+/**
+ * Check that the String being validated represents a number, and has a value
+ * less than or equal to the maximum value specified.
+ *
+ * @author Alaa Nassef
+ */
+public class MaxValidatorForString implements ConstraintValidator<Max, String> {
+
+	private long maxValue;
+
+	public void initialize(Max maxValue) {
+		this.maxValue = maxValue.value();
+	}
+
+	public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) {
+		//null values are valid
+		if ( value == null ) {
+			return true;
+		}
+		try {
+			return new BigDecimal( value ).compareTo( BigDecimal.valueOf( maxValue ) ) != 1;
+		}
+		catch ( NumberFormatException nfe ) {
+			return false;
+		}
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MaxValidatorForString.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MinValidatorForNumber.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MinValidatorForNumber.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MinValidatorForNumber.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,59 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Min;
+
+/**
+ * Check that the number being validated is greater than or equal to the minimum
+ * value specified.
+ *
+ * @author Alaa Nassef
+ */
+public class MinValidatorForNumber implements ConstraintValidator<Min, Number> {
+
+	private long minValue;
+
+	public void initialize(Min minValue) {
+		this.minValue = minValue.value();
+	}
+
+	public boolean isValid(Number value, ConstraintValidatorContext constraintValidatorContext) {
+		//null values are valid
+		if ( value == null ) {
+			return true;
+		}
+		if ( value instanceof BigDecimal ) {
+			return ( ( BigDecimal ) value ).compareTo( BigDecimal.valueOf( minValue ) ) != -1;
+		}
+		else if ( value instanceof BigInteger ) {
+			return ( ( BigInteger ) value ).compareTo( BigInteger.valueOf( minValue ) ) != -1;
+		}
+		else if ( value instanceof Number ) {
+			double doubleValue = value.doubleValue();
+			return doubleValue >= minValue;
+		}
+		else {
+			return false;
+		}
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MinValidatorForNumber.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MinValidatorForString.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MinValidatorForString.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MinValidatorForString.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,51 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import java.math.BigDecimal;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Min;
+
+/**
+ * Check that the String being validated represents a number, and has a value
+ * more than or equal to the minimum value specified.
+ *
+ * @author Alaa Nassef
+ */
+public class MinValidatorForString implements ConstraintValidator<Min, String> {
+
+	private long minValue;
+
+	public void initialize(Min minValue) {
+		this.minValue = minValue.value();
+	}
+
+	public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) {
+		//null values are valid
+		if ( value == null ) {
+			return true;
+		}
+		try {
+			return new BigDecimal( ( String ) value ).compareTo( BigDecimal.valueOf( minValue ) ) != -1;
+		}
+		catch ( NumberFormatException nfe ) {
+			return false;
+		}
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/MinValidatorForString.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NotEmpty.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NotEmpty.java	2009-02-01 23:25:06 UTC (rev 15845)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NotEmpty.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -29,7 +29,7 @@
  * @author Emmanuel Bernard
  */
 @Documented
- at Constraint(validatedBy = NotEmptyConstraintValidator.class)
+ at Constraint(validatedBy = NotEmptyValidator.class)
 @Target({ METHOD, FIELD })
 @Retention(RUNTIME)
 public @interface NotEmpty {

Deleted: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NotEmptyConstraintValidator.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NotEmptyConstraintValidator.java	2009-02-01 23:25:06 UTC (rev 15845)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NotEmptyConstraintValidator.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -1,39 +0,0 @@
-// $Id$
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,  
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package org.hibernate.validation.constraints;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * @author Hardy Ferentschik
- * @todo Extend to not only support strings, but also collections and maps. Needs to be specified first though.
- */
-public class NotEmptyConstraintValidator implements ConstraintValidator<NotEmpty, String> {
-
-	public void initialize(NotEmpty parameters) {
-	}
-
-	public boolean isValid(String object, ConstraintValidatorContext constraintValidatorContext) {
-		if ( object == null ) {
-			return true;
-		}
-		int length = object.length();
-		return length > 0;
-	}
-}

Copied: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NotEmptyValidator.java (from rev 15845, validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NotEmptyConstraintValidator.java)
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NotEmptyValidator.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NotEmptyValidator.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,39 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,  
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+
+/**
+ * @author Hardy Ferentschik
+ * @todo Extend to not only support strings, but also collections and maps. Needs to be specified first though.
+ */
+public class NotEmptyValidator implements ConstraintValidator<NotEmpty, String> {
+
+	public void initialize(NotEmpty parameters) {
+	}
+
+	public boolean isValid(String object, ConstraintValidatorContext constraintValidatorContext) {
+		if ( object == null ) {
+			return true;
+		}
+		int length = object.length();
+		return length > 0;
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NotEmptyValidator.java
___________________________________________________________________
Name: svn:keywords
   + Id

Added: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NullConstraintValidator.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NullConstraintValidator.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NullConstraintValidator.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,38 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Null;
+
+/**
+ * Validate that the object is <code>null</code>
+ *
+ * @author Alaa Nassef
+ */
+public class NullConstraintValidator implements ConstraintValidator<Null, Object> {
+
+	public void initialize(Null constraintAnnotation) {
+	}
+
+	public boolean isValid(Object object, ConstraintValidatorContext constraintValidatorContext) {
+		return object == null;
+	}
+
+}


Property changes on: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/NullConstraintValidator.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PastConstraintCalendarValidator.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PastConstraintCalendarValidator.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PastConstraintCalendarValidator.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,43 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import java.util.Calendar;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Past;
+
+/**
+ * Check that the <code>java.util.Calendar</code> passed to be validated is in the
+ * past.
+ *
+ * @author Alaa Nassef
+ */
+public class PastConstraintCalendarValidator implements ConstraintValidator<Past, Calendar> {
+
+	public void initialize(Past constraintAnnotation) {
+	}
+
+	public boolean isValid(Calendar cal, ConstraintValidatorContext constraintValidatorContext) {
+		//null values are valid
+		if ( cal == null ) {
+			return true;
+		}
+		return cal.before( Calendar.getInstance() );
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PastConstraintCalendarValidator.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PastConstraintDateValidator.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PastConstraintDateValidator.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PastConstraintDateValidator.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,43 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import java.util.Date;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.constraints.Past;
+
+/**
+ * Check that the <code>java.util.Date</code> passed to be validated is in the
+ * past.
+ *
+ * @author Alaa Nassef
+ */
+public class PastConstraintDateValidator implements ConstraintValidator<Past, Date> {
+
+	public void initialize(Past constraintAnnotation) {
+	}
+
+	public boolean isValid(Date date, ConstraintValidatorContext constraintValidatorContext) {
+		//null values are valid
+		if ( date == null ) {
+			return true;
+		}
+		return date.before( new Date() );
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PastConstraintDateValidator.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/Pattern.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/Pattern.java	2009-02-01 23:25:06 UTC (rev 15845)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/Pattern.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -29,7 +29,7 @@
  * @author Hardy Ferentschik
  */
 @Documented
- at Constraint(validatedBy = PatternConstraintValidator.class)
+ at Constraint(validatedBy = PatternValidator.class)
 @Target({ METHOD, FIELD })
 @Retention(RUNTIME)
 public @interface Pattern {

Deleted: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PatternConstraintValidator.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PatternConstraintValidator.java	2009-02-01 23:25:06 UTC (rev 15845)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PatternConstraintValidator.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -1,45 +0,0 @@
-// $Id$
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,  
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package org.hibernate.validation.constraints;
-
-import java.util.regex.Matcher;
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * @author Hardy Ferentschik
- */
-public class PatternConstraintValidator implements ConstraintValidator<Pattern, String> {
-
-	private java.util.regex.Pattern pattern;
-
-	public void initialize(Pattern parameters) {
-		pattern = java.util.regex.Pattern.compile(
-				parameters.regex(),
-				parameters.flags()
-		);
-	}
-
-	public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) {
-		if ( value == null ) {
-			return true;
-		}
-		Matcher m = pattern.matcher( value );
-		return m.matches();
-	}
-}

Copied: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PatternValidator.java (from rev 15845, validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PatternConstraintValidator.java)
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PatternValidator.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PatternValidator.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,45 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,  
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import java.util.regex.Matcher;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public class PatternValidator implements ConstraintValidator<Pattern, String> {
+
+	private java.util.regex.Pattern pattern;
+
+	public void initialize(Pattern parameters) {
+		pattern = java.util.regex.Pattern.compile(
+				parameters.regex(),
+				parameters.flags()
+		);
+	}
+
+	public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) {
+		if ( value == null ) {
+			return true;
+		}
+		Matcher m = pattern.matcher( value );
+		return m.matches();
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PatternValidator.java
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validation/ValidationMessages.properties
===================================================================
--- validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validation/ValidationMessages.properties	2009-02-01 23:25:06 UTC (rev 15845)
+++ validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validation/ValidationMessages.properties	2009-02-02 11:56:15 UTC (rev 15846)
@@ -3,4 +3,9 @@
 validator.size=size must be between {min} and {max}
 validator.length=length must be between {min} and {max}
 validator.notEmpty=may not be empty
-\validator.pattern=must match "{regex}"
\ No newline at end of file
+validator.pattern=must match "{regex}"
+validator.min=must be greater than {value}
+validator.max=must be less than {value}
+validator.null=must be null
+validator.past=must be in the past
+validator.future=must be in the future

Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/AssertFalseValidatorTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/AssertFalseValidatorTest.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/AssertFalseValidatorTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,45 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Alaa Nassef
+ */
+public class AssertFalseValidatorTest {
+
+	private static AssertFalseValidator constraint;
+
+	@BeforeClass
+	public static void init() {
+		constraint = new AssertFalseValidator();
+	}
+
+	@Test
+	public void testIsValid() {
+		assertTrue( constraint.isValid( null, null ) );
+		assertTrue( constraint.isValid( false, null ) );
+		assertTrue( constraint.isValid( Boolean.FALSE, null ) );
+		assertFalse( constraint.isValid( true, null ) );
+		assertFalse( constraint.isValid( Boolean.TRUE, null ) );
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/AssertFalseValidatorTest.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/AssertTrueValidatorTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/AssertTrueValidatorTest.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/AssertTrueValidatorTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,45 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Alaa Nassef
+ */
+public class AssertTrueValidatorTest {
+
+	private static AssertTrueValidator constraint;
+
+	@BeforeClass
+	public static void init() {
+		constraint = new AssertTrueValidator();
+	}
+
+	@Test
+	public void testIsValid() {
+		assertTrue( constraint.isValid( null, null ) );
+		assertTrue( constraint.isValid( true, null ) );
+		assertTrue( constraint.isValid( Boolean.TRUE, null ) );
+		assertFalse( constraint.isValid( false, null ) );
+		assertFalse( constraint.isValid( Boolean.FALSE, null ) );
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/AssertTrueValidatorTest.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/FutureValidatorForCalendarTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/FutureValidatorForCalendarTest.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/FutureValidatorForCalendarTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,60 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import java.util.Calendar;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class FutureValidatorForCalendarTest {
+
+	private static FutureValidatorForCalendar constraint;
+
+	@BeforeClass
+	public static void init() {
+		constraint = new FutureValidatorForCalendar();
+	}
+
+	@Test
+	public void testIsValid() {
+		Calendar futureDate = getFutureDate();
+		Calendar pastDate = getPastDate();
+		assertTrue( constraint.isValid( null, null ) );
+		assertTrue( constraint.isValid( futureDate, null ) );
+		assertFalse( constraint.isValid( Calendar.getInstance(), null ) );
+		assertFalse( constraint.isValid( pastDate, null ) );
+	}
+
+	private Calendar getFutureDate() {
+		Calendar cal = Calendar.getInstance();
+		int year = cal.get( Calendar.YEAR );
+		cal.set( Calendar.YEAR, year + 1 );
+		return cal;
+	}
+
+	private Calendar getPastDate() {
+		Calendar cal = Calendar.getInstance();
+		int year = cal.get( Calendar.YEAR );
+		cal.set( Calendar.YEAR, year - 1 );
+		return cal;
+	}
+
+}


Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/FutureValidatorForCalendarTest.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/FutureValidatorForDateTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/FutureValidatorForDateTest.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/FutureValidatorForDateTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,60 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import java.util.Date;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class FutureValidatorForDateTest {
+
+	private static FutureValidatorForDate constraint;
+
+	@BeforeClass
+	public static void init() {
+		constraint = new FutureValidatorForDate();
+	}
+
+	@Test
+	public void testIsValid() {
+		Date futureDate = getFutureDate();
+		Date pastDate = getPastDate();
+		assertTrue( constraint.isValid( null, null ) );
+		assertTrue( constraint.isValid( futureDate, null ) );
+		assertFalse( constraint.isValid( new Date(), null ) );
+		assertFalse( constraint.isValid( pastDate, null ) );
+	}
+
+	private Date getFutureDate() {
+		Date date = new Date();
+		long timeStamp = date.getTime();
+		date.setTime( timeStamp + 31557600000l );
+		return date;
+	}
+
+	private Date getPastDate() {
+		Date date = new Date();
+		long timeStamp = date.getTime();
+		date.setTime( timeStamp - 31557600000l );
+		return date;
+	}
+
+}


Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/FutureValidatorForDateTest.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Deleted: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/LengthConstraintTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/LengthConstraintTest.java	2009-02-01 23:25:06 UTC (rev 15845)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/LengthConstraintTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -1,80 +0,0 @@
-// $Id$
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,  
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package org.hibernate.validation.constraints;
-
-import java.lang.annotation.Annotation;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import org.junit.Test;
-import org.junit.Before;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-
-/**
- * Tests the <code>LengthConstraint</code>.
- *
- * @author Hardy Ferentschik
- */
-public class LengthConstraintTest {
-
-	LengthConstraintValidator constraint;
-
-	@Before
-	public void init() {
-		constraint = new LengthConstraintValidator();
-		constraint.initialize(
-				new Length() {
-
-					public int min() {
-						return 1;
-					}
-
-					public int max() {
-						return 3;
-					}
-
-					public String message() {
-						return "{validator.length}";
-					}
-
-					public Class<?>[] groups() {
-						return new Class<?>[0];
-					}
-
-					public Class<? extends Annotation> annotationType() {
-						return this.getClass();
-					}
-				}
-		);
-	}
-
-	@Test
-	public void testIsValid() {
-
-		assertTrue( constraint.isValid( null, null ) );
-		assertFalse( constraint.isValid( "", null ) );
-		assertTrue( constraint.isValid( "f", null ) );
-		assertTrue( constraint.isValid( "fo", null ) );
-		assertTrue( constraint.isValid( "foo", null ) );
-		assertFalse( constraint.isValid( "foobar", null ) );
-
-	}
-
-}

Copied: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/LengthValidatorTest.java (from rev 15845, validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/LengthConstraintTest.java)
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/LengthValidatorTest.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/LengthValidatorTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,58 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,  
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.hibernate.validation.util.annotationfactory.AnnotationDescriptor;
+import org.hibernate.validation.util.annotationfactory.AnnotationFactory;
+
+/**
+ * Tests the <code>LengthConstraint</code>.
+ *
+ * @author Hardy Ferentschik
+ */
+public class LengthValidatorTest {
+
+	private static LengthValidator constraint;
+
+	@BeforeClass
+	public static void init() {
+		AnnotationDescriptor descriptor = new AnnotationDescriptor( Length.class );
+		descriptor.setValue( "min", 1 );
+		descriptor.setValue( "max", 3 );
+		descriptor.setValue( "message", "{validator.length}" );
+		Length l = AnnotationFactory.create( descriptor );
+		constraint = new LengthValidator();
+		constraint.initialize( l );
+	}
+
+	@Test
+	public void testIsValid() {
+
+		assertTrue( constraint.isValid( null, null ) );
+		assertFalse( constraint.isValid( "", null ) );
+		assertTrue( constraint.isValid( "f", null ) );
+		assertTrue( constraint.isValid( "fo", null ) );
+		assertTrue( constraint.isValid( "foo", null ) );
+		assertFalse( constraint.isValid( "foobar", null ) );
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/LengthValidatorTest.java
___________________________________________________________________
Name: svn:keywords
   + Id

Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MaxValidatorForNumberTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MaxValidatorForNumberTest.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MaxValidatorForNumberTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,66 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import javax.validation.constraints.Max;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.hibernate.validation.util.annotationfactory.AnnotationDescriptor;
+import org.hibernate.validation.util.annotationfactory.AnnotationFactory;
+
+/**
+ * @author Alaa Nassef
+ * @author Hardy Ferentschik
+ */
+public class MaxValidatorForNumberTest {
+
+	private static MaxValidatorForNumber constraint;
+
+	@BeforeClass
+	public static void init() {
+		AnnotationDescriptor descriptor = new AnnotationDescriptor( Max.class );
+		descriptor.setValue( "value", 15l );
+		descriptor.setValue( "message", "{validator.max}" );
+		Max m = AnnotationFactory.create( descriptor );
+
+		constraint = new MaxValidatorForNumber();
+		constraint.initialize( m );
+	}
+
+	@Test
+	public void testIsValid() {
+		assertTrue( constraint.isValid( null, null ) );
+		assertTrue( constraint.isValid( 15l, null ) );
+		assertTrue( constraint.isValid( 15, null ) );
+		assertTrue( constraint.isValid( 15.0, null ) );
+		assertTrue( constraint.isValid( BigDecimal.valueOf( -156000000000.0 ), null ) );
+		assertTrue( constraint.isValid( BigInteger.valueOf( -10000000l ), null ) );
+		assertTrue( constraint.isValid( 10, null ) );
+		assertTrue( constraint.isValid( 14.99, null ) );
+		assertTrue( constraint.isValid( -14.99, null ) );
+		assertFalse( constraint.isValid( 20, null ) );
+		assertFalse( constraint.isValid( BigDecimal.valueOf( 156000000000.0 ), null ) );
+		assertFalse( constraint.isValid( BigInteger.valueOf( 10000000l ), null ) );
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MaxValidatorForNumberTest.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MaxValidatorForStringTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MaxValidatorForStringTest.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MaxValidatorForStringTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,61 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import javax.validation.constraints.Max;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.BeforeClass;
+
+import org.hibernate.validation.util.annotationfactory.AnnotationDescriptor;
+import org.hibernate.validation.util.annotationfactory.AnnotationFactory;
+
+/**
+ * @author Alaa Nassef
+ */
+public class MaxValidatorForStringTest {
+
+	private static MaxValidatorForString constraint;
+
+	@BeforeClass
+	public static void init() {
+		AnnotationDescriptor descriptor = new AnnotationDescriptor( Max.class );
+		descriptor.setValue( "value", 15l );
+		descriptor.setValue( "message", "{validator.max}" );
+		Max m = AnnotationFactory.create( descriptor );
+
+		constraint = new MaxValidatorForString();
+		constraint.initialize( m );
+	}
+
+	@Test
+	public void testIsValid() {
+		assertTrue( constraint.isValid( null, null ) );
+		assertTrue( constraint.isValid( "15", null ) );
+		assertTrue( constraint.isValid( "15.0", null ) );
+		assertTrue( constraint.isValid( "10", null ) );
+		assertTrue( constraint.isValid( "14.99", null ) );
+		assertTrue( constraint.isValid( "-14.99", null ) );
+		assertFalse( constraint.isValid( "20", null ) );
+		//number format exception
+		assertFalse( constraint.isValid( "15l", null ) );
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MaxValidatorForStringTest.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MinValidatorForNumberTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MinValidatorForNumberTest.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MinValidatorForNumberTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,66 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import javax.validation.constraints.Min;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.hibernate.validation.util.annotationfactory.AnnotationDescriptor;
+import org.hibernate.validation.util.annotationfactory.AnnotationFactory;
+
+/**
+ * @author Alaa Nassef
+ * @author Hardy Ferentschik
+ */
+public class MinValidatorForNumberTest {
+
+	private static MinValidatorForNumber constraint;
+
+	@BeforeClass
+	public static void init() {
+		AnnotationDescriptor descriptor = new AnnotationDescriptor( Min.class );
+		descriptor.setValue( "value", 15l );
+		descriptor.setValue( "message", "{validator.min}" );
+		Min m = AnnotationFactory.create( descriptor );
+
+		constraint = new MinValidatorForNumber();
+		constraint.initialize( m );
+	}
+
+	@Test
+	public void testIsValid() {
+		assertTrue( constraint.isValid( null, null ) );
+		assertTrue( constraint.isValid( 20, null ) );
+		assertTrue( constraint.isValid( 15l, null ) );
+		assertTrue( constraint.isValid( 15, null ) );
+		assertTrue( constraint.isValid( 15.0, null ) );
+		assertTrue( constraint.isValid( BigDecimal.valueOf( 156000000000.0 ), null ) );
+		assertTrue( constraint.isValid( BigInteger.valueOf( 10000000l ), null ) );
+		assertFalse( constraint.isValid( BigDecimal.valueOf( -156000000000.0 ), null ) );
+		assertFalse( constraint.isValid( BigInteger.valueOf( -10000000l ), null ) );
+		assertFalse( constraint.isValid( 10, null ) );
+		assertFalse( constraint.isValid( 14.99, null ) );
+		assertFalse( constraint.isValid( -14.99, null ) );
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MinValidatorForNumberTest.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MinValidatorForStringTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MinValidatorForStringTest.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MinValidatorForStringTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,61 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import javax.validation.constraints.Min;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.hibernate.validation.util.annotationfactory.AnnotationDescriptor;
+import org.hibernate.validation.util.annotationfactory.AnnotationFactory;
+
+/**
+ * @author Alaa Nassef
+ */
+public class MinValidatorForStringTest {
+
+	private static MinValidatorForString constraint;
+
+	@BeforeClass
+	public static void init() {
+		AnnotationDescriptor descriptor = new AnnotationDescriptor( Min.class );
+		descriptor.setValue( "value", 15l );
+		descriptor.setValue( "message", "{validator.min}" );
+		Min m = AnnotationFactory.create( descriptor );
+
+		constraint = new MinValidatorForString();
+		constraint.initialize( m );
+	}
+
+	@Test
+	public void testIsValid() {
+		assertTrue( constraint.isValid( null, null ) );
+		assertTrue( constraint.isValid( "20", null ) );
+		assertTrue( constraint.isValid( "15", null ) );
+		assertTrue( constraint.isValid( "15.0", null ) );
+		assertFalse( constraint.isValid( "10", null ) );
+		assertFalse( constraint.isValid( "14.99", null ) );
+		assertFalse( constraint.isValid( "-14.99", null ) );
+		//number format exception
+		assertFalse( constraint.isValid( "15l", null ) );
+	}
+
+}


Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/MinValidatorForStringTest.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Deleted: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotEmptyConstraintTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotEmptyConstraintTest.java	2009-02-01 23:25:06 UTC (rev 15845)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotEmptyConstraintTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -1,49 +0,0 @@
-// $Id$
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,  
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package org.hibernate.validation.constraints;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import org.junit.Test;
-import org.junit.Before;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-
-/**
- * @author Hardy Ferentschik
- */
-public class NotEmptyConstraintTest {
-
-	NotEmptyConstraintValidator constraint;
-
-	@Before
-	public void init() {
-		constraint = new NotEmptyConstraintValidator();
-	}
-
-	@Test
-	public void testIsValid() {
-
-		assertTrue( constraint.isValid( null, null ) );
-		assertTrue( constraint.isValid( "foo", null ) );
-		assertTrue( constraint.isValid( "  ", null ) );
-
-		assertFalse( constraint.isValid( "", null ) );
-	}
-}

Copied: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotEmptyValidatorTest.java (from rev 15845, validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotEmptyConstraintTest.java)
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotEmptyValidatorTest.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotEmptyValidatorTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,46 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,  
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public class NotEmptyValidatorTest {
+
+	private static NotEmptyValidator constraint;
+
+	@BeforeClass
+	public static void init() {
+		constraint = new NotEmptyValidator();
+	}
+
+	@Test
+	public void testIsValid() {
+
+		assertTrue( constraint.isValid( null, null ) );
+		assertTrue( constraint.isValid( "foo", null ) );
+		assertTrue( constraint.isValid( "  ", null ) );
+
+		assertFalse( constraint.isValid( "", null ) );
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotEmptyValidatorTest.java
___________________________________________________________________
Name: svn:keywords
   + Id

Deleted: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotNullConstraintTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotNullConstraintTest.java	2009-02-01 23:25:06 UTC (rev 15845)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotNullConstraintTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -1,36 +0,0 @@
-// $Id$
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,  
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package org.hibernate.validation.constraints;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import org.junit.Test;
-
-/**
- * @author Hardy Ferentschik
- */
-public class NotNullConstraintTest {
-
-	@Test
-	public void testIsValid() {
-		NotNullConstraintValidator constraint = new NotNullConstraintValidator();
-
-		assertFalse( constraint.isValid( null, null ) );
-		assertTrue( constraint.isValid( new Object(), null ) );
-	}
-}

Copied: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotNullValidatorTest.java (from rev 15845, validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotNullConstraintTest.java)
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotNullValidatorTest.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotNullValidatorTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,36 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,  
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public class NotNullValidatorTest {
+
+	@Test
+	public void testIsValid() {
+		NotNullConstraintValidator constraint = new NotNullConstraintValidator();
+
+		assertFalse( constraint.isValid( null, null ) );
+		assertTrue( constraint.isValid( new Object(), null ) );
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NotNullValidatorTest.java
___________________________________________________________________
Name: svn:keywords
   + Id

Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NullValidatorTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NullValidatorTest.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NullValidatorTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,42 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Alaa Nassef
+ */
+public class NullValidatorTest {
+
+	private static NullConstraintValidator constraint;
+
+	@BeforeClass
+	public static void init() {
+		constraint = new NullConstraintValidator();
+	}
+
+	@Test
+	public void testIsValid() {
+		assertTrue( constraint.isValid( null, null ) );
+		assertFalse( constraint.isValid( new Object(), null ) );
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/NullValidatorTest.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PastValidatorForCalendarTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PastValidatorForCalendarTest.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PastValidatorForCalendarTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,60 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import java.util.Calendar;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class PastValidatorForCalendarTest {
+
+	private static PastConstraintCalendarValidator constraint;
+
+	@BeforeClass
+	public static void init() {
+		constraint = new PastConstraintCalendarValidator();
+	}
+
+	@Test
+	public void testIsValid() {
+		Calendar futureDate = getFutureDate();
+		Calendar pastDate = getPastDate();
+		assertTrue( constraint.isValid( null, null ) );
+		assertTrue( constraint.isValid( pastDate, null ) );
+		assertFalse( constraint.isValid( Calendar.getInstance(), null ) );
+		assertFalse( constraint.isValid( futureDate, null ) );
+	}
+
+	private Calendar getFutureDate() {
+		Calendar cal = Calendar.getInstance();
+		int year = cal.get( Calendar.YEAR );
+		cal.set( Calendar.YEAR, year + 1 );
+		return cal;
+	}
+
+	private Calendar getPastDate() {
+		Calendar cal = Calendar.getInstance();
+		int year = cal.get( Calendar.YEAR );
+		cal.set( Calendar.YEAR, year - 1 );
+		return cal;
+	}
+
+}


Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PastValidatorForCalendarTest.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PastValidatorForDateTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PastValidatorForDateTest.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PastValidatorForDateTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,60 @@
+// $Id
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import java.util.Date;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class PastValidatorForDateTest {
+
+	private static PastConstraintDateValidator constraint;
+
+	@BeforeClass
+	public static void init() {
+		constraint = new PastConstraintDateValidator();
+	}
+
+	@Test
+	public void testIsValid() {
+		Date futureDate = getFutureDate();
+		Date pastDate = getPastDate();
+		assertTrue( constraint.isValid( null, null ) );
+		assertTrue( constraint.isValid( pastDate, null ) );
+		assertFalse( constraint.isValid( new Date(), null ) );
+		assertFalse( constraint.isValid( futureDate, null ) );
+	}
+
+	private Date getFutureDate() {
+		Date date = new Date();
+		long timeStamp = date.getTime();
+		date.setTime( timeStamp + 31557600000l );
+		return date;
+	}
+
+	private Date getPastDate() {
+		Date date = new Date();
+		long timeStamp = date.getTime();
+		date.setTime( timeStamp - 31557600000l );
+		return date;
+	}
+
+}


Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PastValidatorForDateTest.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Deleted: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PatternConstraintTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PatternConstraintTest.java	2009-02-01 23:25:06 UTC (rev 15845)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PatternConstraintTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -1,75 +0,0 @@
-// $Id$
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,  
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package org.hibernate.validation.constraints;
-
-import java.lang.annotation.Annotation;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import org.junit.Test;
-import org.junit.Before;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-
-/**
- * @author Hardy Ferentschik
- */
-public class PatternConstraintTest {
-
-	PatternConstraintValidator constraint;
-
-	@Before
-	public void init() {
-		constraint = new PatternConstraintValidator();
-		constraint.initialize(
-				new Pattern() {
-
-					public String message() {
-						return "{validator.pattern}";
-					}
-
-					public Class<?>[] groups() {
-						return new Class<?>[0];
-					}
-
-					public String regex() {
-						return "foobar";
-					}
-
-					public int flags() {
-						return 0;
-					}
-
-					public Class<? extends Annotation> annotationType() {
-						return this.getClass();
-					}
-				}
-		);
-	}
-
-	@Test
-	public void testIsValid() {
-
-		assertTrue( constraint.isValid( null, null ) );
-		assertFalse( constraint.isValid( "", null ) );
-		assertFalse( constraint.isValid( "bla bla", null ) );
-		assertFalse( constraint.isValid( "This test is not foobar", null ) );
-	}
-
-}

Copied: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PatternValidatorTest.java (from rev 15845, validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PatternConstraintTest.java)
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PatternValidatorTest.java	                        (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PatternValidatorTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -0,0 +1,55 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,  
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validation.constraints;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.hibernate.validation.util.annotationfactory.AnnotationDescriptor;
+import org.hibernate.validation.util.annotationfactory.AnnotationFactory;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public class PatternValidatorTest {
+
+	private static PatternValidator constraint;
+
+	@BeforeClass
+	public static void init() {
+
+		AnnotationDescriptor descriptor = new AnnotationDescriptor( Pattern.class );
+		descriptor.setValue( "regex", "foobar" );
+		descriptor.setValue( "message", "{validator.pattern}" );
+		Pattern p = AnnotationFactory.create( descriptor );
+
+		constraint = new PatternValidator();
+		constraint.initialize( p );
+	}
+
+	@Test
+	public void testIsValid() {
+
+		assertTrue( constraint.isValid( null, null ) );
+		assertFalse( constraint.isValid( "", null ) );
+		assertFalse( constraint.isValid( "bla bla", null ) );
+		assertFalse( constraint.isValid( "This test is not foobar", null ) );
+	}
+}


Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/PatternValidatorTest.java
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/composition/FrenchZipcode.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/composition/FrenchZipcode.java	2009-02-01 23:25:06 UTC (rev 15845)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/composition/FrenchZipcode.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -52,13 +52,11 @@
 	@OverridesParameters({
 			@OverridesParameter(constraint = Size.class, parameter = "min"),
 			@OverridesParameter(constraint = Size.class, parameter = "max")
-	})
-	int size() default 5;
+	}) int size() default 5;
 
-	@OverridesParameter(constraint = Size.class, parameter = "message")
-    String sizeMessage() default "A french zip code has a length of 5";
+	@OverridesParameter(constraint = Size.class,
+			parameter = "message") String sizeMessage() default "A french zip code has a length of 5";
 
 
-	@OverridesParameter(constraint = Pattern.class, parameter = "regex", index=2)
-	String regex() default "\\d*";
+	@OverridesParameter(constraint = Pattern.class, parameter = "regex", index = 2) String regex() default "\\d*";
 }

Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/incomplete/NoGroups.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/incomplete/NoGroups.java	2009-02-01 23:25:06 UTC (rev 15845)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/incomplete/NoGroups.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -25,8 +25,6 @@
 import java.lang.annotation.Target;
 import javax.validation.Constraint;
 
-import org.hibernate.validation.constraints.incomplete.NoGroupsConstraintValidator;
-
 /**
  * @author Hardy Ferentschik
  */

Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/incomplete/NoGroupsConstraintValidator.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/incomplete/NoGroupsConstraintValidator.java	2009-02-01 23:25:06 UTC (rev 15845)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/incomplete/NoGroupsConstraintValidator.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -20,8 +20,6 @@
 import javax.validation.ConstraintValidator;
 import javax.validation.ConstraintValidatorContext;
 
-import org.hibernate.validation.constraints.incomplete.NoGroups;
-
 /**
  * @author Hardy Ferentschik
  */

Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ConstraintCompositionTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ConstraintCompositionTest.java	2009-02-01 23:25:06 UTC (rev 15845)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ConstraintCompositionTest.java	2009-02-02 11:56:15 UTC (rev 15846)
@@ -25,7 +25,7 @@
 import org.junit.Test;
 
 import org.hibernate.validation.constraints.NotNullConstraintValidator;
-import org.hibernate.validation.constraints.PatternConstraintValidator;
+import org.hibernate.validation.constraints.PatternValidator;
 import org.hibernate.validation.constraints.SizeConstraintValidator;
 import org.hibernate.validation.constraints.composition.GermanZipcodeConstraintValidator;
 import org.hibernate.validation.eg.FrenchAddress;
@@ -79,7 +79,7 @@
 				assertConstraintViolation(
 						violation,
 						"must match \"d*\"",
-						PatternConstraintValidator.class,
+						PatternValidator.class,
 						FrenchAddress.class,
 						"abc",
 						"zipCode"
@@ -89,7 +89,7 @@
 				assertConstraintViolation(
 						violation,
 						"must match \".....\"",
-						PatternConstraintValidator.class,
+						PatternValidator.class,
 						FrenchAddress.class,
 						"abc",
 						"zipCode"
@@ -119,7 +119,7 @@
 				assertConstraintViolation(
 						violation,
 						"must match \".....\"",
-						PatternConstraintValidator.class,
+						PatternValidator.class,
 						FrenchAddress.class,
 						"123",
 						"zipCode"




More information about the hibernate-commits mailing list