Package org.mule.construct

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


    }

    private void assertValidRequest(String flowName, String request) throws Exception
    {
        Flow flow = (Flow) getFlowConstruct(flowName);
        MuleEvent result = flow.process(getTestEvent(request));

        // As there is nothing else after the service, if there were no problems the same contents of the request
        // will be returned.
        assertEquals(request, result.getMessage().getPayloadAsString());
    }
View Full Code Here


    }

    private void assertInvalidRequest(String flowName, String request) throws Exception
    {
        Flow flow = (Flow) getFlowConstruct(flowName);
        MuleEvent result = flow.process(getTestEvent(request));

        assertTrue(result.getMessage().getPayloadAsString().contains("VersionMismatch"));
    }

    private String getRequest(String schema)
View Full Code Here

    {
        Flow flow = (Flow) getFlowConstruct("echo");
        MuleEvent event = getTestEvent(ECHO_REQUEST);

        event.getMessage().setInvocationProperty(CxfConstants.OPERATION, OPERATION_VALUE);
        event = flow.process(event);

        assertXMLEqual(EXPECTED_ECHO_RESPONSE, event.getMessage().getPayloadAsString());
        assertEquals(OPERATION_VALUE, event.getMessage().getInvocationProperty(CxfConstants.OPERATION));
    }
View Full Code Here

    public void consumerWorksWithNoOperationInvocationPropertyDefined() throws Exception
    {
        Flow flow = (Flow) getFlowConstruct("echo");
        MuleEvent event = getTestEvent(ECHO_REQUEST);

        event = flow.process(event);
        assertXMLEqual(EXPECTED_ECHO_RESPONSE, event.getMessage().getPayloadAsString());

        assertNull(event.getMessage().getInvocationProperty(CxfConstants.OPERATION));
    }
}
View Full Code Here

                assertMatchesQuoted(expectedSoapActionHeader, soapAction);
                assertMatchesQuoted(expectedActionInContentType, actionInContentType);
            }
        });

        flow.process(event);
    }

    private String extractAction(String contentType)
    {
        Pattern pattern = Pattern.compile("action=(.*?);");
 
View Full Code Here

    protected void runScenario(String flowName) throws Exception
    {
        MuleMessage message = new DefaultMuleMessage("TEST", muleContext);
        DefaultMuleEvent event = new DefaultMuleEvent(message, getTestInboundEndpoint(""), getTestService());
        Flow flow = (Flow) getFlowConstruct(flowName);
        flow.process(event);
        FlowAssert.verify(flowName);
    }
}
View Full Code Here

        Flow flow = (Flow) getFlowConstruct("clientUploadAttachment");
        MuleEvent event = getTestEvent(request);

        addAttachment(event.getMessage(), TEST_FILE_ATTACHMENT, "testAttachmentId");

        event = flow.process(event);

        String expected = "<ns2:uploadAttachmentResponse xmlns:ns2=\"http://consumer.ws.module.mule.org/\">" +
                          "<result>OK</result></ns2:uploadAttachmentResponse>";

        assertXMLEqual(expected, event.getMessage().getPayloadAsString());
View Full Code Here

                                       "<fileName>%s</fileName></ns:downloadAttachment>", TEST_FILE_ATTACHMENT);

        Flow flow = (Flow) getFlowConstruct("clientDownloadAttachment");
        MuleEvent event = getTestEvent(request);

        event = flow.process(event);

        assertAttachmentInResponse(event.getMessage(), TEST_FILE_ATTACHMENT);
    }

    @Test
View Full Code Here

        Flow flow = (Flow) getFlowConstruct("clientEchoAttachment");
        MuleEvent event = getTestEvent(request);

        addAttachment(event.getMessage(), TEST_FILE_ATTACHMENT, "testAttachmentId");
        event = flow.process(event);

        assertAttachmentInResponse(event.getMessage(), TEST_FILE_ATTACHMENT);
    }

    private void addAttachment(MuleMessage message, String fileName, String attachmentId) throws Exception
View Full Code Here

        MuleEvent event = getTestEvent(ECHO_HEADERS_REQUEST);
        event.getMessage().setProperty(SOAP_HEADER_IN, REQUEST_HEADER_IN, PropertyScope.OUTBOUND);
        event.getMessage().setProperty(SOAP_HEADER_INOUT, REQUEST_HEADER_INOUT, PropertyScope.OUTBOUND);

        event = flow.process(event);

        assertEquals(RESPONSE_HEADER_OUT, event.getMessage().getInboundProperty(SOAP_HEADER_OUT));
        assertEquals(RESPONSE_HEADER_INOUT, event.getMessage().getInboundProperty(SOAP_HEADER_INOUT));

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