Package org.mule.construct

Examples of org.mule.construct.Flow


        assertTrue(queueProfile.getObjectStore() instanceof TestObjectStore);
    }

    public void testFlowDefaults()
    {
        Flow flow = lookupFlow("flowDefault");
       
        // default for flow is sync processing -> no queueing
        assertTrue(flow.getProcessingStrategy() instanceof SynchronousProcessingStrategy);
    }
View Full Code Here


        assertTrue(flow.getProcessingStrategy() instanceof SynchronousProcessingStrategy);
    }
   
    public void testFlowQueuedAsync()
    {
        Flow flow = lookupFlow("flowQueuedAsync");
       
       
        PipelineProcessingStrategy pipeline = flow.getProcessingStrategy();
        assertTrue(pipeline instanceof QueuedAsynchronousProcessingStrategy);
       
        QueuedAsynchronousProcessingStrategy queuedPipeline = (QueuedAsynchronousProcessingStrategy)pipeline;
        assertObjectStoreIsDefaultMemoryObjectStore(queuedPipeline.getQueueStore());
    }
View Full Code Here

        assertTrue(list.contains("mar"));
    }

    public void testTransformerConfigWithSingleArgumentShortcutConfigInFlow() throws Exception
    {
        Flow flow = (Flow) muleContext.getRegistry().lookupFlowConstruct("et");
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("foo", "moo");
        props.put("bar", "mar");

        MuleMessage message = new DefaultMuleMessage(new FruitBowl(new Apple(), new Banana()), props,
            muleContext);

        MuleEvent resultEvent = flow.process(new DefaultMuleEvent(message, getTestInboundEndpoint(""),
            getTestSession(getTestService(), muleContext)));
        assertNotNull(resultEvent);
        assertNotNull(resultEvent.getMessage().getPayload());
        Object payload = resultEvent.getMessage().getPayload();
        assertFalse(payload.getClass().isArray());
View Full Code Here

        return "namespace-config.xml";
    }

    public void testFlowConfig() throws Exception
    {
        Flow flowConstruct = muleContext.getRegistry().lookupObject("flowTest");
        assertNotNull(flowConstruct);
        assertTrue(flowConstruct.getMessageSource() instanceof InboundEndpoint);
        InboundEndpoint ep = ((InboundEndpoint)flowConstruct.getMessageSource());
        assertEquals(2, ep.getMessageProcessors().size());
        MessageProcessor mp = ep.getMessageProcessors().get(0);
        assertTrue(mp instanceof FeedSplitter);
        mp = ep.getMessageProcessors().get(1);
        assertTrue(mp instanceof MessageFilter);
View Full Code Here

        return "namespace-config.xml";
    }

    public void testFlowConfig() throws Exception
    {
        Flow flowConstruct = muleContext.getRegistry().lookupObject("flowTest");
        assertNotNull(flowConstruct);
        assertTrue(flowConstruct.getMessageSource() instanceof InboundEndpoint);
        InboundEndpoint ep = ((InboundEndpoint)flowConstruct.getMessageSource());
        assertEquals(2, ep.getMessageProcessors().size());
        MessageProcessor mp = ep.getMessageProcessors().get(0);
        assertTrue(mp instanceof FeedSplitter);
        mp = ep.getMessageProcessors().get(1);
        assertTrue(mp instanceof MessageFilter);
View Full Code Here

            List<MessageProcessor> mps = new ArrayList<MessageProcessor>();
            mps.add(cxfInboundMP);
           
            EndpointBuilder ep = muleContext.getEndpointFactory().getEndpointBuilder(decoupledEndpoint);
           
            Flow flow = new Flow("decoupled-" + ep.toString(), muleContext);
            flow.setMessageProcessors(mps);
            flow.setMessageSource(ep.buildInboundEndpoint());
            muleContext.getRegistry().registerObject(flow.getName(), flow);
        }
       
        return processor;
    }
View Full Code Here

        {
            return getComponentObject(((SimpleService) flowConstruct).getComponent());
        }
        else if (flowConstruct instanceof Flow)
        {
            Flow flow = (Flow)flowConstruct;
            //Retrieve the first component
            for (MessageProcessor processor : flow.getMessageProcessors())
            {
                if(processor instanceof Component)
                {
                    return getComponentObject(((Component) processor));
                }
View Full Code Here

    }
   
    public static Flow getTestFlow(String name, MuleContext context, boolean initialize)
        throws Exception
    {
        final Flow flow = new Flow(name, context);
        if (initialize)
        {
            context.getRegistry().registerFlowConstruct(flow);
        }
View Full Code Here

   *            The name of the flow to run
   * @param expect
   *            The expected output
   */
  protected <T> void runFlowAndExpect(String flowName, T expect) throws Exception {
    Flow flow = lookupFlowConstruct(flowName);
    MuleEvent event = AbstractMuleContextTestCase.getTestEvent(null);
    MuleEvent responseEvent = flow.process(event);

    Assert.assertEquals(expect, responseEvent.getMessage().getPayload());
  }
View Full Code Here

   *            The expected output
   * @param payload
   *            The payload of the input event
   */
  protected <T, U> void runFlowWithPayloadAndExpect(String flowName, T expect, U payload) throws Exception {
    Flow flow = lookupFlowConstruct(flowName);
    MuleEvent event = AbstractMuleContextTestCase.getTestEvent(payload);
    MuleEvent responseEvent = flow.process(event);

    Assert.assertEquals(expect, responseEvent.getMessage().getPayload());
  }
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.