Examples of PipelineImpl


Examples of com.alibaba.citrus.service.pipeline.impl.PipelineImpl

        }
    }

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

        // 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"));
        }

        assertLog("1-1", //
                  "2-1-loop-0", "2-2-loop-0", "2-3-loop-0", //
                  "2-1-loop-1", "2-2-loop-1", "2-3-loop-1", //
                  "2-1-loop-2", "2-2-loop-2", "2-3-loop-2", //
                  "2-1-loop-3", "2-2-loop-3", "2-3-loop-3", //
                  "2-1-loop-4", "2-2-loop-4", "2-3-loop-4", //
                  "2-1-loop-5", "2-2-loop-5", "2-3-loop-5", //
                  "2-1-loop-6", "2-2-loop-6", "2-3-loop-6", //
                  "2-1-loop-7", "2-2-loop-7", "2-3-loop-7", //
                  "2-1-loop-8", "2-2-loop-8", "2-3-loop-8", //
                  "2-1-loop-9", "2-2-loop-9", "2-3-loop-9" //
        );

        // 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

                  "2-1-loop-0", "2-2-loop-0", "2-3-loop-0");
    }

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

        final int[] counter = new int[] { 2 };

        class CountDownValve implements Valve {
            private int levels;
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.impl.PipelineImpl

        assertEquals("myresult", valve.getOutputKey());
    }

    private DoPerformRunnableValve getDoPerformRunnableValve(int index) {
        PipelineImpl asyncPipeline = (PipelineImpl) performRunnableAsyncValve.getAsyncPipeline();
        return (DoPerformRunnableValve) asyncPipeline.getValves()[index];
    }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.impl.PipelineImpl

        defaultFactory = createApplicationContext("doPerformRunnableValve.xml");
    }

    @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.alibaba.citrus.service.pipeline.impl.PipelineImpl

        ResourceLoadingXmlApplicationContext context = new ResourceLoadingXmlApplicationContext(new FileSystemResource(new File(srcdir, configFile)));
        return context;
    }

    protected final PipelineImpl getPipeline(String pipelineId) {
        PipelineImpl pipeline = (PipelineImpl) factory.getBean(pipelineId);
        assertNotNull(pipeline);
        return pipeline;
    }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.impl.PipelineImpl

    @Test
    public void defaultSubPipeline() {
        valve = getValve("pipeline1", 0, PerformRunnableAsyncValve.class);

        PipelineImpl asyncPipeline = (PipelineImpl) valve.getAsyncPipeline();

        assertEquals(1, asyncPipeline.getValves().length);
        assertTrue(asyncPipeline.getValves()[0] instanceof DoPerformRunnableValve);
    }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.impl.PipelineImpl

    @Test
    public void specifyingSubPipelineRef() {
        valve = getValve("pipeline3", 0, PerformRunnableAsyncValve.class);

        PipelineImpl asyncPipeline = (PipelineImpl) valve.getAsyncPipeline();

        assertSame(factory.getBean("subpipeline1"), asyncPipeline);

        assertEquals(2, asyncPipeline.getValves().length);
        assertTrue(asyncPipeline.getValves()[1] instanceof DoPerformRunnableValve);
    }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.impl.PipelineImpl

    @Test
    public void inlineSubPipeline() {
        valve = getValve("pipeline4", 0, PerformRunnableAsyncValve.class);

        PipelineImpl asyncPipeline = (PipelineImpl) valve.getAsyncPipeline();

        assertNotSame(factory.getBean("subpipeline1"), asyncPipeline);

        assertEquals(2, asyncPipeline.getValves().length);
        assertTrue(asyncPipeline.getValves()[1] instanceof DoPerformRunnableValve);
    }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.impl.PipelineImpl

    protected void init() throws Exception {
        if (asyncPipeline == null) {
            DoPerformRunnableValve valve = new DoPerformRunnableValve();
            valve.afterPropertiesSet();

            PipelineImpl pipeline = new PipelineImpl();
            pipeline.setValves(new Valve[] { valve });
            pipeline.afterPropertiesSet();

            asyncPipeline = pipeline;
        }
    }
View Full Code Here

Examples of net.sf.pipet.engine.PipelineImpl

    return pipelines.get(name);
  }
 
  public Pipeline newPipeline(String name)
  {
    Pipeline p = new PipelineImpl(name, false);
    addAvailablePipeline(p);
    changed();
   
    return p;
  }
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.