Package org.mule.construct

Examples of org.mule.construct.Flow


public class MethodInvokerDefinitionParserTestCase extends FunctionalTestCase
{

    public void testPojoFlow() throws Exception
    {
        Flow flow = muleContext.getRegistry().lookupObject("pojoFlow");
        Flow flow2 = muleContext.getRegistry().lookupObject("pojoFlow2");

        assertEquals("start nullmethod2Arg1Arg2config2Val arg2Valmethod2Arg1Arg2config2Val ", flow.process(
            getTestEvent("start ")).getMessageAsString());

        assertEquals("start nullmethod2Arg1Arg2null arg2Valmethod2Arg1Arg2null ", flow2.process(
            getTestEvent("start ")).getMessageAsString());

    }
View Full Code Here


        super.doSetUp();
    }

    public void testFlow() throws MuleException, Exception
    {
        final Flow flow = muleContext.getRegistry().lookupObject("flow");
        assertEquals(DefaultInboundEndpoint.class, flow.getMessageSource().getClass());
        assertEquals("vm://in", ((InboundEndpoint) flow.getMessageSource()).getEndpointURI()
            .getUri()
            .toString());
        assertEquals(5, flow.getMessageProcessors().size());
        assertNotNull(flow.getExceptionListener());

        assertEquals("012xyzabc3", muleContext.getClient().send("vm://in",
            new DefaultMuleMessage("0", muleContext)).getPayloadAsString());

    }
View Full Code Here

        assertNotSame(Thread.currentThread(), thread);
    }

    public void testFlowCompositeSource() throws MuleException, Exception
    {
        final Flow flow = muleContext.getRegistry().lookupObject("flow2");
        assertEquals(StartableCompositeMessageSource.class, flow.getMessageSource().getClass());
        assertEquals(2, flow.getMessageProcessors().size());

        assertEquals("01xyz", muleContext.getClient().send("vm://in2",
            new DefaultMuleMessage("0", muleContext)).getPayloadAsString());
        assertEquals("01xyz", muleContext.getClient().send("vm://in3",
            new DefaultMuleMessage("0", muleContext)).getPayloadAsString());
View Full Code Here

    private IdempotentMessageFilter idempotentMessageFilterFromFlow(String flowName) throws Exception
    {
        FlowConstruct flow = getFlowConstruct(flowName);
        assertTrue(flow instanceof Flow);

        Flow simpleFlow = (Flow) flow;
        List<MessageProcessor> processors = simpleFlow.getMessageProcessors();
        assertEquals(1, processors.size());

        MessageProcessor firstMP = processors.get(0);
        assertEquals(IdempotentMessageFilter.class, firstMP.getClass());
View Full Code Here

        return "org/mule/test/issues/mule-5038-config.xml";
    }

    public void testTransformerOnGlobalEndpoint()
    {
        Flow flow1 = muleContext.getRegistry().lookupObject("flow1");
        Filter flow1Filter = ((MessageFilter) flow1.getMessageProcessors().get(0)).getFilter();
        Flow flow2 = muleContext.getRegistry().lookupObject("flow2");
        Filter flow2Filter = ((MessageFilter) flow2.getMessageProcessors().get(0)).getFilter();

        assertNotSame(flow1Filter, flow2Filter);
    }
View Full Code Here

        assertNotSame(flow1Filter, flow2Filter);
    }

    public void testFilterOnGlobalEndpoint()
    {
        Flow flow1 = muleContext.getRegistry().lookupObject("flow1");
        Transformer flow1Transoformer = (Transformer) flow1.getMessageProcessors().get(1);
        Flow flow2 = muleContext.getRegistry().lookupObject("flow2");
        Transformer flow2Transoformer = (Transformer) flow2.getMessageProcessors().get(1);

        assertNotSame(flow1Transoformer, flow2Transoformer);
    }
View Full Code Here

        assertNotSame(flow1Transoformer, flow2Transoformer);
    }

    public void testCustomProcessorOnGlobalEndpoint()
    {
        Flow flow1 = muleContext.getRegistry().lookupObject("flow1");
        MessageProcessor flow1Processor = (MessageProcessor) flow1.getMessageProcessors().get(3);
        Flow flow2 = muleContext.getRegistry().lookupObject("flow2");
        MessageProcessor flow2Processor = (MessageProcessor) flow2.getMessageProcessors().get(3);

        assertNotSame(flow1Processor, flow2Processor);
    }
View Full Code Here

        assertNotSame(flow1Processor, flow2Processor);
    }

    public void testCompositeProcessorOnGlobalEndpoint()
    {
        Flow flow1 = muleContext.getRegistry().lookupObject("flow1");
        MessageProcessor flow1Processor = (MessageProcessor) flow1.getMessageProcessors().get(2);
        Flow flow2 = muleContext.getRegistry().lookupObject("flow2");
        MessageProcessor flow2Processor = (MessageProcessor) flow2.getMessageProcessors().get(2);

        assertNotSame(flow1Processor, flow2Processor);
    }
View Full Code Here

        assertEquals("bar", (((CustomProcessingStrategy) processingStrategy).foo));
    }

    private PipelineProcessingStrategy getFlowProcesingStrategy(String flowName) throws Exception
    {
        Flow flow = (Flow) getFlowConstruct(flowName);
        return flow.getProcessingStrategy();
    }
View Full Code Here

    private void installCustomExceptionHandler() throws Exception
    {
        FlowConstruct flow = getFlowConstruct("filter");
        assertNotNull(flow);

        Flow simpleFlow = (Flow) flow;
        simpleFlow.setExceptionListener(new TestMessagingExceptionHandler(exceptionHandlerLatch));
    }
View Full Code Here

TOP

Related Classes of org.mule.construct.Flow

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.