Package org.mule.api.client

Examples of org.mule.api.client.LocalMuleClient


    }

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

        assertThat(response.getPayload(), is(instanceOf(List.class)));
        List generatedKeys = (List) response.getPayload();
        assertThat(generatedKeys.size(), equalTo(1));
        assertThat(generatedKeys.get(0), is(instanceOf(Map.class)));
View Full Code Here


    }

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

        Map<String, Object> props = new HashMap<String, Object>();
        props.put(HttpConnector.HTTP_METHOD_PROPERTY, HttpConstants.METHOD_GET);

        MuleMessage result = client.send("http://localhost:" + port.getNumber() + "/helloworld/sayHelloWithJson/World", TEST_MESSAGE, props);

        assertEquals((Integer) HttpConstants.SC_OK, result.getInboundProperty(HttpConnector.HTTP_STATUS_PROPERTY, 0));
        assertEquals(getHelloWorldMessage(), result.getPayloadAsString());
    }
View Full Code Here

    }

    @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

        doTest("vm://bulkUpdateFilePlaceholder");
    }

    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

    }

    @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

    }

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

        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"));
    }
View Full Code Here

        try
        {
            Object xmlType = OracleXmlType.createXmlType(connection, Alien.ET.getXml());

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

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.