Package org.mule.api.client

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


    }

    public void testNoException() throws Exception
    {
        MuleClient client = muleContext.getClient();
        client.send("vm://exception", "testNoException", null);                                 

        // Both messages should have been sent.
        assertNotNull(client.request("vm://queueC", 1000));           
        assertNotNull(client.request("vm://queueD", 1000));           
    }
View Full Code Here


    public void testExceptionInService() throws Exception
    {
        MuleClient client = muleContext.getClient();       
        try
        {
            client.send("vm://exception", "testExceptionInService", null);                     
            fail("Should have thrown an exception");
        }
        catch (Exception e)
        {
            assertTrue(ExceptionUtils.getRootCause(e) instanceof FunctionalTestException);
View Full Code Here

    {
        MuleClient client = muleContext.getClient();
       
        try
        {
            client.send("vm://exception", "testExceptionInTransformer", null);
            fail("Should have thrown an exception");
        }
        catch (Exception e)
        {
            assertTrue(ExceptionUtils.getRootCause(e) instanceof TransformerException);
View Full Code Here

        MuleClient client = muleContext.getClient();
        BPMS bpms = muleContext.getRegistry().lookupObject(BPMS.class);
        assertNotNull(bpms);

        // Create a new process.
        MuleMessage response = client.send("vm://simple", "data", null);
        Object process = response.getPayload();

        String processId = (String)bpms.getId(process);
        // The process should be started and in a wait state.
        assertFalse(processId == null);
View Full Code Here

        assertEquals("dummyState", bpms.getState(process));

        // Advance the process one step.
        Map props = new HashMap();
        props.put(Process.PROPERTY_PROCESS_ID, processId);
        response = client.send("vm://simple", null, props);
        process = response.getPayload();

        // The process should have ended.
        assertTrue(bpms.hasEnded(process));
    }
View Full Code Here

        MuleClient client = muleContext.getClient();
        BPMS bpms = muleContext.getRegistry().lookupObject(BPMS.class);
        assertNotNull(bpms);

        // Create a new process.
        MuleMessage response = client.send("vm://simple", "data", null);
        Object process = response.getPayload();

        String processId = (String)bpms.getId(process);
        // The process should be started and in a wait state.
        assertFalse(processId == null);
View Full Code Here

        assertEquals("dummyState", bpms.getState(process));

        // Advance the process one step.
        Map props = new HashMap();
        props.put(Process.PROPERTY_PROCESS_ID, processId);
        response = client.send("vm://simple", null, props);
        process = response.getPayload();

        // The process should have ended.
        assertTrue(bpms.hasEnded(process));
    }
View Full Code Here

        BPMS bpms = muleContext.getRegistry().lookupObject(BPMS.class);
        assertNotNull(bpms);

        Map<String, Object> props = new HashMap<String, Object>();
        props.put("foo", "bar");
        MuleMessage response = client.send("vm://variables", "data", props);
        String processId = (String)bpms.getId(response.getPayload());
        assertNotNull(processId);

        response = client.request("vm://queueA", TIMEOUT);
        assertNotNull(response);
View Full Code Here

        // Advance the process
        props = new HashMap<String, Object>();
        props.put(Process.PROPERTY_PROCESS_ID, processId);
        props.put("straw", "berry");
        props.put("time", new Date());
        response = client.send("vm://variables", "data", props);
       
        response = client.request("vm://queueB", TIMEOUT);
        assertNotNull(response);
        assertEquals("bar", response.getInboundProperty("foo"));
        assertEquals(0.75, response.getInboundProperty("fraction"));
View Full Code Here

public class WSRMTest extends DynamicPortTestCase
{
    public void testAnonymous() throws Exception
    {
        MuleClient client = new DefaultLocalMuleClient(muleContext);
        MuleMessage result = client.send("anonymousReplyClientEndpoint", new DefaultMuleMessage("test", muleContext));       
        assertEquals("Hello test", result.getPayloadAsString());
    }

    public void testDecoupled() throws Exception
    {
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.