Package org.mule.api.client

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


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

        assertThat(response.getPayloadAsString(), equalTo(TEST_MESSAGE));
        assertThat(response.<StatementResultIterator>getInboundProperty("statementResult"), CoreMatchers.is(instanceOf(Map.class)));
        verifyUpdatedRecord();
    }
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 mapPayload = (Map) response.getPayload();
        int expectedUpdateCount = testDatabase instanceof DerbyTestDatabase ? 0 : 1;
        assertThat((Integer) mapPayload.get("updateCount1"), equalTo(expectedUpdateCount));
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 deletesInBulkModeFromCustomSource() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();

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

        assertBulkDelete(response);
    }

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

    @Test
    public void commitsChanges() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://testCommit", 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 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 usesDynamicQuery() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();

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

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

    @Test
    public void commitsChangesWhenMpIsNotTransactionalOnCommit() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://commitWithNonTransactionalMP", 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 usesCustomSource() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();

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

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