Package org.mule.api.client

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


    @Test
    public void testUntilSuccessfulInFlow() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        client.send("vm://inFlow5", MESSAGE, null);
        MuleMessage response = client.request("vm://outFlow5", 3000);

        assertNotNull(response);
        assertTrue(injectedMessagingExceptionHandler instanceof CatchMessagingExceptionStrategy);
    }
View Full Code Here


    {
        LocalMuleClient client = muleContext.getClient();
        LinkedList<String> list = new LinkedList<String>();
        list.add(MESSAGE);
        client.send("vm://inScope2", list, null);
        MuleMessage response = client.request("vm://outScope2", 3000);

        assertNotNull(response);
        assertTrue((Boolean) response.getProperty("expectedHandler", PropertyScope.SESSION));
        assertTrue(injectedMessagingExceptionHandler instanceof RollbackMessagingExceptionStrategy);
    }
View Full Code Here

    {
        LocalMuleClient client = muleContext.getClient();
        LinkedList<String> list = new LinkedList<String>();
        list.add(MESSAGE);
        client.send("vm://inScope3", list, getMessageProperties());
        MuleMessage response = client.request("vm://outScope3", 3000);

        assertNotNull(response);
        assertTrue((Boolean) response.getProperty("expectedHandler", PropertyScope.SESSION));
        assertTrue(injectedMessagingExceptionHandler instanceof RollbackMessagingExceptionStrategy);
    }
View Full Code Here

    @Test
    public void testCustomProcessorInTransactionalScope() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        client.send("vm://inTransactional1", MESSAGE, null);
        MuleMessage response = client.request("vm://outTransactional1", 3000);

        assertNotNull(response);
        assertFalse((Boolean) response.getProperty("expectedHandler", PropertyScope.SESSION));
        assertTrue(injectedMessagingExceptionHandler instanceof CatchMessagingExceptionStrategy);
    }
View Full Code Here

    @Test
    public void testCustomProcessorInExceptionStrategy() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        client.send("vm://inStrategy1", MESSAGE, null);
        MuleMessage response = client.request("vm://outStrategy1",3000);

        assertNotNull(response);
        assertFalse((Boolean) response.getProperty("expectedHandler", PropertyScope.SESSION));
        assertTrue(injectedMessagingExceptionHandler instanceof MessagingExceptionHandlerToSystemAdapter);
    }
View Full Code Here

    private void testTransactionalScope(String destination, String expected, Map<String, Object> messageProperties) throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        client.send(destination, MESSAGE, messageProperties);
        MuleMessage response = client.request(expected, 3000);

        assertNotNull(response);
    }

    private void testExceptionStrategy(String destination, Map<String, Object> messageProperties) throws MuleException, InterruptedException
View Full Code Here

        message.setOutboundProperty("queueName", "test.out");

        MuleMessage test = client.send("vm://input", message, null);
        assertNotNull(test);

        MuleMessage response = client.request("jms://test.out", 5000);
        assertEquals(testMessage, response.getPayload());
    }
}
View Full Code Here

        assertThat(TEST_MESSAGE_1, equalTo(response.getPayloadAsString()));
        response = client.send("vm://testInput", TEST_MESSAGE_2, null);
        assertThat(TEST_MESSAGE_2, equalTo(response.getPayloadAsString()));

        Set<String> responses = new HashSet<String>();
        response = client.request("vm://testOut", RECEIVE_TIMEOUT);
        responses.add(response.getPayloadAsString());
        response = client.request("vm://testOut", RECEIVE_TIMEOUT);
        responses.add(response.getPayloadAsString());

        assertThat(responses, hasItems(equalTo(TEST_MESSAGE_1), equalTo(TEST_MESSAGE_2)));
View Full Code Here

        assertThat(TEST_MESSAGE_2, equalTo(response.getPayloadAsString()));

        Set<String> responses = new HashSet<String>();
        response = client.request("vm://testOut", RECEIVE_TIMEOUT);
        responses.add(response.getPayloadAsString());
        response = client.request("vm://testOut", RECEIVE_TIMEOUT);
        responses.add(response.getPayloadAsString());

        assertThat(responses, hasItems(equalTo(TEST_MESSAGE_1), equalTo(TEST_MESSAGE_2)));
    }
View Full Code Here

        assertThat(NullPayload.getInstance(), equalTo(response.getPayload()));
        response = client.send("vm://testInput", TEST_MESSAGE_3, null);
        assertThat(TEST_MESSAGE_3, equalTo(response.getPayloadAsString()));

        Set<String> responses = new HashSet<String>();
        response = client.request("vm://testOut", RECEIVE_TIMEOUT);
        responses.add(response.getPayloadAsString());
        response = client.request("vm://testOut", RECEIVE_TIMEOUT);
        responses.add(response.getPayloadAsString());

        assertThat(responses, hasItems(equalTo(TEST_MESSAGE_1), equalTo(TEST_MESSAGE_3)));
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.