Package org.mule.api.client

Examples of org.mule.api.client.LocalMuleClient


        doSuccessfulMessageTest();
    }

    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

        doFailedMessageTest();
    }

    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

    }

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

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

        assertDelete(response);
    }
View Full Code Here

        assertRecords(result, new Record(new Field("NAME", "Mercury"), new Field("POSITION", 2)));
    }

    public void usesInlineOverriddenParams() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();

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

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

    }

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

        assertInsert(response);
    }
View Full Code Here

    }

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

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

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

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

    }

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

        Map<String, Object> props = new HashMap<String, Object>();
        props.put("type", 3);
        MuleMessage response = client.send("vm://expressionParam", TEST_MESSAGE, props);

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

    }

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

        assertEquals(1, response.getPayload());

        assertDeletedPlanetRecords(VENUS.getName());
    }
View Full Code Here

TOP

Related Classes of org.mule.api.client.LocalMuleClient

Copyright © 2018 www.massapicom. 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.