Package org.mule.construct

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


                errorCollector.checkThat(context.getMessage().getInboundProperty(SOAP_HEADER_IN), nullValue());
                errorCollector.checkThat(context.getMessage().getInboundProperty(SOAP_HEADER_INOUT), nullValue());
            }
        });

        flow.process(event);
    }


    @Test
    public void invalidXmlInSoapHeaderOutboundProperty() throws Exception
View Full Code Here


        MuleEvent event = getTestEvent(ECHO_HEADERS_REQUEST);
        event.getMessage().setProperty(SOAP_HEADER_IN, "invalid xml", PropertyScope.OUTBOUND);

        try
        {
            flow.process(event);
            fail();
        }
        catch (TransformerMessagingException e)
        {
            assertTrue(e.getMessage().contains(SOAP_HEADER_IN));
View Full Code Here

        MuleEvent event = getTestEvent(ECHO_HEADERS_REQUEST);
        event.getMessage().setProperty(SOAP_HEADER_IN, new Object(), PropertyScope.OUTBOUND);
        try
        {
            flow.process(event);
            fail();
        }
        catch (TransformerMessagingException e)
        {
            assertNull(e.getTransformer());
View Full Code Here

    public void payloadIsIgnoredOperationNoParams() throws Exception
    {
        Flow flow = (Flow) getFlowConstruct("noParams");
        MuleEvent event = getTestEvent(TEST_MESSAGE);

        event = flow.process(event);

        String expectedResponse = "<ns:noParamsResponse xmlns:ns=\"http://consumer.ws.module.mule.org/\">" +
                                  "<text>TEST</text></ns:noParamsResponse>";
        assertXMLEqual(expectedResponse, event.getMessage().getPayloadAsString());
    }
View Full Code Here

                                  "<text>HEADER_VALUE</text></ns2:noParamsWithHeaderResponse>";

        String header = "<header xmlns=\"http://consumer.ws.module.mule.org/\">HEADER_VALUE</header>";
        event.getMessage().setProperty("soap.header", header, PropertyScope.OUTBOUND);

        event = flow.process(event);

        assertXMLEqual(expectedResponse, event.getMessage().getPayloadAsString());
    }

}
View Full Code Here

    {
        Flow flow = (Flow) getFlowConstruct("soapFaultWithoutCatchExceptionStrategy");

        try
        {
            flow.process(getTestEvent(FAIL_REQUEST));
            fail();
        }
        catch (MessagingException e)
        {
            MuleMessage response = e.getEvent().getMessage();
View Full Code Here

    public void catchExceptionStrategyHandlesSoapFault() throws Exception
    {
        Flow flow = (Flow) getFlowConstruct("soapFaultWithCatchExceptionStrategy");

        ExceptionListener listener = new ExceptionListener(muleContext);
        MuleMessage response = flow.process(getTestEvent(FAIL_REQUEST)).getMessage();

        // Assert that the exception was thrown
        listener.waitUntilAllNotificationsAreReceived();

        assertXMLEqual(EXPECTED_SOAP_FAULT_DETAIL, response.getPayloadAsString());
View Full Code Here

    @Test
    public void testTransactional() throws Exception
    {
        Flow flow = (Flow) getFlowConstruct("transactional");
        MuleEvent event = getTestEvent("message", flow);
        flow.process(event);
        MuleMessage message1 = muleContext.getClient().request("out1", 1000);
        MuleMessage message2 = muleContext.getClient().request("out2", 1000);
        assertThat(message1, notNullValue());
        assertThat(message2, notNullValue());
    }
View Full Code Here

    {
        Flow flow = (Flow) getFlowConstruct("transactionalFailInTheMiddle");
        MuleEvent event = getTestEvent("message", flow);
        try
        {
            flow.process(event);
        }
        catch (Exception e) {}
        MuleMessage message1 = muleContext.getClient().request("out1", 1000);
        MuleMessage message2 = muleContext.getClient().request("out2", 1000);
        assertThat(message1, nullValue());
View Full Code Here

    {
        Flow flow = (Flow) getFlowConstruct("transactionalFailAtEnd");
        MuleEvent event = getTestEvent("message", flow);
        try
        {
            flow.process(event);
        }
        catch (Exception e) {}
        MuleMessage message1 = muleContext.getClient().request("out1", 1000);
        MuleMessage message2 = muleContext.getClient().request("out2", 1000);
        assertThat(message1, nullValue());
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.