Package org.strecks.validator

Examples of org.strecks.validator.IntegerValidator


  @Test
  public void testSortValidatorWrapper()
  {
    DefaultMessageParameterProvider provider = new DefaultMessageParameterProvider();
   
    ValidatorWrapper wrapper1 = new ValidatorWrapper("key1", 20, Collections.emptyList(), new IntegerValidator(),
        this.getClass().getMethods()[0], provider);
    ValidatorWrapper wrapper2 = new ValidatorWrapper("key2", 10, Collections.emptyList(), new IntegerValidator(),
        this.getClass().getMethods()[0],  provider);

    List<ValidatorWrapper> list = new ArrayList<ValidatorWrapper>();
    list.add(wrapper1);
    list.add(wrapper2);
View Full Code Here


  }

  private ValidatorWrapper getWrapper(Class<?> type)
  {
    DefaultMessageParameterProvider provider = new DefaultMessageParameterProvider();
    ValidatorWrapper wrapper = new ValidatorWrapper("key1", 20, Collections.emptyList(), new IntegerValidator(),
        this.getClass().getMethods()[0], provider, true, type);
    return wrapper;
  }
View Full Code Here

  }

  @Test
  public void testValidate()
  {
    strategy.validate(SimpleStrutsForm.class, "validField", 1, new IntegerValidator());
  }
View Full Code Here

  @Test
  public void testValidateInvalidType()
  {
    try
    {
      strategy.validate(BadlyTypedValidatorForm.class, "requiredInteger", new Integer(1), new IntegerValidator());
    }
    catch (ApplicationRuntimeException e)
    {
      Assert.assertEquals(e.getMessage(),
          "Mismatch between parameterization type of validator: org.strecks.validator.IntegerValidator(class java.lang.String), "
View Full Code Here

  }

  private SortableValidator getSortableValidator(Class<?> type)
  {
    DefaultMessageParameterProvider provider = new DefaultMessageParameterProvider();
    ValidatorWrapper wrapper = new ValidatorWrapper("key1", 20, Collections.emptyList(), new IntegerValidator(),
        this.getClass().getMethods()[0], provider, true, type);
    ValidatorWrapper wrapper1 = wrapper;
    SortableValidator v = new SortableValidator(wrapper1);
    return v;
  }
View Full Code Here

  }

  private ValidatorWrapper getConvertableWrapper(Class<?> type)
  {
    DefaultMessageParameterProvider provider = new DefaultMessageParameterProvider();
    ValidatorWrapper wrapper = new ValidatorWrapper("key1", 20, Collections.emptyList(), new IntegerValidator(),
        this.getClass().getMethods()[0], provider, true, type);
    return wrapper;
  }
View Full Code Here

  }

  private ValidatorWrapper getNonConvertableWrapper(Class<?> type)
  {
    DefaultMessageParameterProvider provider = new DefaultMessageParameterProvider();
    ValidatorWrapper wrapper = new ValidatorWrapper("key1", 20, Collections.emptyList(), new IntegerValidator(),
        this.getClass().getMethods()[0], provider);
    return wrapper;
  }
View Full Code Here

{

  public ValidatorWrapper create(Annotation annot, Method method)
  {
    ValidateInteger annotation = (ValidateInteger) annot;
    IntegerValidator validator = new IntegerValidator();
    return create(validator, annotation.key(), annotation.order(), null, method);
  }
View Full Code Here

TOP

Related Classes of org.strecks.validator.IntegerValidator

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.