Package org.mule.api.client

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


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

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

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

    @Before
View Full Code Here

    @Test
    public void usesGenericJdbcConfig() 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 usesCustomTarget() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();

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

        assertInsert(response.getInboundProperty("updateCount"));
    }

    private void assertInsert(Object responseValue) throws SQLException
View Full Code Here

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

        MuleMessage response = client.send("vm://selectParameterizedQuery", MARS.getName(), null);

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

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

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

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

        MuleMessage response = client.send("vm://delete", VENUS.getName(), null);

        assertDelete(response);
    }

    @Test
View Full Code Here

    }

    private void doSuccessfulMessageTest() throws MuleException
    {
        LocalMuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://storedProcedureStreaming", TEST_MESSAGE, null);

        Map payload = (Map) response.getPayload();

        assertThat(payload.size(), IsEqual.equalTo(1));
        assertThat(payload.get("resultSet1"), is(instanceOf(ResultSetIterator.class)));
View Full Code Here

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

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

        assertEquals(1, response.getPayload());
        List<Map<String, String>> result = selectData("select * from PLANET where POSITION=2", getDefaultDataSource());
        assertRecords(result, new Record(new Field("NAME", "Mercury"), new Field("POSITION", 2)));
    }
View Full Code Here

    }

    private void doFailedMessageTest() throws MuleException
    {
        LocalMuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://storedProcedureStreamingError", TEST_MESSAGE, null);

        assertThat(response.getExceptionPayload(), notNullValue());
        assertThat(response.getExceptionPayload().getRootException().getMessage(), equalTo("Failing test on purpose"));
        assertThat(response.getPayload(), is(instanceOf(NullPayload.class)));
    }
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.