Package org.mule.api.client

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


    public void noPropagationOfInvocationScopeAsynchronous() throws Exception
    {
        MuleClient client = muleContext.getClient();
        MuleMessage message = new DefaultMuleMessage(TEST_MESSAGE, muleContext);
        message.setProperty("foo", "bar", PropertyScope.INVOCATION);
        client.dispatch("vm://in-asynch", message);
        MuleMessage response = client.request("vm://out-asynch", RECEIVE_TIMEOUT);
        assertNotNull(response);
        // VM Transport does not propagate invocation properties
        assertNull(response.getProperty("foo", PropertyScope.INVOCATION));
    }
View Full Code Here


    public void propagationOfSessionScopeAsynchronous() throws Exception
    {
        MuleClient client = muleContext.getClient();
        MuleMessage message = new DefaultMuleMessage(TEST_MESSAGE, muleContext);
        message.setProperty("foo", "bar", PropertyScope.SESSION);
        client.dispatch("vm://in-asynch", message);
        MuleMessage response = client.request("vm://out-asynch", RECEIVE_TIMEOUT);
        assertNotNull(response);
        assertEquals("bar", response.getProperty("foo", PropertyScope.SESSION));
    }
}
View Full Code Here

    @Test
    public void testTransactionQueueEventsTrue() throws Exception
    {
        MuleClient client = muleContext.getClient();
        client.dispatch("vm://in", "TEST", null);
        MuleMessage message = client.request("vm://out", 10000);
        assertNotNull(message);
        if (wouldBeDisabled)
        {
            throw new IllegalStateException("Test is wrong, and must be disabled");
View Full Code Here

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

        client.dispatch("ep_jndi-queue", DEFAULT_INPUT_MESSAGE, null);

        MuleMessage result = client.request("vm://out", RECEIVE_TIMEOUT);
        assertNotNull(result);
        assertEquals(DEFAULT_INPUT_MESSAGE, result.getPayloadAsString());
    }
View Full Code Here

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

        client.dispatch("ep_jndi-topic", DEFAULT_INPUT_MESSAGE, null);

        MuleMessage result = client.request("vm://out", RECEIVE_TIMEOUT);
        assertNotNull(result);
        assertEquals(DEFAULT_INPUT_MESSAGE, result.getPayloadAsString());
    }
View Full Code Here

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

        client.dispatch("ep_non-jndi-queue", DEFAULT_INPUT_MESSAGE, null);

        MuleMessage result = client.request("vm://out", RECEIVE_TIMEOUT);
        assertNotNull(result);
        assertEquals(DEFAULT_INPUT_MESSAGE, result.getPayloadAsString());
    }
View Full Code Here

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

        client.dispatch("ep_non-jndi-queue-optional-jndi", DEFAULT_INPUT_MESSAGE, null);

        MuleMessage result = client.request("vm://out", RECEIVE_TIMEOUT);
        assertNotNull(result);
        assertEquals(DEFAULT_INPUT_MESSAGE, result.getPayloadAsString());
    }
View Full Code Here

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

        client.dispatch("ep_non-jndi-queue-force-jndi", DEFAULT_INPUT_MESSAGE, null);

        MuleMessage result = client.request("vm://out", RECEIVE_TIMEOUT);
        assertNull("Attempt to look up a non-existant JNDI Destination should have failed", result);
    }
View Full Code Here

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

        client.dispatch("ep_jndi-queue-with-jndi-name-resolver", DEFAULT_INPUT_MESSAGE, null);

        MuleMessage result = client.request("vm://out", RECEIVE_TIMEOUT);
        assertNotNull(result);
        assertEquals(DEFAULT_INPUT_MESSAGE, result.getPayloadAsString());
    }
View Full Code Here

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

        client.dispatch("ep_jndi-topic-with-jndi-name-resolver", DEFAULT_INPUT_MESSAGE, null);

        MuleMessage result = client.request("vm://out", RECEIVE_TIMEOUT);
        assertNotNull(result);
        assertEquals(DEFAULT_INPUT_MESSAGE, result.getPayloadAsString());
    }
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.