Package org.mule.api.client

Examples of org.mule.api.client.LocalMuleClient


    }

    @Test
    public void usesCustomTarget() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://updateBulkCustomTarget", TEST_MESSAGE, null);

        assertMessageContains(response, getAllPlanetRecords());
        assertBulkModeResult(response.getInboundProperty("updateCounts"));
    }
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);

        assertMessageContains(response, getAllPlanetRecords());
    }
View Full Code Here

    }

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

        MuleMessage response = client.send("vm://testRequestResponse", TEST_MESSAGE, null);

        assertThat(response.getPayload(), is(instanceOf(Map.class)));
        Map payload = (Map) response.getPayload();
        // Apparently Derby has a bug: when there are no resultset returned, then
        // there is a fake updateCount=0 that is returned. Check how this works in other DB vendors.
View Full Code Here

    }

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

        MuleMessage response = client.send("vm://testRequestResponse", TEST_MESSAGE, null);

        assertMessageContains(response, getAllPlanetRecords());
    }
View Full Code Here

    }

    @Test
    public void requiresSplittableType() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://updateBulk", TEST_MESSAGE, null);

        assertTrue(response.getPayload() instanceof NullPayload);
        assertNotNull(response.getExceptionPayload());
    }
View Full Code Here

    }

    @Test
    public void testRequestResponse() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://updateStoredProcedure", TEST_MESSAGE, null);

        int expectedUpdateCount = testDatabase instanceof DerbyTestDatabase ? 0 : 1;
        assertEquals(expectedUpdateCount, response.getPayload());
        List<Map<String, String>> result = selectData("select * from PLANET where POSITION=4", getDefaultDataSource());
        assertRecords(result, new Record(new Field("NAME", "Mercury"), new Field("POSITION", 4)));
View Full Code Here

    }

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

        MuleMessage response = client.send("vm://testRequestResponse", TEST_MESSAGE, null);

        assertThat(response.getPayload(), is(instanceOf(Map.class)));
        Map payload = (Map) response.getPayload();
        // Apparently Derby has a bug: when there are no resultset returned, then
        // there is a fake updateCount=0 that is returned. Check how this works in other DB vendors.
View Full Code Here

    }

    @Test
    public void updatesDataRequestResponse() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://updateRequestResponse", TEST_MESSAGE, null);

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

    }

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

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

        assertEquals(1, response.getPayload());

        verifyUpdatedRecord();
    }
View Full Code Here

    }

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

        MuleMessage response = client.send("vm://testRequestResponse", "foo", null);
        assertThat(response.getPayload(), is(instanceOf(Map.class)));
        Map payload = (Map) response.getPayload();
        assertThat(payload.size(), equalTo(1));
        int expectedUpdateCount = testDatabase instanceof DerbyTestDatabase ? 0 : 1;
        assertThat((Integer) payload.get("updateCount1"), equalTo(expectedUpdateCount));
View Full Code Here

TOP

Related Classes of org.mule.api.client.LocalMuleClient

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.