Package org.springframework.validation

Examples of org.springframework.validation.MapBindingResult


    messageSource.addMessage("bar", Locale.getDefault(), "{0}");

    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());
    assertEquals("boop", msg.getText());
View Full Code Here


    person.setAge(21);
    person.setCreditStatus(CreditStatus.PENDING);
    person.setCreditRating(CreditRating.EXCELLENT);
    person.setLastUpdated(new Date());
   
    Errors errors = new MapBindingResult(new HashMap(), "person");

    validator.validate(person, errors);
   
    assertTrue("Should not have any errors.", !errors.hasErrors());
  }
View Full Code Here

        person.setAge(21);
        person.setCreditStatus(CreditStatus.PENDING);
        person.setCreditRating(CreditRating.EXCELLENT);
        person.setLastUpdated(new Date());
       
        Errors errors = new MapBindingResult(new HashMap(), "person");

        validator.validate(person, errors);
       
        assertTrue("Should not have any errors.", !errors.hasErrors());
    }
View Full Code Here

        person.setAge(21);
        person.setCreditStatus(CreditStatus.PENDING);
        person.setCreditRating(CreditRating.EXCELLENT);
        person.setLastUpdated(new Date());
       
        Errors errors = new MapBindingResult(new HashMap(), "person");

        validator.validate(person, errors);
       
        assertTrue("Should have an error.", errors.hasErrors());
    }
View Full Code Here

    person.setAge(21);
    person.setCreditStatus(CreditStatus.PENDING);
    person.setCreditRating(CreditRating.EXCELLENT);
    person.setLastUpdated(new Date());
   
    Errors errors = new MapBindingResult(new HashMap(), "person");

    validator.validate(person, errors);
   
    assertTrue("Should not have any errors.", !errors.hasErrors());
  }
View Full Code Here

        person.setAge(21);
        person.setCreditStatus(CreditStatus.PENDING);
        person.setCreditRating(CreditRating.EXCELLENT);
        person.setLastUpdated(DateUtils.setYears(new Date(), 1980));
       
        Errors errors = new MapBindingResult(new HashMap(), "person");

        validator.validate(person, errors);
       
        assertTrue("Should have an error.", errors.hasErrors());
    }
View Full Code Here

    person.setAge(21);
    person.setCreditStatus(CreditStatus.PENDING);
    person.setCreditRating(CreditRating.EXCELLENT);
    person.setLastUpdated(new Date());
   
    Errors errors = new MapBindingResult(new HashMap(), "person");

    validator.validate(person, errors);
   
    assertTrue("Should not have any errors.", !errors.hasErrors());
  }
View Full Code Here

        person.setAge(21);
        person.setCreditStatus(CreditStatus.PENDING);
        person.setCreditRating(CreditRating.EXCELLENT);
        person.setLastUpdated(new Date());
       
        Errors errors = new MapBindingResult(new HashMap(), "person");

        validator.validate(person, errors);
       
        assertTrue("Should have an error.", errors.hasErrors());
    }
View Full Code Here

        person.setAge(21);
        person.setCreditStatus(CreditStatus.PENDING);
        person.setCreditRating(CreditRating.BAD);
        person.setLastUpdated(new Date());
       
        Errors errors = new MapBindingResult(new HashMap(), "person");

        validator.validate(person, errors);
       
        assertTrue("Should have an error.", errors.hasErrors());
    }
View Full Code Here

    person.setAge(21);
    person.setCreditStatus(CreditStatus.PENDING);
    person.setCreditRating(CreditRating.EXCELLENT);
    person.setLastUpdated(new Date());
   
    Errors errors = new MapBindingResult(new HashMap(), "person");

    validator.validate(person, errors);
   
    assertTrue("Should not have any errors.", !errors.hasErrors());
  }
View Full Code Here

TOP

Related Classes of org.springframework.validation.MapBindingResult

Copyright © 2018 www.massapicom. 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.