Search in sources :

Example 16 with ValidationInterceptor

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

the class DefaultWorkflowInterceptorTest method testIncludesMethod.

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

Example 17 with ValidationInterceptor

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

the class DefaultWorkflowInterceptorTest method testIncludesAndExcludesMethod.

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

Example 18 with ValidationInterceptor

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

the class DefaultWorkflowInterceptorTest method testIncludesMethodWithWildcard.

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

Example 19 with ValidationInterceptor

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

the class DefaultWorkflowInterceptorTest method testExcludesMethodWithWildCard.

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

Example 20 with ValidationInterceptor

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

the class DefaultWorkflowInterceptorTest method testReturnsInputWithoutExecutingIfHasErrors.

public void testReturnsInputWithoutExecutingIfHasErrors() throws Exception {
    result = Action.INPUT;
    ValidationInterceptor validationInterceptor = create();
    validationInterceptor.intercept(invocation);
    assertEquals(Action.INPUT, 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