Package org.mule.api.client

Examples of org.mule.api.client.LocalMuleClient


    }

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

        assertTrue(response.getPayload() instanceof NullPayload);

        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 usesDynamicQuery() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();

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

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

    }

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

        assertTrue(response.getPayload() instanceof NullPayload);

        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 usesCustomSource() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();

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

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

    }

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

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

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

    }

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

        List<MuleMessage> responses = new LinkedList<MuleMessage>();
        MuleMessage response = client.request("vm://testOut", RECEIVE_TIMEOUT);
        responses.add(response);
        response = client.request("vm://testOut", RECEIVE_TIMEOUT);
        responses.add(response);
        response = client.request("vm://testOut", RECEIVE_TIMEOUT);
        responses.add(response);

        assertEquals(3, responses.size());
        assertThat(responses, AllOf.allOf(ContainsMessage.mapPayloadWith("NAME", MARS.getName()), ContainsMessage.mapPayloadWith("NAME", EARTH.getName()), ContainsMessage.mapPayloadWith("NAME", VENUS.getName())));
    }
View Full Code Here

    }

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

        assertThat(response.getPayloadAsString(), equalTo(TEST_MESSAGE));
        assertThat(response.<Integer>getInboundProperty("updateCount"), equalTo(1));
        verifyUpdatedRecord();
    }
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 limitsRows() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();

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

        assertMessageContains(response, getVenusRecord(), getEarthRecord());
    }
View Full Code Here

    }

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

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

        assertMessageContains(response, getVenusRecord(), getEarthRecord());
    }
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.