Package org.mule.api.client

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


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

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

        assertMessageContains(response, getAllPlanetRecords());
    }

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

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

        assertMessageContains(response, getVenusRecord(), getEarthRecord());
    }

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

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

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

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

        assertMessageContains(response, getAllPlanetRecords());
        assertBulkModeResult(response.getInboundProperty("updateCounts"));
    }
}
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

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

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

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

        int expectedUpdateCount = testDatabase instanceof DerbyTestDatabase ? 0 : 1;
        assertEquals(expectedUpdateCount, 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

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.