Examples of ValveRunner


Examples of com.alibaba.citrus.webx.pipeline.ValveRunner

    @Test
    public void dev_detail() throws Exception {
        System.setProperty("productionModeFromSystemProperties", "false");
        prepareWebClient(null);

        TestValve.runnerHolder.set(new ValveRunner() {
            public void run(RunData rundata, PipelineContext pipelineContext) throws Exception {
                throw new ResourceNotFoundException("not found!");
            }
        });
View Full Code Here

Examples of com.alibaba.citrus.webx.pipeline.ValveRunner

                   containsAll("NOT_FOUND", "/app1/test.htm", ResourceNotFoundException.class.getName(), "not found!"));
    }

    @Test
    public void prod_sendError() throws Exception {
        TestValve.runnerHolder.set(new ValveRunner() {
            public void run(RunData rundata, PipelineContext pipelineContext) throws Exception {
                throw new ResourceNotFoundException("not found!");
            }
        });
View Full Code Here

Examples of com.alibaba.citrus.webx.pipeline.ValveRunner

    @Test
    public void prod_ExceptionPipeline() throws Exception {
        System.setProperty("exceptionPipelineNameFromSystemProperties", "myExceptionPipeline");
        prepareWebClient(null);

        TestValve.runnerHolder.set(new ValveRunner() {
            public void run(RunData rundata, PipelineContext pipelineContext) throws Exception {
                throw new IllegalStateException("wrong!");
            }
        });

        TestExceptionValve.runnerHolder.set(new ValveRunner() {
            public void run(RunData rundata, PipelineContext pipelineContext) throws Exception {
                rundata.setContentType("text/plain");
                rundata.getResponse().getWriter().println("error page from valve");
            }
        });
View Full Code Here

Examples of com.alibaba.citrus.webx.pipeline.ValveRunner

    @Test
    public void prod_ExceptionPipeline_noSchema() throws Exception {
        System.setProperty("exceptionPipelineNameFromSystemProperties", "myExceptionPipeline");
        prepareWebClient(null);

        TestExceptionValve.runnerHolder.set(new ValveRunner() {
            public void run(RunData rundata, PipelineContext pipelineContext) throws Exception {
                rundata.setContentType("text/plain");
                rundata.getResponse().getWriter().println("error page from valve");
            }
        });
View Full Code Here

Examples of com.alibaba.citrus.webx.pipeline.ValveRunner

                          holder.mapping.getRequestHandlerNames());
    }

    @Test
    public void valve_breakToTop() throws Exception {
        TestValve.runnerHolder.set(new ValveRunner() {
            public void run(RunData rundata, PipelineContext pipelineContext) throws Exception {
                pipelineContext.breakPipeline(0);
            }
        });
View Full Code Here

Examples of com.alibaba.citrus.webx.pipeline.ValveRunner

        assertThat(clientResponseContent, containsAll("hello, app1"));
    }

    @Test
    public void valve_exception() throws Exception {
        TestValve.runnerHolder.set(new ValveRunner() {
            public void run(RunData rundata, PipelineContext pipelineContext) throws Exception {
                throw new IllegalStateException("wrong!");
            }
        });
View Full Code Here

Examples of com.alibaba.citrus.webx.pipeline.ValveRunner

                   containsAll("<pre>", "</pre>", IllegalStateException.class.getName(), "wrong!"));
    }

    @Test
    public void valve_not_found_exception() throws Exception {
        TestValve.runnerHolder.set(new ValveRunner() {
            public void run(RunData rundata, PipelineContext pipelineContext) throws Exception {
                throw new ResourceNotFoundException("not found!");
            }
        });
View Full Code Here

Examples of com.alibaba.citrus.webx.pipeline.ValveRunner

                   containsAll("<pre>", "</pre>", ResourceNotFoundException.class.getName(), "not found!"));
    }

    @Test
    public void valve_bad_request_exception() throws Exception {
        TestValve.runnerHolder.set(new ValveRunner() {
            public void run(RunData rundata, PipelineContext pipelineContext) throws Exception {
                throw new BadRequestException("bad request!");
            }
        });
View Full Code Here

Examples of com.alibaba.citrus.webx.pipeline.ValveRunner

                   containsAll("<pre>", "</pre>", BadRequestException.class.getName(), "bad request!"));
    }

    @Test
    public void valve_exception_exception() throws Exception {
        TestValve.runnerHolder.set(new ValveRunner() {
            public void run(RunData rundata, PipelineContext pipelineContext) throws Exception {
                throw new IllegalStateException("wrong!");
            }
        });
View Full Code Here

Examples of com.alibaba.citrus.webx.pipeline.ValveRunner

        }
    }

    @Test
    public void valve_exception_exception_2() throws Exception {
        TestValve.runnerHolder.set(new ValveRunner() {
            public void run(RunData rundata, PipelineContext pipelineContext) throws Exception {
                throw new IllegalStateException("wrong!");
            }
        });
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.