Package org.mule.construct

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


        Flow flow2 = muleContext.getRegistry().lookupObject("pojoFlow2");

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

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

    }

    @Override
View Full Code Here


        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

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

        MuleEvent event = getTestEvent(input);
        event.setFlowVariable("books", books);
        event.setFlowVariable("cities", cities);

        Flow flow = (Flow) getFlowConstruct(flowName);
        List<Element> elements = (List<Element>) flow.process(event).getMessage().getPayload();
        assertThat(elements, hasSize(1));

        NodeList childNodes = elements.get(0).getChildNodes();
        assertThat(childNodes.getLength(), greaterThan(0));
View Full Code Here

        Object nonSerializable = new Object();
        message.setInvocationProperty("key", "value");
        message.setInvocationProperty("key2", nonSerializable);

        flow.process(event);

        flowListener.latch.await(RECEIVE_TIMEOUT, TimeUnit.MILLISECONDS);
        MuleEvent processedEvent = flowListener.event;

        // Event is copied, but session isn't
View Full Code Here

    @Test
    public void xmlSourceParam() throws Exception
    {
        Flow flow = (Flow) getFlowConstruct("xmlSourceParam");
        MuleEvent event = flow.process(buildEvent(XMLTestUtils.toSource("simple.xml"), XMLTestUtils.toSource("test.xml")));

        assertExpected(event);
    }

    @Test
View Full Code Here

    @Test
    public void xmlStringParam() throws Exception
    {
        Flow flow = (Flow) getFlowConstruct("xmlStringParam");
        MuleEvent event = flow.process(buildEvent(XMLTestUtils.toString("simple.xml"), XMLTestUtils.toString("test.xml")));

        assertExpected(event);
    }

    private MuleEvent buildEvent(Object payload, Object param) throws Exception
View Full Code Here

        Object nonSerializable = new Object();
        event.getSession().setProperty("key", "value");
        event.getSession().setProperty("key2", nonSerializable);

        flow.process(event);

        flowListener.latch.await(RECEIVE_TIMEOUT, TimeUnit.MILLISECONDS);
        MuleEvent processedEvent = flowListener.event;

        // Event is copied, but session isn't
View Full Code Here

        int numberOfElements = 10;
        for (int i = 0; i < numberOfElements; i++)
        {
            inputData.add(String.valueOf(i));
        }
        MuleEvent responseEvent = flow.process(getTestEvent(inputData));
        assertThat(responseEvent.<List>getSessionVariable("recordsToUpdate").size(), is(numberOfElements));
    }

    private void assertNotNullAndNotExceptionResponse(MuleMessage response)
    {
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.