Package org.mule.module.client

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


    public void testNullReturnStopsFlow() throws Exception
    {
        MuleClient client = new MuleClient(muleContext);

        MuleMessage msg = client.send("vm://in", "test data", null);
        assertNotNull(msg);
        final String payload = msg.getPayloadAsString();
        assertNotNull(payload);
        assertFalse("ERROR".equals(payload));
        assertTrue(msg.getPayload() instanceof NullPayload);
View Full Code Here


    {
        MuleClient client = new MuleClient(muleContext);

        Map<String, FunctionalTestComponent> components = muleContext.getRegistry().lookupByType(FunctionalTestComponent.class);
        MuleMessage msg1 = createOutboundMessage();
        MuleMessage response = client.send("vm://in", msg1);
        assertEquals(response.getPayloadAsString(), "OK(success)");
        assertNull(response.getInboundProperty("outbound1"));
        assertNull(response.getInboundProperty("outbound2"));
        assertNull(response.getOutboundProperty("outbound1"));
        assertNull(response.getOutboundProperty("outbound2"));
View Full Code Here

    }

    public void testPost() throws Exception
    {
        MuleClient client = new MuleClient(muleContext);
        MuleMessage message = client.send("httpRequest", "payload", null);
        assertNotNull(message);
        assertNotNull(message.getPayloadAsString());
        assertEquals("IncidentData=payload", message.getPayloadAsString());
    }
View Full Code Here

        Latch whenFinished = new Latch();
        subscriptionBean.setEventCallback(new CountingEventCallback(eventCounter1, 1, whenFinished));

        multicaster.removeApplicationListener(subscriptionBean);
        MuleClient client = new MuleClient(muleContext);
        client.send("vm://event.multicaster", "Test Spring MuleEvent", null);

        assertEquals(0, eventCounter1.get());

        multicaster.addApplicationListener(subscriptionBean);
        client.send("vm://event.multicaster", "Test Spring MuleEvent", null);
View Full Code Here

        client.send("vm://event.multicaster", "Test Spring MuleEvent", null);

        assertEquals(0, eventCounter1.get());

        multicaster.addApplicationListener(subscriptionBean);
        client.send("vm://event.multicaster", "Test Spring MuleEvent", null);

        assertTrue(whenFinished.await(DEFAULT_LATCH_TIMEOUT, TimeUnit.MILLISECONDS));
        assertEquals(1, eventCounter1.get());
        eventCounter1.set(0);
View Full Code Here

        assertTrue(whenFinished.await(DEFAULT_LATCH_TIMEOUT, TimeUnit.MILLISECONDS));
        assertEquals(1, eventCounter1.get());
        eventCounter1.set(0);

        multicaster.removeAllListeners();
        client.send("vm://event.multicaster", "Test Spring MuleEvent", null);

        assertEquals(0, eventCounter1.get());
        multicaster.addApplicationListener(subscriptionBean);
        // context.refresh();
        subscriptionBean.setEventCallback(null);
View Full Code Here

        // register a callback
        Latch whenFinished = new Latch();
        bean.setEventCallback(new CountingEventCallback(eventCounter1, 1, whenFinished));

        MuleClient client = new MuleClient(muleContext);
        client.send("vm://event.multicaster", "Test Spring MuleEvent", null);

        whenFinished.await(DEFAULT_LATCH_TIMEOUT, TimeUnit.MILLISECONDS);
        assertEquals(1, eventCounter1.get());
    }
View Full Code Here

        Latch whenFinished = new Latch();
        bean.setEventCallback(new CountingEventCallback(eventCounter1, 2, whenFinished));

        MuleClient client = new MuleClient(muleContext);
        client.send("vm://event.multicaster", "Test Spring MuleEvent", null);
        ApplicationContext context = ((MuleEventMulticaster) muleContext.getRegistry().lookupObject(
            "applicationEventMulticaster")).applicationContext;
        context.publishEvent(new TestApplicationEvent(context));

        whenFinished.await(DEFAULT_LATCH_TIMEOUT, TimeUnit.MILLISECONDS);
View Full Code Here

        Latch whenFinished = new Latch();
        subscriptionBean.setEventCallback(new CountingEventCallback(eventCounter1, 1, whenFinished));

        MuleClient client = new MuleClient(muleContext);
        client.send("vm://event.multicaster", "Test Spring MuleEvent", null);

        whenFinished.await(DEFAULT_LATCH_TIMEOUT, TimeUnit.MILLISECONDS);
        assertEquals(1, eventCounter1.get());
    }
View Full Code Here

                try
                {
                    MuleClient client = new MuleClient(muleContext);
                    for (int i = 0; i < count; i++)
                    {
                        client.send(url, payload, null);
                    }
                }
                catch (MuleException ex)
                {
                    fail(ExceptionUtils.getStackTrace(ex));
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.