Examples of MinLengthValidator


Examples of games.stendhal.server.core.account.MinLengthValidator

  /**
   * Tests for emptyString.
   */
  @Test
  public void testEmptyString() {
    final MinLengthValidator validator = new MinLengthValidator("", 4);
    Assert.assertNotNull(validator.validate());
  }
View Full Code Here

Examples of games.stendhal.server.core.account.MinLengthValidator

  /**
   * Tests for shortString.
   */
  @Test
  public void testShortString() {
    final MinLengthValidator validator = new MinLengthValidator("asd", 4);
    Assert.assertNotNull(validator.validate());
  }
View Full Code Here

Examples of games.stendhal.server.core.account.MinLengthValidator

  /**
   * Tests for oKString.
   */
  @Test
  public void testOKString() {
    final MinLengthValidator validator = new MinLengthValidator("asdf", 4);
    Assert.assertNull(validator.validate());
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.form.validator.MinLengthValidator

      assertTrue(e.getMessage().contains("Cannot validate \"maxlength\": configuration 4.4 cannot be interpreted as Integer"));
    }
  }

  public void testMinLengthValidator() {
    MinLengthValidator validator = new MinLengthValidator();

    assertTrue(validator.validate(null, null));

    assertTrue(validator.validate("test", new TestValidatorContext("4")));
    assertFalse(validator.validate("test", new TestValidatorContext("5")));

    try {
      validator.validate("test", new TestValidatorContext("4.4"));
      fail("exception expected");
    } catch (ProcessEngineException e) {
      assertTrue(e.getMessage().contains("Cannot validate \"minlength\": configuration 4.4 cannot be interpreted as Integer"));
    }
  }
View Full Code Here

Examples of org.mod4j.runtime.validation.MinLengthValidator

  private void addValidators() {

    validation.addValidator(new NotNullValidator(Customer.class,
        "customerNr"));

    validation.addValidator(new MinLengthValidator(Customer.class,
        "username", USERNAME_MINLENGTH));
    validation.addValidator(new MaxLengthValidator(Customer.class,
        "username", USERNAME_MAXLENGTH));

    validation.addValidator(new RegExpValidator(Customer.class,
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.