// Path: library/src/main/java/com/comuto/validator/Violation.java
// public class Violation {
//     private final String propertyName;
//     private final Object invalidValue;
//     private final String message;
//     private final String code;
// 
//     /**
//      * Construct the violation with final values.
//      *
//      * @param propertyName The name of the field. This is defined by the user.
//      * @param invalidValue The invalid which have violate the constraint.
//      * @param message The interpolated message.
//      * @param code The Error code of the constraint.
//      */
//     public Violation(String propertyName, Object invalidValue, String message, String code) {
//         this.propertyName = propertyName;
//         this.invalidValue = invalidValue;
//         this.message = message;
//         this.code = code;
//     }
// 
//     /**
//      * @return the interpolated error message for this constraint violation
//      */
//     public String getMessage() {
//         return message;
//     }
// 
//     /**
//      * Returns the value failing to pass the constraint.
//      * For cross-parameter constraints, an {@code Object[]} representing
//      * the method invocation arguments is returned.
//      *
//      * @return the value failing to pass the constraint
//      */
//     public Object getInvalidValue() {
//         return invalidValue;
//     }
// 
//     /**
//      * Returns the name of the property.
//      *
//      * @return the property name.
//      */
//     public String getPropertyName() {
//         return propertyName;
//     }
// 
//     /**
//      * Returns a machine-digestible error code for the violation.
//      *
//      * @return String The error code.
//      */
//     public String getCode() {
//         return code;
//     }
// }
// 
// Path: library/src/test/java/com/comuto/validator/Utils.java
// public static void assertEmpty(String message, Iterable<?> iterable) {
//     if (iterable.iterator().hasNext()) {
//         failNotEmpty(message, iterable.toString());
//     }
// }
// 
// Path: library/src/test/java/com/comuto/validator/Utils.java
// public static void assertNotEmpty(String message, Iterable<?> iterable) {
//     if (!iterable.iterator().hasNext()) {
//         failEmpty(message);
//     }
// }


import com.comuto.validator.Violation;
import java.util.Set;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import static com.comuto.validator.Utils.assertEmpty;
import static com.comuto.validator.Utils.assertNotEmpty;
package com.comuto.validator.constraint;



@RunWith(RobolectricTestRunner.class) @Config(manifest = Config.NONE) public class LengthConstraintTest
    extends BaseConstraintTest {

    private static final String PROPERTY_NAME = "property_length";
    private static final String VALUE = "valid";

    @Test
    public void isValid() throws Exception {
// Path: library/src/main/java/com/comuto/validator/Violation.java
// public class Violation {
//     private final String propertyName;
//     private final Object invalidValue;
//     private final String message;
//     private final String code;
// 
//     /**
//      * Construct the violation with final values.
//      *
//      * @param propertyName The name of the field. This is defined by the user.
//      * @param invalidValue The invalid which have violate the constraint.
//      * @param message The interpolated message.
//      * @param code The Error code of the constraint.
//      */
//     public Violation(String propertyName, Object invalidValue, String message, String code) {
//         this.propertyName = propertyName;
//         this.invalidValue = invalidValue;
//         this.message = message;
//         this.code = code;
//     }
// 
//     /**
//      * @return the interpolated error message for this constraint violation
//      */
//     public String getMessage() {
//         return message;
//     }
// 
//     /**
//      * Returns the value failing to pass the constraint.
//      * For cross-parameter constraints, an {@code Object[]} representing
//      * the method invocation arguments is returned.
//      *
//      * @return the value failing to pass the constraint
//      */
//     public Object getInvalidValue() {
//         return invalidValue;
//     }
// 
//     /**
//      * Returns the name of the property.
//      *
//      * @return the property name.
//      */
//     public String getPropertyName() {
//         return propertyName;
//     }
// 
//     /**
//      * Returns a machine-digestible error code for the violation.
//      *
//      * @return String The error code.
//      */
//     public String getCode() {
//         return code;
//     }
// }
// 
// Path: library/src/test/java/com/comuto/validator/Utils.java
// public static void assertEmpty(String message, Iterable<?> iterable) {
//     if (iterable.iterator().hasNext()) {
//         failNotEmpty(message, iterable.toString());
//     }
// }
// 
// Path: library/src/test/java/com/comuto/validator/Utils.java
// public static void assertNotEmpty(String message, Iterable<?> iterable) {
//     if (!iterable.iterator().hasNext()) {
//         failEmpty(message);
//     }
// }


// Path: library/src/test/java/com/comuto/validator/constraint/LengthConstraintTest.java
import com.comuto.validator.Violation;
import java.util.Set;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import static com.comuto.validator.Utils.assertEmpty;
import static com.comuto.validator.Utils.assertNotEmpty;

package com.comuto.validator.constraint;



@RunWith(RobolectricTestRunner.class) @Config(manifest = Config.NONE) public class LengthConstraintTest
    extends BaseConstraintTest {

    private static final String PROPERTY_NAME = "property_length";
    private static final String VALUE = "valid";

    @Test
    public void isValid() throws Exception {
        assertEmpty("is valid with String", validateConstraint(VALUE, 1, 8));