Package org.mule.api.client

Examples of org.mule.api.client.MuleClient


    }

    @Override
    public void callEndpointAndExecuteAsserts() throws MuleException
    {
        MuleClient client = muleContext.getClient();
        try
        {
            client.send(outputEndpointName, payload, null);
            fail(here() + " should have thrown an exception");
        }
        catch (MuleException e)
        {
            e.printStackTrace();
View Full Code Here


    @Test
    public void testFaultInCxfServiceWithCatchExceptionStrategy() throws Exception
    {
        MuleMessage request = new DefaultMuleMessage(requestFaultPayload, (Map<String,Object>)null, muleContext);
        MuleClient client = muleContext.getClient();
        MuleMessage response = client.send("http://localhost:" + dynamicPort.getNumber() + "/testServiceWithFaultCatchException", request);
        assertNotNull(response);
        assertEquals(String.valueOf(HttpConstants.SC_OK), response.getInboundProperty(HttpConnector.HTTP_STATUS_PROPERTY));
        assertTrue(response.getPayloadAsString().contains("Anonymous"));
    }
View Full Code Here

    @Test
    public void testFaultInCxfServiceWithCatchExceptionStrategyRethrown() throws Exception
    {
        MuleMessage request = new DefaultMuleMessage(requestFaultPayload, (Map<String,Object>)null, muleContext);
        MuleClient client = muleContext.getClient();
        MuleMessage response = client.send("http://localhost:" + dynamicPort.getNumber() + "/testServiceWithFaultCatchExceptionRethrown", request);
        assertNotNull(response);
        assertEquals(String.valueOf(HttpConstants.SC_INTERNAL_SERVER_ERROR), response.getInboundProperty(HttpConnector.HTTP_STATUS_PROPERTY));
        assertTrue(response.getPayloadAsString().contains("<faultstring>"));
    }
View Full Code Here

    @Test
    public void testExceptionThrownInTransformerWithCatchExceptionStrategy() throws Exception
    {
        MuleMessage request = new DefaultMuleMessage(requestPayload, (Map<String,Object>)null, muleContext);
        MuleClient client = muleContext.getClient();
        MuleMessage response = client.send("http://localhost:" + dynamicPort.getNumber() + "/testTransformerExceptionCatchException", request);
        assertNotNull(response);
        assertEquals(String.valueOf(HttpConstants.SC_OK), response.getInboundProperty(HttpConnector.HTTP_STATUS_PROPERTY));
        assertTrue(response.getPayloadAsString().contains("APPEND"));
    }
View Full Code Here

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

TOP

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

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.