Package com.opensymphony.xwork2.validator

Examples of com.opensymphony.xwork2.validator.ValidationInterceptor


    }

    public void testIncludesMethodWithWildcard() throws Exception {
        interceptor.setIncludeMethods("*");

        ValidationInterceptor validationInterceptor = create();
        validationInterceptor.setIncludeMethods("*");
        validationInterceptor.intercept(invocation);
       
        assertEquals(result, interceptor.intercept(invocation));
    }
View Full Code Here



    public void testIncludesMethod() throws Exception {
        interceptor.setIncludeMethods("execute");

        ValidationInterceptor validationInterceptor = create();
        validationInterceptor.setIncludeMethods("execute");
        validationInterceptor.intercept(invocation);
       
        assertEquals(result, interceptor.intercept(invocation));
    }
View Full Code Here

    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));
    }
View Full Code Here

    public void testIncludesAndExcludesMethodAllWildCarded() throws Exception {
        interceptor.setExcludeMethods("*");
        interceptor.setIncludeMethods("*");
       
        ValidationInterceptor validationInterceptor = create();
        validationInterceptor.setExcludeMethods("*");
        validationInterceptor.setIncludeMethods("*");
        validationInterceptor.intercept(invocation);
       
        assertEquals(result, interceptor.intercept(invocation));
    }
View Full Code Here

    public void testIncludesAndExcludesMethodWithExcludeWildcard() throws Exception {
        interceptor.setExcludeMethods("*");
        interceptor.setIncludeMethods("execute");
       
        ValidationInterceptor validationInterceptor = create();
        validationInterceptor.setExcludeMethods("*");
        validationInterceptor.setIncludeMethods("execute");
        validationInterceptor.intercept(invocation);
       
        assertEquals(result, interceptor.intercept(invocation));
    }
View Full Code Here

    public void testIncludesAndExcludesMethodWithIncludeWildcardAndNoMatches() throws Exception {
        interceptor.setExcludeMethods("execute,input,validate");
        interceptor.setIncludeMethods("*");
       
        ValidationInterceptor validationInterceptor = create();
        validationInterceptor.setExcludeMethods("execute,input,validate");
        validationInterceptor.setIncludeMethods("*");
        validationInterceptor.intercept(invocation);
       
        assertEquals(result, interceptor.intercept(invocation));
    }
View Full Code Here

    public void testIncludesAndExcludesMethodWithIncludeWildcard() throws Exception {
        interceptor.setExcludeMethods("input,validate");
        interceptor.setIncludeMethods("*");
       
        ValidationInterceptor validationInterceptor = create();
        validationInterceptor.setExcludeMethods("input,validate");
        validationInterceptor.setIncludeMethods("*");
        validationInterceptor.intercept(invocation);
       
        assertEquals(result, interceptor.intercept(invocation));
    }
View Full Code Here

       
        assertEquals(result, interceptor.intercept(invocation));
    }

    public void testNoValidateAction() throws Exception {
        ValidationInterceptor validationInterceptor = create();
        validationInterceptor.setExcludeMethods("execute,input,validate");
        validationInterceptor.setIncludeMethods("execute");
        validationInterceptor.intercept(invocation);
       
        assertEquals(result, interceptor.intercept(invocation));
    }
View Full Code Here

            if (actionConfig != null) {
                List<InterceptorMapping> interceptors = actionConfig.getInterceptors();
                for (InterceptorMapping interceptorMapping : interceptors) {
                    if (ValidationInterceptor.class.isInstance(interceptorMapping.getInterceptor())) {
                        ValidationInterceptor validationInterceptor = (ValidationInterceptor) interceptorMapping.getInterceptor();

                        Set excludeMethods = validationInterceptor.getExcludeMethodsSet();
                        Set includeMethods = validationInterceptor.getIncludeMethodsSet();

                        if (MethodFilterInterceptorUtil.applyMethod(excludeMethods, includeMethods, actionMethod)) {
                            addParameter("performValidation", Boolean.TRUE);
                        }
                        return;
View Full Code Here

    public void testPrefixMethodInvocation1() throws Exception {
    method = "save";
    result = Action.INPUT;
   
    ValidationInterceptor interceptor = create();
    String result = interceptor.intercept(invocation);
   
    assertEquals(Action.INPUT, result);
  }
View Full Code Here

TOP

Related Classes of com.opensymphony.xwork2.validator.ValidationInterceptor

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.