Package org.mule.api.client

Examples of org.mule.api.client.LocalMuleClient


    }

    @Test
    public void commitsChanges() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://testCommit", 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 rollbacksChanges() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://testRollback", 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", MARS.getName()), new Field("POSITION", 4)));
View Full Code Here

    }

    @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 commitsChangesWhenMpIsNotTransactionalOnCommit() 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 chunksStreamedRecords() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://selectStreamingChunks", TEST_MESSAGE, null);

        List<MuleMessage> chunks = (List<MuleMessage>) response.getPayload();
        assertEquals(2, chunks.size());
        assertThat(chunks.get(0), is(instanceOf(List.class)));
        assertRecords(chunks.get(0), getVenusRecord(), getEarthRecord());
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()));

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

    }

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

        assertThat(response.getPayloadAsString(), equalTo(TEST_MESSAGE));
        assertTableCreation(response.<Integer>getInboundProperty("updateCount"));
    }
View Full Code Here

    }

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

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

        assertMessageContains(response, getAllPlanetRecords());

        assertThat(errorCount, equalTo(EXPECTED_CONNECTION_ERRORS));
    }
View Full Code Here

    }

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

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

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

    }

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

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

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