Package org.springframework.rules.constraint.property

Examples of org.springframework.rules.constraint.property.PropertyConstraint.test()


  }

  public boolean test(Object bean) {
    for (Iterator i = orderedConstraints.iterator(); i.hasNext();) {
      PropertyConstraint propertyConstraint = (PropertyConstraint)i.next();
      if (!propertyConstraint.test(bean)) {
        return false;
      }
    }
    return true;
  }
View Full Code Here


  public void testBeanPropertyValueConstraint() {
    And p = constraints.conjunction();
    p.add(constraints.required());
    p.add(constraints.maxLength(9));
    PropertyConstraint e = new PropertyValueConstraint("test", p);
    assertTrue(e.test(new TestBean()));

    p = constraints.conjunction();
    e = new PropertyValueConstraint("test", p);
    p.add(constraints.required());
    p.add(constraints.maxLength(3));
View Full Code Here

    p = constraints.conjunction();
    e = new PropertyValueConstraint("test", p);
    p.add(constraints.required());
    p.add(constraints.maxLength(3));
    assertFalse(e.test(new TestBean()));
  }

  public void testBeanPropertiesExpression() {
    PropertiesConstraint p = new PropertiesConstraint("test", EqualTo.instance(), "confirmTest");
    assertTrue(p.test(new TestBean()));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.