Package org.mule.api.client

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


    @Test
    public void testClientWithSOAPFaultCatchException() throws Exception
    {
        MuleMessage request = new DefaultMuleMessage("hello", (Map<String,Object>)null, muleContext);
        MuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://testClientSOAPFaultCatchException", request);
        assertNotNull(response);
        assertTrue(response.getExceptionPayload() == null);
    }

    @Test
View Full Code Here


    @Test
    public void testClientWithSOAPFaultCatchExceptionRedirect() throws Exception
    {
        MuleMessage request = new DefaultMuleMessage("TEST", (Map<String,Object>)null, muleContext);
        MuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://testClientSOAPFaultCatchExceptionRedirect", request);
        assertNotNull(response);
        assertTrue(response.getPayloadAsString().contains("TEST"));
        assertTrue(response.getExceptionPayload() == null);
    }
View Full Code Here

    @Test
    public void testClientWithTransformerExceptionCatchException() throws Exception
    {
        MuleMessage request = new DefaultMuleMessage("hello", (Map<String,Object>)null, muleContext);
        MuleClient client = muleContext.getClient();
        MuleMessage response = client.send("vm://testClientTransformerExceptionCatchException", request);
        assertNotNull(response);
        assertTrue(response.getPayloadAsString().contains(" Anonymous"));
    }

    @Test
View Full Code Here

    @Test
    public void testServerClientProxyWithTransformerExceptionCatchStrategy() throws Exception
    {
        MuleClient client = muleContext.getClient();
        MuleMessage result = client.send("http://localhost:" + dynamicPort.getNumber() + "/testProxyWithTransformerExceptionCatchStrategy", requestPayload, null);
        String resString = result.getPayloadAsString();
        assertEquals(String.valueOf(HttpConstants.SC_OK), result.getInboundProperty(HttpConnector.HTTP_STATUS_PROPERTY));
        assertTrue(resString.contains("Anonymous"));
    }
View Full Code Here

    @Override
    public void callEndpointAndExecuteAsserts() throws MuleException
    {
        MuleClient client = muleContext.getClient();
        MuleMessage result = client.send(outputEndpointName, payload, null);

        assertEquals(here(), expectedPayloadResult, result.getPayload());
    }

    private String here()
View Full Code Here

    @Test
    public void testEchoWsdl() throws Exception
    {
        MuleClient client = muleContext.getClient();
        MuleMessage result = client.send("vm://test", "some payload", null);

        assertNotNull(result.getPayload());
        assertEquals("Hello some payload", result.getPayload());
    }
}
View Full Code Here

    public void testCxfWsdlService() throws Exception
    {
        MuleClient client = muleContext.getClient();

        MuleMessage message = new DefaultMuleMessage("test1", muleContext);
        MuleMessage reply = client.send(TEST_URL, message);
        assertNotNull(reply);

        Document response = (Document) reply.getPayload();
        assertNotNull(response);
View Full Code Here

        MuleClient client = muleContext.getClient();

        Map<String, Object> props = new HashMap<String, Object>();
        props.put(HttpConstants.HEADER_CONTENT_TYPE, "text/plain;charset=UTF-8");
        MuleMessage result = client.send("clientEndpoint", TEST_MESSAGE, props);

        assertNotNull(result);
        assertEquals(TEST_MESSAGE + " Received", result.getPayloadAsString());
        assertTrue("Callback never fired", callbackMade.get());
    }
View Full Code Here

        sendWithResponse("inMyComponent1", "test", "mycomponent1", 5);
        sendWithResponse("inMyComponent2", "test", "mycomponent2", 5);

        String url = String.format("http://localhost:%d/mycomponent-notfound", port1.getNumber());
        MuleMessage result = client.send(url, "test", null);
        assertNotNull(result);
        assertNotNull(result.getExceptionPayload());
        final int status = result.getInboundProperty("http.status", 0);
        assertEquals(404, status);
View Full Code Here

        MuleClient client = muleContext.getClient();

        List<Object> results = new ArrayList<Object>();
        for (int i = 0; i < noOfMessages; i++)
        {
            results.add(client.send(
                ((InboundEndpoint) muleContext.getRegistry().lookupObject(endPointName)).getAddress(),
                message, null)
                .getPayload(DataType.BYTE_ARRAY_DATA_TYPE));
        }
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.