Package org.mule.api.client

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


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

        assertThat(response.getPayload(), is(instanceOf(Map.class)));

        Map<String, Object> mapPayload = (Map) response.getPayload();
View Full Code Here


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

        assertThat(response.getPayloadAsString(), equalTo(TEST_MESSAGE));
        assertRecords(response.getInboundProperty("resultSet"), getAllPlanetRecords());
    }
}
View Full Code Here

    }

    private void doTest(String url) throws MuleException, SQLException
    {
        LocalMuleClient client = muleContext.getClient();
        MuleMessage response = client.send(url, TEST_MESSAGE, null);

        assertBulkModeResult(response.getPayload());
    }
}
View Full Code Here

        List<String> planetNames = new ArrayList<String>();
        planetNames.add(VENUS.getName());
        planetNames.add(MARS.getName());

        MuleMessage response = client.send("vm://deleteCustomTarget", planetNames, null);

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

    private void assertBulkDelete(Object payload) throws SQLException
View Full Code Here

            LocalMuleClient client = muleContext.getClient();
            Map<String, Object> messageProperties = new HashMap<String, Object>();
            messageProperties.put("name", "Monguito");
            messageProperties.put(DESCRIPTION_FIELD, xmlType);

            MuleMessage response = client.send("vm://xmlTypeInputParam", TEST_MESSAGE, messageProperties);

            assertThat(response.getPayload(), is(instanceOf(Map.class)));
            Map<String, Object> mapPayload = (Map) response.getPayload();
            assertThat(mapPayload.size(), equalTo(0));
View Full Code Here

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

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

        assertBulkInsert(response.getPayload());
    }

    private void assertBulkInsert(Object payload) throws SQLException
View Full Code Here

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

        assertThat(response.getPayloadAsString(), equalTo(TEST_MESSAGE));

        assertBulkModeResult(response.getInboundProperty("updateCounts"));
    }
View Full Code Here

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

        MuleMessage response = client.send("vm://testInput", SAMPLE_REQUEST, null);

        assertNotNull("Got a null response", response);
        assertTrue("Got wrong response", response.getPayloadAsString().contains("ns2:sayHiResponse"));
    }
}
View Full Code Here

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

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

        assertInsert(response);
    }

    private void assertInsert(MuleMessage response) throws SQLException
View Full Code Here

            }
        }

        LocalMuleClient client = muleContext.getClient();

        MuleMessage response = client.send("vm://updateWithXmlTypeParam", xmlType, null);

        assertEquals(2, response.getPayload());

        assertUpdatedAlienDscription();
    }
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.