Package com.opensymphony.xwork.validator

Examples of com.opensymphony.xwork.validator.DefaultActionValidatorManager


    assertEquals(1, errors.size());
  }
 
  @SuppressWarnings("unchecked")
  public void testValidationPasswdTooShort() throws Exception{
    DefaultActionValidatorManager validator = new DefaultActionValidatorManager();
    action.setUsername("abc30");
    action.setPassword("pop");
    action.setPasswordConfirm("pop");
    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


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

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

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

        .getResourceAsStream("/TestRequestPasswordReset-input.xml"));
  }

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

    assertEquals(1, errors.size());
  }

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

    assertEquals(1, errors.size());
  }

  @SuppressWarnings("unchecked")
  public void testValidationUsernameFilled() throws Exception {
    DefaultActionValidatorManager validator = new DefaultActionValidatorManager();
    action.setUsername("hchen1");
    validator.validate(action, "requestReset");
    assertFalse(action.hasFieldErrors());
    Map<String, Object> errors = action.getFieldErrors();
    assertEquals(0, errors.size());
  }
View Full Code Here

    super.tearDown();
  }

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

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

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

TOP

Related Classes of com.opensymphony.xwork.validator.DefaultActionValidatorManager

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.