Search in sources :

Example 1 with FieldMatchAction

use of org.apache.struts.beanvalidation.actions.FieldMatchAction in project struts by apache.

the class BeanValidationInterceptorTest method testFieldMatchAction.

public void testFieldMatchAction() throws Exception {
    ActionProxy baseActionProxy = actionProxyFactory.createActionProxy("bean-validation", "fieldMatchAction", null, null);
    FieldMatchAction action = (FieldMatchAction) baseActionProxy.getAction();
    action.setPassword("pass1");
    action.setConfirmPassword("pass2");
    action.setEmail("test1@mail.org");
    action.setConfirmEmail("test2@mail.org");
    baseActionProxy.execute();
    Collection<String> actionErrors = ((ValidationAware) baseActionProxy.getAction()).getActionErrors();
    System.out.println(actionErrors);
    assertNotNull(actionErrors);
    assertEquals(2, actionErrors.size());
}
Also used : ActionProxy(com.opensymphony.xwork2.ActionProxy) ValidationAware(com.opensymphony.xwork2.interceptor.ValidationAware) FieldMatchAction(org.apache.struts.beanvalidation.actions.FieldMatchAction)

Aggregations

ActionProxy (com.opensymphony.xwork2.ActionProxy)1 ValidationAware (com.opensymphony.xwork2.interceptor.ValidationAware)1 FieldMatchAction (org.apache.struts.beanvalidation.actions.FieldMatchAction)1