Package org.mule

Examples of org.mule.DefaultMuleMessage


    public void testVm() throws Exception
    {
        MuleClient client = new MuleClient(muleContext);
       
        MuleMessage msg = new DefaultMuleMessage("testing", muleContext);
        msg.setReplyTo("ReplyTo");
       
        // Send asynchronous request
        client.dispatch("EchoVm", msg, null);

        // Wait for asynchronous response
View Full Code Here


    public void testCxf() throws Exception
    {
        MuleClient client = new MuleClient(muleContext);
       
        MuleMessage msg = new DefaultMuleMessage("testing", muleContext);
        msg.setReplyTo("ReplyTo");
       
        // Send asynchronous request
        client.dispatch("EchoCxfSend", msg, null);

        // Wait for asynchronous response
View Full Code Here

    }

    private MuleMessage createOutboundMessage()
    {
        MuleMessage msg = new DefaultMuleMessage("OK", muleContext);
        msg.setOutboundProperty("outbound1", "yes");
        msg.setOutboundProperty("outbound2", "no");
        msg.setInvocationProperty("invocation1", "ja");
        msg.setInvocationProperty("invocation2", "nein");
        return msg;
    }
View Full Code Here

         * Create a message with outbound and invocation properties.  These should have been moved to the inbound scope
         * by the time the message is received.  Invocation properties should have been removed
         */
        public MuleMessage process(Object payload)
        {
            MuleMessage msg = new DefaultMuleMessage(payload + "(success)", muleContext);
            msg.setOutboundProperty("outbound3", "123");
            msg.setOutboundProperty("outbound4", "456");
            msg.setInvocationProperty("invocation3", "UVW");
            msg.setInvocationProperty("invocation4", "XYZ");
            return msg;
        }
View Full Code Here

    }

    public void testNullPayloadUsingAsync() throws Exception
    {
        MuleClient client = new MuleClient(muleContext);
        MuleMessage reply = client.send("http://localhost:8990", new DefaultMuleMessage("test", muleContext));

        //TODO RM: What should really be returned when doing an async request?
        assertNotNull(reply.getPayload());
        int status = reply.getInboundProperty(HttpConnector.HTTP_STATUS_PROPERTY, 0);
        assertEquals(status, 200);
View Full Code Here

    }

    public void testPayloadIsNotEmptyNoRemoteSynch() throws Exception
    {
        MuleClient client = new MuleClient(muleContext);
        MuleMessage reply = client.send("http://localhost:8999", new DefaultMuleMessage("test", muleContext));
        assertNotNull(reply.getPayload());
        assertFalse(reply.getPayload() instanceof NullPayload);
        assertEquals("test", reply.getPayloadAsString());
    }
View Full Code Here

    }

    public void testPayloadIsNotEmptyWithRemoteSynch() throws Exception
    {
        MuleClient client = new MuleClient(muleContext);
        MuleMessage reply = client.send("http://localhost:8989", new DefaultMuleMessage("test", muleContext));
        assertNotNull(reply.getPayload());
        assertFalse(reply.getPayload() instanceof NullPayload);
        assertEquals("test", reply.getPayloadAsString());
    }
View Full Code Here

     * @throws Exception
     */
    public void testChunkingContentLength() throws Exception
    {
        MuleClient client = new MuleClient(muleContext);
        MuleMessage reply = client.send("http://localhost:8988", new DefaultMuleMessage("test", muleContext));
        assertNotNull(reply.getPayload());
        assertFalse(reply.getPayload() instanceof NullPayload);
        assertEquals("chunked", reply.getInboundProperty(HttpConstants.HEADER_TRANSFER_ENCODING));
        assertNull(reply.getInboundProperty(HttpConstants.HEADER_CONTENT_LENGTH));
    }
View Full Code Here

    }

    public void testNoChunkingContentLength() throws Exception
    {
        MuleClient client = new MuleClient(muleContext);
        MuleMessage reply = client.send("http://localhost:8987", new DefaultMuleMessage("test", muleContext));
        assertNotNull(reply.getPayload());
        assertFalse(reply.getPayload() instanceof NullPayload);
        assertNotSame("chunked", reply.getInboundProperty(HttpConstants.HEADER_TRANSFER_ENCODING));
        assertNotNull(reply.getInboundProperty(HttpConstants.HEADER_CONTENT_LENGTH));
    }
View Full Code Here

public class InboundTransformingCatchAllTestCase extends FunctionalTestCase
{
    public void testNormal() throws Exception
    {
        MuleClient client = new MuleClient(muleContext);
        client.dispatch("vm://in1", new DefaultMuleMessage("HELLO!", muleContext));
        MuleMessage msg = client.request("vm://catchall", 3000);
        assertNotNull(msg);
        assertTrue(msg.getPayload() instanceof String);

        client.dispatch("vm://in2", new DefaultMuleMessage("HELLO!", muleContext));
        msg = client.request("vm://catchall", 3000);
        assertNotNull(msg);
        assertTrue(msg.getPayload() instanceof byte[]);
    }
View Full Code Here

TOP

Related Classes of org.mule.DefaultMuleMessage

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.