Examples of FunctionalTestComponent


Examples of org.mule.tck.functional.FunctionalTestComponent

    }

    @Override
    protected void doSetUp() throws Exception
    {
        FunctionalTestComponent comp = (FunctionalTestComponent)getComponent("feedConsumer");
        comp.setEventCallback(counter);
    }
View Full Code Here

Examples of org.mule.tck.functional.FunctionalTestComponent

        return "quartz-receive-dispatch.xml";
    }

    public void testMuleClientReceiveAndDispatchJob() throws Exception
    {
        FunctionalTestComponent component = getFunctionalTestComponent("scheduledService");
        assertNotNull(component);
        CountdownCallback count = new CountdownCallback(3);
        component.setEventCallback(count);

        MuleClient client = new MuleClient(muleContext);
        client.dispatch("vm://event.queue", "quartz test", null);
        client.dispatch("vm://event.queue", "quartz test", null);
        client.dispatch("vm://event.queue", "quartz test", null);
View Full Code Here

Examples of org.mule.tck.functional.FunctionalTestComponent

public class HttpPollingFunctionalTestCase extends DynamicPortTestCase
{

    public void testPollingHttpConnector() throws Exception
    {
        FunctionalTestComponent ftc = getFunctionalTestComponent("polled");
        assertNotNull(ftc);
        ftc.setEventCallback(new EventCallback(){
            public void eventReceived(MuleEventContext context, Object component) throws Exception
            {
                assertEquals("The Accept header should be set on the incoming message", "application/xml", context.getMessage().<String>getInboundProperty("Accept"));
            }
        });
View Full Code Here

Examples of org.mule.tck.functional.FunctionalTestComponent

        return "http-receiver-mule4456-config.xml";
    }

    public void testAsyncPost() throws Exception
    {
        FunctionalTestComponent component = getFunctionalTestComponent("AsyncService");
        component.setEventCallback(new EventCallback()
        {
            public void eventReceived(MuleEventContext context, Object comp) throws Exception
            {
                Thread.sleep(200);
                context.getMessageAsString();
View Full Code Here

Examples of org.mule.tck.functional.FunctionalTestComponent

        assertEquals(MESSAGE, message.getPayloadAsString());
    }

    public void testAsyncPostWithPersistentSedaQueue() throws Exception
    {
        FunctionalTestComponent component = getFunctionalTestComponent("AsyncPersistentQueueService");
        component.setEventCallback(new EventCallback()
        {
            public void eventReceived(MuleEventContext context, Object comp) throws Exception
            {
                Thread.sleep(200);
                context.getMessageAsString();
View Full Code Here

Examples of org.mule.tck.functional.FunctionalTestComponent

        return "http-functional-test.xml";
    }

    public void testSend() throws Exception
    {       
        FunctionalTestComponent testComponent = getFunctionalTestComponent("testComponent");
        assertNotNull(testComponent);

        if (checkPathProperties)
        {
            EventCallback callback = new EventCallback()
            {
                public void eventReceived(final MuleEventContext context, final Object component) throws Exception
                {
                    MuleMessage msg = context.getMessage();
                    assertEquals("/", msg.getInboundProperty(HttpConnector.HTTP_REQUEST_PROPERTY));
                    assertEquals("/", msg.getInboundProperty(HttpConnector.HTTP_REQUEST_PATH_PROPERTY));
                    assertEquals("/", msg.getInboundProperty(HttpConnector.HTTP_CONTEXT_PATH_PROPERTY));
                }
            };
       
            testComponent.setEventCallback(callback);
        }

        MuleClient client = new MuleClient(muleContext);
        Map<String, String> props = new HashMap<String, String>();
        props.put(HttpConstants.HEADER_CONTENT_TYPE, "text/plain;charset=UTF-8");
View Full Code Here

Examples of org.mule.tck.functional.FunctionalTestComponent

        Map properties = new HashMap();
        // properties.put("filename", "foo.bar");

        Object component = getComponent("testComponent");
        assertTrue("FunctionalTestComponent expected", component instanceof FunctionalTestComponent);
        FunctionalTestComponent ftc = (FunctionalTestComponent) component;
        assertNotNull(ftc);

        ftc.setEventCallback(callback);

        logger.debug("before dispatch");
        // Send an file to the SFTP server, which the inbound-endpoint then can pick
        // up
        client.dispatch(getAddressByEndpoint(client, INBOUND_ENDPOINT_NAME), TEST_MESSAGE, properties);
View Full Code Here

Examples of org.mule.tck.functional.FunctionalTestComponent

        GreenMailUtilities.storeEmail(userManager, email, DEFAULT_USER, DEFAULT_PASSWORD, message);
    }

    private void setupTestComponentListener() throws Exception
    {
        FunctionalTestComponent component = getFunctionalTestComponent("custom-flags");
        assertNotNull(component);

        component.setEventCallback(messageReceived);
    }
View Full Code Here

Examples of org.mule.tck.functional.FunctionalTestComponent

        return "org/mule/test/integration/routing/outbound/chaining-router-properties-propagation-config.xml";
    }

    public void testPropertiesPropagation() throws Exception
    {
        FunctionalTestComponent hop1 = getFunctionalTestComponent("hop1Service");
        FunctionalTestComponent hop2 = getFunctionalTestComponent("hop2Service");
        assertNotNull(hop1);

        final AtomicBoolean hop1made = new AtomicBoolean(false);
        EventCallback callback1 = new EventCallback()
        {
            public void eventReceived(final MuleEventContext context, final Object component) throws Exception
            {
                assertTrue(hop1made.compareAndSet(false, true));
                FunctionalTestComponent ftc = (FunctionalTestComponent) component;
                ftc.setReturnData("Hop1 ACK");
            }
        };

        final AtomicBoolean hop2made = new AtomicBoolean(false);
        EventCallback callback2 = new EventCallback()
        {
            public void eventReceived(final MuleEventContext context, final Object component) throws Exception
            {
                MuleMessage msg = context.getMessage();
                assertTrue(hop2made.compareAndSet(false, true));
                // this is a service callback, props are on the inbound
                assertEquals("Property not propagated from the first hop.", "hop1", msg.getInboundProperty("TICKET"));
                FunctionalTestComponent ftc = (FunctionalTestComponent) component;
                ftc.setReturnData(msg.getPayload() + " Hop2 ACK");
            }
        };

        hop1.setEventCallback(callback1);
        hop2.setEventCallback(callback2);
View Full Code Here

Examples of org.mule.tck.functional.FunctionalTestComponent

    private void setupTestServiceComponent(Latch receiveLatch) throws Exception
    {  
        Object testComponent = getComponent(RECEIVE_SERVICE_NAME);
        assertTrue(testComponent instanceof FunctionalTestComponent);
        FunctionalTestComponent component = (FunctionalTestComponent) testComponent;
       
        XmppCallback callback = new XmppCallback(receiveLatch, expectedXmppMessageType());
        component.setEventCallback(callback);
    }
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.