Package org.mule.api.client

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


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

        client.dispatch("ep_non-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 testNonJndiDestinationOptionalWithJndiNameResolver() throws Exception
    {
        MuleClient client = muleContext.getClient();

        client.dispatch("ep_non-jndi-queue-optional-jndi-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 testNonJndiDestinationForceWithJndiNameResolver() throws Exception
    {
        MuleClient client = muleContext.getClient();

        client.dispatch("ep_non-jndi-queue-force-jndi-with-jndi-name-resolver", 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 testOneWayDispatchWithSoapAction() throws Exception
    {
        MuleClient client = muleContext.getClient();

        client.dispatch("http://localhost:" + dynamicPort.getNumber() + "/services/onewayWithSoapAction",
            prepareOneWayTestMessage(), prepareOneWayWithSoapActionTestProperties());

        AsyncServiceWithSoapAction component = (AsyncServiceWithSoapAction)getComponent("asyncServiceWithSoapAction");
        assertTrue(component.getLatch().await(1000, TimeUnit.MILLISECONDS));
    }
View Full Code Here

    @Test
    public void testOneWayDispatchWithSoapActionSpoofing() throws Exception
    {
        MuleClient client = muleContext.getClient();
        client.dispatch("http://localhost:" + dynamicPort.getNumber() + "/services/onewayWithSoapAction",
            prepareOneWayTestMessage(), prepareOneWaySpoofingTestProperties());

        AsyncServiceWithSoapAction component = (AsyncServiceWithSoapAction)getComponent("asyncServiceWithSoapAction");
        assertFalse(component.getLatch().await(1000, TimeUnit.MILLISECONDS));
    }
View Full Code Here

    @Test
    public void testOneWayDispatchUnknownSoapAction() throws Exception
    {
        MuleClient client = muleContext.getClient();
        client.dispatch("http://localhost:" + dynamicPort.getNumber() + "/services/oneway",
            prepareOneWayTestMessage(), prepareOneWayWithSoapActionTestProperties());

        AsyncService component = (AsyncService)getComponent("asyncService");
        assertFalse(component.getLatch().await(1000, TimeUnit.MILLISECONDS));
    }
View Full Code Here

    @Test
    public void testOneWayDispatch() throws Exception
    {
        MuleClient client = muleContext.getClient();
        client.dispatch("http://localhost:" + dynamicPort.getNumber() + "/services/oneway",
            prepareOneWayTestMessage(), prepareOneWayTestProperties());

        AsyncService component = (AsyncService)getComponent("asyncService");
        assertTrue(component.getLatch().await(1000, TimeUnit.MILLISECONDS));
    }
View Full Code Here

        String header = MuleCredentials.createHeader("marie", "marie", "PBE", strategy);

        Map<String, Object> props = new HashMap<String, Object>();
        props.put(MuleProperties.MULE_USER_PROPERTY, header);

        client.dispatch("vm://test", "Marie", props);
        MuleMessage m = client.request("vm://output", 3000);
        assertNotNull(m);
        assertEquals(m.getPayload(), "Marie");
    }
View Full Code Here

        String header = MuleCredentials.createHeader("anon", "anon", "PBE", strategy);

        Map<String, Object> props = new HashMap<String, Object>();
        props.put(MuleProperties.MULE_USER_PROPERTY, header);

        client.dispatch("vm://test", "Marie", props);
        MuleMessage m = client.request("vm://output", 3000);
        assertNull(m);
    }

    @Test
View Full Code Here

        String header = MuleCredentials.createHeader("anonX", "anonX", "PBE", strategy);

        Map<String, Object> props = new HashMap<String, Object>();
        props.put(MuleProperties.MULE_USER_PROPERTY, header);

        client.dispatch("vm://test", "USD,MTL", props);
        MuleMessage m = client.request("vm://output", 3000);
        assertNull(m);
    }
}
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.