Package org.mule.client

Examples of org.mule.client.DefaultLocalMuleClient.send()


        DefaultLocalMuleClient client = new DefaultLocalMuleClient(muleContext);
       
        HashMap<String, Object> props = new HashMap<String,Object>();
        props.put("username", "ross");
        props.put("pass", "ross");
        MuleMessage result = client.send("vm://test", "hi", props);
        assertNull(result.getExceptionPayload());
       
        props.put("pass", "badpass");
        try
        {
View Full Code Here


        assertNull(result.getExceptionPayload());
       
        props.put("pass", "badpass");
        try
        {
            client.send("vm://test", "hi", props);
            fail("Exception expected");
        }
        catch (Exception e)
        {
            // expected
View Full Code Here

        message.setOutboundProperty("host", "localhost");
        message.setOutboundProperty("port", getPorts().get(0));
        message.setOutboundProperty("path", "/TEST");

        DefaultLocalMuleClient client = new DefaultLocalMuleClient(muleContext);
        MuleMessage response = client.send("vm://vmProxy", message);
        assertEquals("hello Received", response.getPayloadAsString());

        response = client.request("vm://vmOut", 5000);
        assertNotNull(response);
    }
View Full Code Here

        DefaultLocalMuleClient client = new DefaultLocalMuleClient(muleContext);
       
        HashMap<String, Object> props = new HashMap<String,Object>();
        props.put("username", "ross");
        props.put("password", "ross");
        MuleMessage result = client.send(endpoint, "hi", props);
        assertNull(result.getExceptionPayload());
       
        props.put("password", "badpass");
        try
        {
View Full Code Here

        assertNull(result.getExceptionPayload());
       
        props.put("password", "badpass");
        try
        {
            client.send(endpoint, "hi", props);
            fail("Exception expected");
        }
        catch (Exception e)
        {
            // expected
View Full Code Here

    {
        Map<String,Object> props = new HashMap<String,Object>();
        props.put(HttpConnector.HTTP_METHOD_PROPERTY, "GET");
       
        DefaultLocalMuleClient client = new DefaultLocalMuleClient(muleContext);
        MuleMessage result = client.send("http://localhost:8585/test/hello",
            new DefaultMuleMessage("", muleContext),
            props);
       
        assertEquals("Hello", result.getPayloadAsString());
    }
View Full Code Here

    {
        Map<String,Object> props = new HashMap<String,Object>();
        props.put(HttpConnector.HTTP_METHOD_PROPERTY, "GET");
       
        DefaultLocalMuleClient client = new DefaultLocalMuleClient(muleContext);
        MuleMessage result = client.send("http://localhost:63081/test/hello",
            new DefaultMuleMessage("", muleContext),
            props);
       
        assertEquals("Hello", result.getPayloadAsString());
    }
View Full Code Here

public class WSRMTest extends DynamicPortTestCase
{
    public void testAnonymous() throws Exception
    {
        MuleClient client = new DefaultLocalMuleClient(muleContext);
        MuleMessage result = client.send("anonymousReplyClientEndpoint", new DefaultMuleMessage("test", muleContext));       
        assertEquals("Hello test", result.getPayloadAsString());
    }

    public void testDecoupled() throws Exception
    {
View Full Code Here

    }

    public void testDecoupled() throws Exception
    {
        MuleClient client = new DefaultLocalMuleClient(muleContext);
        MuleMessage result = client.send("decoupledClientEndpoint", new DefaultMuleMessage("test", muleContext));       
        assertEquals("Hello test", result.getPayloadAsString());
    }
   
    @Override
    protected String getConfigResources()
View Full Code Here

    @Test
    public void testAnonymous() throws Exception
    {
        MuleClient client = new DefaultLocalMuleClient(muleContext);
        MuleMessage result = client.send("anonymousReplyClientEndpoint", new DefaultMuleMessage("test", muleContext));
        assertEquals("Hello test", result.getPayloadAsString());
    }

    @Test
    public void testDecoupled() throws Exception
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.