Examples of ValidationInterceptor


Examples of org.apache.myfaces.extensions.validator.core.interceptor.ValidationInterceptor

        else
        {
            logger.info("starting up MyFaces Extensions Validator");
        }

        ExtValContext.getContext().registerRendererInterceptor(new ValidationInterceptor());

        initNameMappers();
        initValidationExceptionInterceptors();
        initViolationSeverityInterpreter();
        initPropertyValidationInterceptors();
View Full Code Here

Examples of org.jboss.seam.interceptors.ValidationInterceptor

      Lifecycle.setPhaseId(PhaseId.INVOKE_APPLICATION);
      Lifecycle.beginRequest(externalContext);
      Manager.instance().setCurrentConversationId("1");
      Lifecycle.resumeConversation(externalContext);
     
      ValidationInterceptor vi = new ValidationInterceptor();
      vi.setComponent( new Component(Foo.class, appContext) );

      final Foo foo = new Foo();
     
      String result = (String) vi.aroundInvoke( new MockInvocationContext() {
         @Override
         public Method getMethod()
         {
            return InterceptorTest.getMethod("foo");
         }
         @Override
         public Object getTarget()
         {
            return foo;
         }

         @Override
         public Object proceed() throws Exception
         {
            return foo.foo();
         }
      });
     
      assert "foo".equals(result);
      FacesMessages.afterPhase();
      FacesMessages.instance().beforeRenderResponse();
      assert !FacesContext.getCurrentInstance().getMessages().hasNext();     
     
      result = (String) vi.aroundInvoke( new MockInvocationContext() {
         @Override
         public Method getMethod()
         {
            return InterceptorTest.getMethod("bar");
         }
         @Override
         public Object getTarget()
         {
            return foo;
         }

         @Override
         public Object proceed() throws Exception
         {
            assert false;
            return foo.bar();
         }
      });
           
      assert "baz".equals(result);
      FacesMessages.afterPhase();
      FacesMessages.instance().beforeRenderResponse();
      assert FacesContext.getCurrentInstance().getMessages().hasNext();     

      foo.setValue("not null");
     
      result = (String) vi.aroundInvoke( new MockInvocationContext() {
         @Override
         public Method getMethod()
         {
            return InterceptorTest.getMethod("bar");
         }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.