Package org.mule.api.client

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


        assertNull(message.getExceptionPayload());
        assertEquals(FIRST_MESSAGE, message.getPayload());

        Dummy payload = new Dummy();
        payload.setContent(SECOND_MESSAGE);
        client.dispatch(DEFAULT_INPUT_QUEUE, new DefaultMuleMessage(payload, muleContext));
        message = client.request(DEFUALT_OUTPUT_QUEUE, TIMEOUT);
        assertNotNull(message);
        assertNotNull(message.getPayload());
        assertNull(message.getExceptionPayload());
        assertEquals(SECOND_MESSAGE, ((Dummy)message.getPayload()).getContent());
View Full Code Here


        assertNotNull(message);
        assertNotNull(message.getPayload());
        assertNull(message.getExceptionPayload());
        assertEquals(SECOND_MESSAGE, ((Dummy)message.getPayload()).getContent());

        client.dispatch(DEFAULT_INPUT_QUEUE, THIRD_MESSAGE, null);
        message = client.request(DEFUALT_OUTPUT_QUEUE, TIMEOUT);
        assertNull(message);
    }

    @Test
View Full Code Here

    @Test
    public void testFunctionalTestUsingExpressionFilter() throws Exception
    {
        MuleClient client = muleContext.getClient();

        client.dispatch("vm://in2", FIRST_MESSAGE, null);
        MuleMessage message = client.request("vm://out2", TIMEOUT);
        assertNotNull(message);
        assertNotNull(message.getPayload());
        assertNull(message.getExceptionPayload());
        assertEquals(FIRST_MESSAGE, message.getPayload());
View Full Code Here

        assertNull(message.getExceptionPayload());
        assertEquals(FIRST_MESSAGE, message.getPayload());

        Dummy payload = new Dummy();
        payload.setContent(SECOND_MESSAGE);
        client.dispatch("vm://in2", new DefaultMuleMessage(payload, muleContext));
        message = client.request("vm://out2", TIMEOUT);
        assertNotNull(message);
        assertNotNull(message.getPayload());
        assertNull(message.getExceptionPayload());
        assertEquals(SECOND_MESSAGE, ((Dummy)message.getPayload()).getContent());
View Full Code Here

        assertNotNull(message);
        assertNotNull(message.getPayload());
        assertNull(message.getExceptionPayload());
        assertEquals(SECOND_MESSAGE, ((Dummy)message.getPayload()).getContent());

        client.dispatch("vm://in2", THIRD_MESSAGE, null);
        message = client.request("vm://out2", TIMEOUT);
        assertNull(message);
    }

    @Test
View Full Code Here

    @Test
    public void testAsynchronousDispatching() throws Exception
    {
        MuleClient client = muleContext.getClient();
        client.dispatch("vm://receiver1?connector=Connector1", "Test", null);
        MuleMessage result = client.request("vm://out?connector=Connector2", RECEIVE_TIMEOUT);
        assertNotNull(result);
        assertEquals(result.getPayloadAsString(), "Test");
    }
}
View Full Code Here

        Map<String, Object> messageProperties = new HashMap<String, Object>();
        String replyToUri = "jms://out2";
        messageProperties.put(MuleProperties.MULE_REPLY_TO_PROPERTY, replyToUri);

        client.dispatch("jms://out", MESSAGE, messageProperties);

        MuleMessage response = client.request(replyToUri, TIMEOUT);
        assertThat(response.getPayloadAsString(), is(EXPECTED_MODIFIED_MESSAGE));
        assertThat(response.getExceptionPayload(), IsNull.<Object>nullValue());
        response = client.request(replyToUri, TINY_TIMEOUT);
View Full Code Here

        MuleClient muleClient = muleContext.getClient();

        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put(MuleProperties.MULE_CORRELATION_ID_PROPERTY, CUSTOM_CORRELATION_ID);

        muleClient.dispatch("vm://in", TEST_MESSAGE, properties);

        MuleMessage response = muleClient.request("vm://out", RECEIVE_TIMEOUT);

        assertNotNull(response);
        assertEquals(getCustomCorrelationId(), response.getOutboundProperty(MuleProperties.MULE_CORRELATION_ID_PROPERTY));
View Full Code Here

    public void noPropagationOfInboundScopeAsynchronous() throws Exception
    {
        MuleClient client = muleContext.getClient();
        MuleMessage message = new DefaultMuleMessage(TEST_MESSAGE, muleContext);
        message.setProperty("foo", "bar", PropertyScope.INBOUND);
        client.dispatch("vm://in-asynch", message);
        MuleMessage response = client.request("vm://out-asynch", RECEIVE_TIMEOUT);
        assertNotNull(response);
        assertNull("Property should not have been propogated for this scope",
            response.getProperty("foo", PropertyScope.INBOUND));
    }
View Full Code Here

    public void noPropagationOfOutboundScopeAsynchronous() throws Exception
    {
        MuleClient client = muleContext.getClient();
        MuleMessage message = new DefaultMuleMessage(TEST_MESSAGE, muleContext);
        message.setProperty("foo", "bar", PropertyScope.OUTBOUND);
        client.dispatch("vm://in-asynch", message);
        MuleMessage response = client.request("vm://out-asynch", RECEIVE_TIMEOUT);
        assertNotNull(response);
        assertNull("Property should not have been propogated for this scope",
            response.getProperty("foo", PropertyScope.OUTBOUND));
    }
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.