Package org.mule.api.client

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


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

        assertEquals(1, response.getPayload());
        verifyUpdatedRecord();
    }
View Full Code Here

        public void execute(int messageId) throws Exception
        {
            logger.info("Thread: " + Thread.currentThread().getName() + " message: " + messageId);
            LocalMuleClient client = muleContext.getClient();

            client.send("vm://testRequestResponse", TEST_MESSAGE, null);
        }
    }

    private class OneWayLoadTask implements LoadTask
    {
View Full Code Here

            LocalMuleClient client = muleContext.getClient();

            Map<String, Object> messageProperties = new HashMap<String, Object>();
            messageProperties.put("name", Alien.ET.getName());

            return client.send("vm://insertXmlType", builder.build(connection), messageProperties);
        }
        finally
        {
            if (connection != null)
            {
View Full Code Here

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

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

        assertMessageContains(response, TestRecordUtil.getMarsRecord());
    }

    @Test
View Full Code Here

    {
        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);

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

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

        assertTableCreation(response.getPayload());
    }

    @Test
View Full Code Here

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

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

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

    @Test
    public void streamsRecords() throws Exception
    {
        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

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

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.