Package com.alibaba.citrus.service.pipeline.impl.condition

Examples of com.alibaba.citrus.service.pipeline.impl.condition.JexlCondition


        str += "}";

        assertEquals(str, valve.toString());

        // with content
        valve.setWhenConditions(new Condition[] { new JexlCondition("1==2"), new JexlCondition("2!=3") });
        valve.setWhenBlocks(new Pipeline[] { createPipeline(new LogValve(), new LogValve()),
                                             createPipeline(new LogValve(), new LogValve(), new LogValve()) });
        valve.setOtherwiseBlock(createPipeline(new LogValve()));

        str = "";
View Full Code Here


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

        valve.setWhenConditions(new Condition[] { new JexlCondition("1==2"), new JexlCondition("2!=3") });

        valve.setWhenBlocks(new Pipeline[] { createPipeline(new LogValve(), new LogValve()),
                                             createPipeline(new LogValve(), new LogValve(), new LogValve()) });

        valve.setOtherwiseBlock(createPipeline(new LogValve()));
View Full Code Here

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

        valve.setWhenConditions(new Condition[] { new JexlCondition("1==2"), new JexlCondition("2==3") });

        valve.setWhenBlocks(new Pipeline[] { createPipeline(new LogValve(), new LogValve()),
                                             createPipeline(new LogValve(), new LogValve(), new LogValve()) });

        valve.setOtherwiseBlock(createPipeline(new LogValve()));
View Full Code Here

        // no body/conditon
        assertEquals(str, valve.toString());

        // with body/condition
        Pipeline pipeline = createPipeline(new LogValve(), new LogValve(), new LogValve());
        valve.setCondition(new JexlCondition("1==2"));
        valve.setLoopBody(pipeline);

        str = "";
        str += "WhileLoopValve {\n";
        str += "  condition = JexlCondition[1==2]\n";
View Full Code Here

    }

    @Test
    @Override
    public void loop_exceedsMax() throws Exception {
        valve.setCondition(new JexlCondition("1==1"));
        super.loop_exceedsMax();
    }
View Full Code Here

    }

    @Test
    @Override
    public void loop_withBreak() throws Exception {
        valve.setCondition(new JexlCondition("1==1"));
        super.loop_withBreak();
    }
View Full Code Here

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

        valve.setCondition(new JexlCondition("loopCount<=2"));
        valve.setLoopBody(createPipeline(new LogValve(), new LogValve(), new LogValve()));
        valve.afterPropertiesSet();

        assertInvoke(pipeline, false);
        assertLog("1-1", //
View Full Code Here

    public void toString_() {
        valve = newInstance();
        valve.setToLabel(" mylabel ");
        assertEquals("BreakIfValve[toLabel=mylabel, if null]", valve.toString());

        JexlCondition condition = new JexlCondition();
        condition.setExpression("1==2");

        valve = newInstance();
        valve.setLevels(10);
        valve.setCondition(condition);
View Full Code Here

    public void toString_() {
        valve = newInstance();
        valve.setToLabel(" mylabel ");
        assertEquals("BreakUnlessValve[toLabel=mylabel, unless null]", valve.toString());

        JexlCondition condition = new JexlCondition();
        condition.setExpression("1==2");

        valve = newInstance();
        valve.setLevels(10);
        valve.setCondition(condition);
View Full Code Here

        str += "}";

        assertEquals(str, valve.toString());

        // with condition & block
        valve.setCondition(new JexlCondition("1==2"));
        valve.setBlock(createPipeline(new LogValve(), new LogValve(), new LogValve()));

        str = "";
        str += "IfValve {\n";
        str += "  condition = JexlCondition[1==2]\n";
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.service.pipeline.impl.condition.JexlCondition

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.