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

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


    private final String foo = null;
  }

  @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));
  }
View Full Code Here


    private final String foo = null;
  }

  @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));
  }
View Full Code Here

    private final String foo = "a foo";
  }
 
  @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));
  }
View Full Code Here

    private final String foo = "a foo";
  }
 
  @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

Related Classes of br.com.caelum.stella.bean.validation.xml.logic.StellaChoiceValidator

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.