Package org.springframework.rules.constraint.property

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


  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.