Search in sources :

Example 11 with ValidationInterceptor

use of com.opensymphony.xwork2.validator.ValidationInterceptor in project struts by apache.

the class ValidationErrorAwareTest method testNotChangeResultWhenNotifyAboutValidationError.

public void testNotChangeResultWhenNotifyAboutValidationError() throws Exception {
    // given
    actionResult = Action.INPUT;
    ValidationInterceptor validationInterceptor = create();
    // when
    validationInterceptor.intercept(invocation);
    // then
    Assert.assertEquals(Action.INPUT, interceptor.intercept(invocation));
}
Also used : ValidationInterceptor(com.opensymphony.xwork2.validator.ValidationInterceptor)

Example 12 with ValidationInterceptor

use of com.opensymphony.xwork2.validator.ValidationInterceptor in project struts by apache.

the class ValidationErrorAwareTest method testChangeResultWhenNotifyAboutValidationErrors.

public void testChangeResultWhenNotifyAboutValidationErrors() throws Exception {
    // given
    ValidationInterceptor validationInterceptor = create();
    // when
    validationInterceptor.intercept(invocation);
    // then
    assertEquals(actionResult, interceptor.intercept(invocation));
}
Also used : ValidationInterceptor(com.opensymphony.xwork2.validator.ValidationInterceptor)

Example 13 with ValidationInterceptor

use of com.opensymphony.xwork2.validator.ValidationInterceptor in project struts by apache.

the class ValidationInterceptorPrefixMethodInvocationTest method testPrefixMethodInvocation1.

public void testPrefixMethodInvocation1() throws Exception {
    method = "save";
    result = Action.INPUT;
    ValidationInterceptor interceptor = create();
    String result = interceptor.intercept(invocation);
    assertEquals(Action.INPUT, result);
}
Also used : ValidationInterceptor(com.opensymphony.xwork2.validator.ValidationInterceptor)

Example 14 with ValidationInterceptor

use of com.opensymphony.xwork2.validator.ValidationInterceptor in project struts by apache.

the class DefaultWorkflowInterceptorTest method testInvokesActionInvocationIfNoErrors.

public void testInvokesActionInvocationIfNoErrors() throws Exception {
    ValidationInterceptor validationInterceptor = create();
    validationInterceptor.intercept(invocation);
    assertEquals(result, interceptor.intercept(invocation));
}
Also used : ValidationInterceptor(com.opensymphony.xwork2.validator.ValidationInterceptor)

Example 15 with ValidationInterceptor

use of com.opensymphony.xwork2.validator.ValidationInterceptor in project struts by apache.

the class DefaultWorkflowInterceptorTest method testExcludesMethod.

public void testExcludesMethod() throws Exception {
    interceptor.setExcludeMethods("execute");
    ValidationInterceptor validationInterceptor = create();
    validationInterceptor.setExcludeMethods("execute");
    interceptor.setExcludeMethods("execute");
    validationInterceptor.intercept(invocation);
    assertEquals(result, interceptor.intercept(invocation));
}
Also used : ValidationInterceptor(com.opensymphony.xwork2.validator.ValidationInterceptor)

Aggregations

ValidationInterceptor (com.opensymphony.xwork2.validator.ValidationInterceptor)18 ActionConfig (com.opensymphony.xwork2.config.entities.ActionConfig)5 InterceptorMapping (com.opensymphony.xwork2.config.entities.InterceptorMapping)4 RuntimeConfiguration (com.opensymphony.xwork2.config.RuntimeConfiguration)2 ActionContext (com.opensymphony.xwork2.ActionContext)1 ActionInvocation (com.opensymphony.xwork2.ActionInvocation)1 ActionProxy (com.opensymphony.xwork2.ActionProxy)1 PackageConfig (com.opensymphony.xwork2.config.entities.PackageConfig)1 ResultConfig (com.opensymphony.xwork2.config.entities.ResultConfig)1 ContainerBuilder (com.opensymphony.xwork2.inject.ContainerBuilder)1 ParametersInterceptor (com.opensymphony.xwork2.interceptor.ParametersInterceptor)1 MockActionInvocation (com.opensymphony.xwork2.mock.MockActionInvocation)1 MockActionProxy (com.opensymphony.xwork2.mock.MockActionProxy)1 MockResult (com.opensymphony.xwork2.mock.MockResult)1 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 HashMap (java.util.HashMap)1 Set (java.util.Set)1 ActionMapper (org.apache.struts2.dispatcher.mapper.ActionMapper)1 DefaultActionMapper (org.apache.struts2.dispatcher.mapper.DefaultActionMapper)1