Package org.mule.construct

Examples of org.mule.construct.Flow.process()


    public void measureSynchronousWait() throws Exception {
        final String payload = RandomStringUtils.randomAlphanumeric(20);
        Flow flow = (Flow) getFlowConstruct("measureSynchronousWait");
        try
        {
            flow.process(getTestEvent(payload));
            fail("Exception should be thrown");
        }
        catch (Exception e)
        {
            assertThat(WaitMeasure.totalWait >= 1000, is(true));
View Full Code Here


    {
        final String payload = RandomStringUtils.randomAlphanumeric(20);
        final int expectedCounterExecutions = 4;
        final int expectedCounterInExceptionStrategyExecutions = 1;
        Flow flow = (Flow) getFlowConstruct("asynchronous-using-threading-profile");
        flow.process(getTestEvent(payload));
        new PollingProber(10000, 100).check(new Probe()
        {
            private int executionOfCountInUntilSuccessful;
            private int executionOfCountInExceptionStrategy;
View Full Code Here

        if (variant.equals(ConfigVariant.FLOW))
        {
            Flow flow = muleContext.getRegistry().lookupObject("component1");
            MuleEvent event = new DefaultMuleEvent(new DefaultMuleMessage("Test MuleEvent", muleContext),
                ((InboundEndpoint) flow.getMessageSource()), flow);
            flow.process(event);
        }
        else
        {
            Service service = muleContext.getRegistry().lookupService("component1");
            MuleEvent event = new DefaultMuleEvent(new DefaultMuleMessage("Test MuleEvent", muleContext),
View Full Code Here

     * @throws Exception
     */
    protected void testFlow(String flowName, MuleEvent event) throws Exception
    {
        Flow flow = this.lookupFlowConstruct(flowName);
        flow.process(event);
        FlowAssert.verify(flowName);
    }

    /**
     * Runs the given flow with a default event
View Full Code Here

     * @return the resulting <code>MuleEvent</code>
     * @throws Exception
     */
    protected MuleEvent runFlow(String flowName, MuleEvent event) throws Exception {
        Flow flow = lookupFlowConstruct(flowName);
        return flow.process(event);
    }

    /**
     * Run the flow specified by name and assert equality on the expected output
     *
 
View Full Code Here

    protected <T> void runFlowAndExpectProperty(String flowName, String propertyName, T expect)
        throws Exception
    {
        Flow flow = lookupFlowConstruct(flowName);
        MuleEvent event = getTestEvent(null);
        MuleEvent responseEvent = flow.process(event);

        Assert.assertEquals(expect, responseEvent.getMessage().getOutboundProperty(propertyName));
    }

    /**
 
View Full Code Here

    public void runScenario(String flowName) throws Exception
    {
        MuleMessage message = new DefaultMuleMessage("data", muleContext);
        DefaultMuleEvent event = new DefaultMuleEvent(message, getTestInboundEndpoint(""), getTestService());
        Flow flow = (Flow) getFlowConstruct(flowName);
        flow.process(event);
        FlowAssert.verify(flowName);
    }

}
View Full Code Here

        MuleEvent event = new DefaultMuleEvent(message, getTestInboundEndpoint(""), getTestService());

        message.setProperty("key", "value", PropertyScope.SESSION);

        Flow flowA = (Flow) muleContext.getRegistry().lookupFlowConstruct("A");
        MuleEvent result = flowA.process(event);

        assertEquals("value", result.getMessageAsString());
    }

    @Test
View Full Code Here

    {
        MuleMessage message = new DefaultMuleMessage("data", muleContext);
        MuleEvent event = new DefaultMuleEvent(message, getTestInboundEndpoint(""), getTestService());

        Flow flowA = (Flow) muleContext.getRegistry().lookupFlowConstruct("B");
        MuleEvent result = flowA.process(event);

        assertEquals("value", result.getMessage().getProperty("key", PropertyScope.SESSION));
    }

    @Test
View Full Code Here

    @Test
    public void createJdbcRecordAndConsumeIt() throws Exception
    {
        final MuleContext clientAppMuleContext = getMuleContextForApp(CLIENT_APP);
        Flow flow = (Flow) clientAppMuleContext.getRegistry().lookupFlowConstruct("dbClientService");
        flow.process(AbstractMuleContextTestCase.getTestEvent(new Object(), clientAppMuleContext));
        MuleMessage response = getMuleContextForApp(SERVER_APP).getClient().request("vm://out", 5000);
        assertThat(response, notNullValue());
    }

}
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.