Package org.jboss.seam.interceptors

Examples of org.jboss.seam.interceptors.ConversationalInterceptor


      Lifecycle.setPhaseId(PhaseId.INVOKE_APPLICATION);
      Lifecycle.beginRequest( externalContext );
      Manager.instance().setCurrentConversationId("1");
      Lifecycle.resumeConversation(externalContext);
     
      ConversationalInterceptor ci = new ConversationalInterceptor();
      ci.setComponent( new Component(Bar.class, appContext) );
     
      assert !Manager.instance().isLongRunningConversation();

      String result = (String) ci.aroundInvoke( new MockInvocationContext() {
         @Override
         public Method getMethod()
         {
            return InterceptorTest.getMethod("foo");
         }
         @Override
         public Object proceed() throws Exception
         {
            assert false;
            return null;
         }
      });
     
      //assert !Manager.instance().isLongRunningConversation();
      assert "error".equals(result);
     
      result = (String) ci.aroundInvoke( new MockInvocationContext() {
         @Override
         public Method getMethod()
         {
            return InterceptorTest.getMethod("begin");
         }
         @Override
         public Object proceed() throws Exception
         {
            return "begun";
         }
      });
     
      Manager.instance().initializeTemporaryConversation();
      Manager.instance().beginConversation("bar");
     
      //assert Manager.instance().isLongRunningConversation();
      assert "begun".equals(result);

      result = (String) ci.aroundInvoke( new MockInvocationContext() {
         @Override
         public Method getMethod()
         {
            return InterceptorTest.getMethod("foo");
         }
         @Override
         public Object proceed() throws Exception
         {
            return "foo";
         }
      });
     
      //assert Manager.instance().isLongRunningConversation();
      assert "foo".equals(result);

      result = (String) ci.aroundInvoke( new MockInvocationContext() {
         @Override
         public Method getMethod()
         {
            return InterceptorTest.getMethod("end");
         }
View Full Code Here


      {
         addInterceptor( new Interceptor( new EventInterceptor(), this ) );
      }
      if ( beanClassHasAnnotation(Conversational.class) )
      {
         addInterceptor( new Interceptor( new ConversationalInterceptor(), this ) );
      }
      if ( Contexts.isApplicationContextActive() ) //ugh, for unit tests
      {
         if ( Init.instance().isJbpmInstalled() )
         {
View Full Code Here

TOP

Related Classes of org.jboss.seam.interceptors.ConversationalInterceptor

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.