Package org.mule.api.client

Examples of org.mule.api.client.LocalMuleClient.dispatch()


    @Test
    public void updatesDataOneWay() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        client.dispatch("vm://executeDdlOneWay", TEST_MESSAGE, null);

        MuleMessage response = client.request("vm://testOut", RECEIVE_TIMEOUT);

        assertTableCreation(response.getPayload());
    }
View Full Code Here


    @Test
    public void providesMultipleConnections() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();

        client.dispatch("vm://testIn", TEST_MESSAGE, null);
        client.dispatch("vm://testIn", TEST_MESSAGE, null);

        MuleMessage response = client.request("vm://testOut", RECEIVE_TIMEOUT);
        assertThat(response.getExceptionPayload(), is(nullValue()));
View Full Code Here

    public void providesMultipleConnections() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();

        client.dispatch("vm://testIn", TEST_MESSAGE, null);
        client.dispatch("vm://testIn", TEST_MESSAGE, null);

        MuleMessage response = client.request("vm://testOut", RECEIVE_TIMEOUT);
        assertThat(response.getExceptionPayload(), is(nullValue()));

        response = client.request("vm://testOut", RECEIVE_TIMEOUT);
View Full Code Here

    {
        try
        {
            LocalMuleClient client = muleContext.getClient();

            client.dispatch("vm://testIn", TEST_MESSAGE, null);
            client.dispatch("vm://testIn", TEST_MESSAGE, null);

            MuleMessage response = client.request("vm://connectionError", RECEIVE_TIMEOUT);
            assertThat(response.getExceptionPayload().getException(), is(instanceOf(MessagingException.class)));
        }
View Full Code Here

        try
        {
            LocalMuleClient client = muleContext.getClient();

            client.dispatch("vm://testIn", TEST_MESSAGE, null);
            client.dispatch("vm://testIn", TEST_MESSAGE, null);

            MuleMessage response = client.request("vm://connectionError", RECEIVE_TIMEOUT);
            assertThat(response.getExceptionPayload().getException(), is(instanceOf(MessagingException.class)));
        }
        finally
View Full Code Here

    @Test
    public void testOneWay() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();

        client.dispatch("vm://testOneWay", TEST_MESSAGE, null);
        MuleMessage response = client.request("vm://testOut", RECEIVE_TIMEOUT);

        assertBulkModeResult(response.getPayload());
    }
View Full Code Here

    @Test
    public void testOneWay() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        client.dispatch("vm://testOneWay", VENUS.getName(), null);

        MuleMessage response = client.request("vm://testOut", RECEIVE_TIMEOUT);

        assertEquals(1, response.getPayload());
    }
View Full Code Here

    @Test
    public void testOneWay() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        client.dispatch("vm://testOneWay", TEST_MESSAGE, null);

        MuleMessage response = client.request("vm://testOut", RECEIVE_TIMEOUT);

        assertEquals(1, response.getPayload());
    }
View Full Code Here

        Map<String, String> mapPayload = new HashMap<String, String>();
        mapPayload.put("key1", "value1");
        mapPayload.put("key2", "value2");

        LocalMuleClient client = muleContext.getClient();
        client.dispatch("vm://testInput", mapPayload, null);

        MuleMessage response = client.request("vm://testOut", RECEIVE_TIMEOUT);
        assertEquals(mapPayload, response.getPayload());
    }
View Full Code Here

    {
        LocalMuleClient client = muleContext.getClient();
        FeedReceiver component = (FeedReceiver)getComponent("feedConsumer");
        component.getReceivedEntries().set(0);
        String feed = loadResourceAsString("sample-feed.atom");
        client.dispatch("jms://feed.in", feed, null);
        Thread.sleep(2000);
        assertEquals(25, component.getCount());
    }

    @Test
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.