Examples of newInvocation()


Examples of com.alibaba.citrus.service.pipeline.impl.PipelineImpl.newInvocation()

        });

        pipeline = createPipeline(new Valve() {
            public void invoke(PipelineContext pipelineContext) throws Exception {
                contexts[0] = pipelineContext;
                p2.newInvocation(pipelineContext).invoke();
                pipelineContext.invokeNext();
            }
        });

        assertInvoke(pipeline, false);
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.impl.PipelineImpl.newInvocation()

        // set maxLoopCount = 1
        valve.setMaxLoopCount(1);

        try {
            pipeline.newInvocation().invoke();
            fail();
        } catch (TooManyLoopsException e) {
            assertThat(e, exception("Too many loops: exceeds the maximum count: 1"));
        }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.impl.PipelineImpl.newInvocation()

    @Test
    public void loop_notInited() throws Exception {
        PipelineImpl pipeline = createPipeline(new LogValve(), valve, new LogValve());

        try {
            pipeline.newInvocation().invoke();
            fail();
        } catch (PipelineException e) {
            assertThat(e, exception(IllegalStateException.class, "not been initialized yet"));
        }
    }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.impl.PipelineImpl.newInvocation()

        // default maxLoopCount = 10
        valve.setLoopBody(createPipeline(new LogValve(), new LogValve(), new LogValve()));
        valve.afterPropertiesSet();

        try {
            pipeline.newInvocation().invoke();
            fail();
        } catch (TooManyLoopsException e) {
            assertThat(e, exception("Too many loops: exceeds the maximum count: 10"));
        }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.impl.PipelineImpl.newInvocation()

        // set maxLoopCount = 1
        valve.setLoopBody(createPipeline(new LogValve(), new LogValve(), new LogValve()));
        valve.setMaxLoopCount(1);

        try {
            pipeline.newInvocation().invoke();
            fail();
        } catch (TooManyLoopsException e) {
            assertThat(e, exception("Too many loops: exceeds the maximum count: 1"));
        }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.impl.PipelineImpl.newInvocation()

    @Test
    public void notInPerformRunnableAsync() {
        PipelineImpl pipeline = getPipeline("pipeline1");

        try {
            pipeline.newInvocation().invoke();
            fail();
        } catch (PipelineException e) {
            assertThat(e, exception(IllegalStateException.class, "<doPerformRunnable> valve should be inside <performRunnableAsync>"));
        }
    }
View Full Code Here

Examples of com.meterware.servletunit.ServletUnitClient.newInvocation()

   
     
        ServletRunner sr = new ServletRunner();
    ServletUnitClient sc = sr.newClient();
    WebRequest request   = new PostMethodWebRequest( "https://test.meterware.com/myServlet" );
    InvocationContext ic = sc.newInvocation( request );
   
        OAuth2ProblemException problem = new OAuth2ProblemException(OAuth2.ErrorCode.UNSUPPORTED_RESPONSE_TYPE);
        // if you do not specify status code 200 here response does not inluce anything
        problem.setParameter(OAuth2ProblemException.HTTP_STATUS_CODE,new Integer(200));
        HttpServletResponse hsr = ic.getResponse();
View Full Code Here

Examples of com.meterware.servletunit.ServletUnitClient.newInvocation()

   
     
        ServletRunner sr = new ServletRunner();
    ServletUnitClient sc = sr.newClient();
    WebRequest request   = new PostMethodWebRequest( "https://test.meterware.com/myServlet" );
    InvocationContext ic = sc.newInvocation( request );
   
        OAuth2ProblemException problem = new OAuth2ProblemException(OAuth2.ErrorCode.UNSUPPORTED_RESPONSE_TYPE);
        problem.setParameter(OAuth2ProblemException.HTTP_STATUS_CODE,new Integer(302));
        //problem.getParameters().put(OAuth2.REDIRECT_URI,"https://client.example.com/cb");
        problem.setParameter(OAuth2.REDIRECT_URI,"https://client.example.com/cb");
View Full Code Here

Examples of com.meterware.servletunit.ServletUnitClient.newInvocation()

    {

        ServletRunner sr = new ServletRunner();
        ServletUnitClient sc = sr.newClient();
        WebRequest request   = new PostMethodWebRequest( "https://test.meterware.com/myServlet" );
        InvocationContext ic = sc.newInvocation( request );

        OAuth2ProblemException problem = new OAuth2ProblemException(OAuth2.ErrorCode.UNSUPPORTED_RESPONSE_TYPE);
        problem.setParameter(OAuth2ProblemException.HTTP_STATUS_CODE,new Integer(302));
        //problem.getParameters().put(OAuth2.REDIRECT_URI,"https://client.example.com/cb");
        problem.setParameter(OAuth2.REDIRECT_URI,"https://client.example.com/cb");
View Full Code Here

Examples of com.meterware.servletunit.ServletUnitClient.newInvocation()

     
      for (String[] testCase : OAUTH_PARAMETERS) {
        ServletRunner sr = new ServletRunner();
        ServletUnitClient sc = sr.newClient();
        WebRequest request   = new PostMethodWebRequest( "https://test.meterware.com/myServlet" );      
        InvocationContext ic = sc.newInvocation( request );     
      
            String label = testCase[0];
            //String realm = testCase[1];
            List<OAuth2.Parameter> parameters = decodeForm(testCase[1]);
            OAuth2Servlet.sendFormInJson(ic.getResponse(),parameters);
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.