Package br.com.caelum.stella.bean.validation.xml.logic

Examples of br.com.caelum.stella.bean.validation.xml.logic.StellaChoiceValidator.initialize()


  }

  @Test
  public void testThatOneSettedElementIsOk() {
    StellaChoiceValidator validator = new StellaChoiceValidator();
    validator.initialize(new Mirror().on(AnnotatedModel.class).reflect().annotation(Choice.class).atClass());
    Assert.assertTrue(validator.isValid(new AnnotatedModel(), context));
  }

  @Choice
  public static class AnnotatedModel2 {
View Full Code Here


  }

  @Test
  public void testThatMultipleChoiceItensSettedIsOk() {
    StellaChoiceValidator validator = new StellaChoiceValidator();
    validator.initialize(new Mirror().on(AnnotatedModel2.class).reflect().annotation(Choice.class).atClass());
    Assert.assertTrue(validator.isValid(new AnnotatedModel2(), context));
  }

  @Choice
  public static class AnnotatedModel3 {
View Full Code Here

  }
 
  @Test
  public void testThatMultipleChoiceWithMoreThanOneItenNotNullShoudNotPass() {
    StellaChoiceValidator validator = new StellaChoiceValidator();
    validator.initialize(new Mirror().on(AnnotatedModel3.class).reflect().annotation(Choice.class).atClass());
    Assert.assertFalse(validator.isValid(new AnnotatedModel3(), context));
  }
 
  @Choice
  public static class AnnotatedModel4 {
View Full Code Here

  }
 
  @Test
  public void testThatMultipleChoiceWithOnlyOneItenNotNullShoudPass() {
    StellaChoiceValidator validator = new StellaChoiceValidator();
    validator.initialize(new Mirror().on(AnnotatedModel4.class).reflect().annotation(Choice.class).atClass());
    Assert.assertTrue(validator.isValid(new AnnotatedModel4(), context));
  }
 
 
 
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.