Package com.opensymphony.xwork.validator

Examples of com.opensymphony.xwork.validator.DefaultActionValidatorManager.validate()


  }
 
  @SuppressWarnings("unchecked")
  public void testValidationURLMissing() throws Exception{
    DefaultActionValidatorManager validator = new DefaultActionValidatorManager();
    validator.validate(action, "create");
    assertTrue(action.hasFieldErrors());
    Map<String, Object> errors = action.getFieldErrors();
    assertEquals(1, errors.size());
  }
 
View Full Code Here


  }

  @SuppressWarnings("unchecked")
  public void testValidationMissingUsername() throws Exception{
    DefaultActionValidatorManager validator = new DefaultActionValidatorManager();
    validator.validate(action, "createUser");
    assertTrue(action.hasFieldErrors());
    Map<String, Object> errors = action.getFieldErrors();
    assertEquals(4, errors.size());
  }
 
View Full Code Here

    DefaultActionValidatorManager validator = new DefaultActionValidatorManager();
    action.setUsername("ab");
    action.setPassword("poploop");
    action.setPasswordConfirm("poploop");
    action.setEmail("foo@foo.com");
    validator.validate(action, "createUser");
    assertTrue(action.hasFieldErrors());
    Map<String, Object> errors = action.getFieldErrors();
    assertEquals(1, errors.size());
  }
 
View Full Code Here

    DefaultActionValidatorManager validator = new DefaultActionValidatorManager();
    action.setUsername("123abc");
    action.setPassword("poploop");
    action.setPasswordConfirm("poploop");
    action.setEmail("foo@foo.com");
    validator.validate(action, "createUser");
    assertTrue(action.hasFieldErrors());
    Map<String, Object> errors = action.getFieldErrors();
    assertEquals(1, errors.size());
  }
 
View Full Code Here

    DefaultActionValidatorManager validator = new DefaultActionValidatorManager();
    action.setUsername("abc_30");
    action.setPassword("poploop");
    action.setPasswordConfirm("poploop");
    action.setEmail("foo@foo.com");
    validator.validate(action, "createUser");
    assertTrue(action.hasFieldErrors());
    Map<String, Object> errors = action.getFieldErrors();
    assertEquals(1, errors.size());
  }
 
View Full Code Here

    DefaultActionValidatorManager validator = new DefaultActionValidatorManager();
    action.setUsername("abc30");
    action.setPassword("poploop");
    action.setPasswordConfirm("poploop");
    action.setEmail("foo@foo.com");
    validator.validate(action, "createUser");
    assertFalse(action.hasFieldErrors());
    Map<String, Object> errors = action.getFieldErrors();
    assertEquals(0, errors.size());
  }
 
View Full Code Here

    DefaultActionValidatorManager validator = new DefaultActionValidatorManager();
    action.setUsername("abc3000000000000000000000000000000000000");
    action.setPassword("poploop");
    action.setPasswordConfirm("poploop");
    action.setEmail("foo@foo.com");
    validator.validate(action, "createUser");
    assertTrue(action.hasFieldErrors());
    Map<String, Object> errors = action.getFieldErrors();
    assertEquals(1, errors.size());
  }
 
View Full Code Here

    DefaultActionValidatorManager validator = new DefaultActionValidatorManager();
    action.setUsername("abc30");
    action.setPassword("poploop");
    action.setPasswordConfirm("poploop");
    action.setEmail("");
    validator.validate(action, "createUser");
    assertTrue(action.hasFieldErrors());
    Map<String, Object> errors = action.getFieldErrors();
    assertEquals(1, errors.size());
  }
 
View Full Code Here

    DefaultActionValidatorManager validator = new DefaultActionValidatorManager();
    action.setUsername("abc30");
    action.setPassword("popoop");
    action.setPasswordConfirm("popoop");
    action.setEmail("233@");
    validator.validate(action, "createUser");
    assertTrue(action.hasFieldErrors());
    Map<String, Object> errors = action.getFieldErrors();
    assertEquals(1, errors.size());
  }
 
View Full Code Here

    DefaultActionValidatorManager validator = new DefaultActionValidatorManager();
    action.setUsername("abc30");
    action.setPassword("poploop1");
    action.setPasswordConfirm("poploop");
    action.setEmail("233@foo.com");
    validator.validate(action, "createUser");
    assertTrue(action.hasFieldErrors());
    Map<String, Object> errors = action.getFieldErrors();
    assertEquals(1, errors.size());
  }
 
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.