Package org.mule.api.client

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


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

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

        assertInsert(response.getPayload());
    }

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


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

        assertBulkModeResult(response.getPayload());
    }

    @Test
View Full Code Here

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

        assertEquals(1, response.getPayload());
    }

    @Test
View Full Code Here

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

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

        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

    }

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

        assertThat(response.getPayload(), is(instanceOf(ResultSetIterator.class)));
        assertRecords(response.getInboundProperty("processedRecords"), getAllPlanetRecords());
    }
View Full Code Here

    }

    private void doFailedMessageTest() throws MuleException
    {
        LocalMuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://selectStreamingError", 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

    {
        LocalMuleClient client = muleContext.getClient();
        List<String> planetNames = new ArrayList<String>();
        planetNames.add(VENUS.getName());
        planetNames.add(MARS.getName());
        MuleMessage response = client.send("vm://deleteBulk", planetNames, null);

        assertBulkDelete(response);
    }

    @Test
View Full Code Here

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

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

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

        MuleMessage response = client.send("vm://storedProcedureCustomSource", TEST_MESSAGE, 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
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.