@Test(expected = ConstraintViolationException.class) public void testEqualConstraintFailString() throws ConstraintViolationException { EqualConstraint constraint = new EqualConstraint(); constraint.setEqual("value"); constraint.validate("othervalue"); }
@Override public void validate(Object propertyValue) throws ConstraintViolationException { if (propertyValue == null) { if (typed != null) { fail(propertyValue); } } else if (typed == null) { fail(propertyValue); } else if (!typed.equals(propertyValue)) { fail(propertyValue); } }
EqualConstraint extends AbstractPropertyConstraint implements IMatchPropertyConstraint { @Override public void validate(Object propertyValue) throws ConstraintViolationException { if (propertyValue == null) { if (typed != null) { fail(propertyValue); } } else if (typed == null) { fail(propertyValue); } else if (!typed.equals(propertyValue)) { fail(propertyValue); } } }
EqualConstraint extends AbstractPropertyConstraint implements IMatchPropertyConstraint { @Override public void validate(Object propertyValue) throws ConstraintViolationException { if (propertyValue == null) { if (typed != null) { fail(propertyValue); } } else if (typed == null) { fail(propertyValue); } else if (!typed.equals(propertyValue)) { fail(propertyValue); } }  }
EqualConstraint extends AbstractPropertyConstraint implements IMatchPropertyConstraint { @Override public void validate(Object propertyValue) throws ConstraintViolationException { if (propertyValue == null) { if (typed != null) { fail(propertyValue); } } else if (typed == null) { fail(propertyValue); } else if (!typed.equals(propertyValue)) { fail(propertyValue); } }  @Override void initialize(IPropertyType<?> propertyType); @Override void setConstraintValue(IPropertyType<?> toscaType, String textValue); @Override void validate(Object propertyValue); }
EqualConstraint extends AbstractPropertyConstraint implements IMatchPropertyConstraint { @Override public void validate(Object propertyValue) throws ConstraintViolationException { if (propertyValue == null) { if (typed != null) { fail(propertyValue); } } else if (typed == null) { fail(propertyValue); } else if (!typed.equals(propertyValue)) { fail(propertyValue); } }  @Override void initialize(IPropertyType<?> propertyType); @Override void setConstraintValue(IPropertyType<?> toscaType, String textValue); @Override void validate(Object propertyValue);  }