Package org.springframework.validation

Examples of org.springframework.validation.MapBindingResult.reject()


    DefaultMessageContext context = new DefaultMessageContext(messageSource);
    Object object = new Object();
    MessageContextErrors errors = new MessageContextErrors(context, "object", object, null, null);
    MapBindingResult result = new MapBindingResult(new HashMap(), "object");
    result.reject("bar", new Object[] { "boop" }, null);
    result.rejectValue("field", "bar", new Object[] { "boop" }, null);
    errors.addAllErrors(result);

    Message msg = context.getAllMessages()[0];
    assertEquals(null, msg.getSource());
View Full Code Here


    assertEquals(Severity.ERROR, msg.getSeverity());
  }

  public void testAddAllErrors() {
    MapBindingResult result = new MapBindingResult(new HashMap<Object, Object>(), "object");
    result.reject("bar", new Object[] { "boop" }, null);
    result.rejectValue("field", "bar", new Object[] { "boop" }, null);
    errors.addAllErrors(result);

    Message msg = context.getAllMessages()[0];
    assertEquals(null, msg.getSource());
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.