Package org.mule.api.endpoint

Examples of org.mule.api.endpoint.OutboundEndpoint.process()


        OutboundEndpoint endpoint = createOutboundEndpoint(null, new TestSecurityFilter(false), null, null, MessageExchangePattern.REQUEST_RESPONSE, null);
        testOutboundEvent = createTestOutboundEvent();

        try
        {
            endpoint.process(testOutboundEvent);
            fail("Exception expected");
        }
        catch (TestSecurityFilter.StaticMessageUnauthorisedException e)
        {
            testOutboundEvent.getFlowConstruct().getExceptionListener().handleException(e, testOutboundEvent);
View Full Code Here


        muleContext.registerListener(listener);

        OutboundEndpoint endpoint = createOutboundEndpoint(null, null, null, null, MessageExchangePattern.REQUEST_RESPONSE, null);
        MuleEvent outboundEvent = createTestOutboundEvent();

        endpoint.process(outboundEvent);

        assertEventSent();
        assertTrue(listener.latch.await(RECEIVE_TIMEOUT, TimeUnit.MILLISECONDS));
        assertEquals(2, listener.messageNotificationList.size());
        assertEquals(EndpointMessageNotification.MESSAGE_SEND_BEGIN, listener.messageNotificationList.get(0).getAction());
View Full Code Here

        muleContext.registerListener(listener);

        OutboundEndpoint endpoint = createOutboundEndpoint(null, null, null, null, MessageExchangePattern.ONE_WAY, null);
        MuleEvent outboundEvent = createTestOutboundEvent();

        endpoint.process(outboundEvent);

        assertEventDispatched();
        assertTrue(listener.latch.await(RECEIVE_TIMEOUT, TimeUnit.MILLISECONDS));
        assertEquals(2, listener.messageNotificationList.size());
        assertEquals(EndpointMessageNotification.MESSAGE_DISPATCH_BEGIN, listener.messageNotificationList.get(0).getAction());
View Full Code Here

        OutboundEndpoint endpoint = createOutboundEndpoint(null, null, new OutboundAppendTransformer(),
                                                           new ResponseAppendTransformer(), MessageExchangePattern.REQUEST_RESPONSE, null);

        testOutboundEvent = createTestOutboundEvent();

        MuleEvent result = endpoint.process(testOutboundEvent);

        assertNotNull(result);
        assertEquals(TEST_MESSAGE + OutboundAppendTransformer.APPEND_STRING, MyMessageDispatcherFactory.dispatcher.sensedSendEvent.getMessageAsString());
        assertEquals(RESPONSE_MESSAGE + ResponseAppendTransformer.APPEND_STRING, result.getMessageAsString());
    }
View Full Code Here

        OutboundEndpoint endpoint = createOutboundEndpoint(null, null, null, null, MessageExchangePattern.REQUEST_RESPONSE, null);

        testOutboundEvent = createTestOutboundEvent();
        testOutboundEvent.getMessage().setOutboundProperty(MuleProperties.MULE_EVENT_TIMEOUT_PROPERTY, testTimeout);

        MuleEvent response = endpoint.process(testOutboundEvent);

        assertEquals(testTimeout, response.getTimeout());
    }

    @Test
View Full Code Here

                if (stats.isEnabled())
                {
                    stats.incSentReplyToEvent();
                }
            }
            endpoint.process(replyToEvent);
            if (logger.isInfoEnabled())
            {
                logger.info("reply to sent: " + endpoint);
            }
        }
View Full Code Here

        message = new DefaultMuleMessage("test event", muleContext);

        MuleEvent event = new OutboundRoutingTestEvent(message, session, muleContext);

        when(mep1.process(any(MuleEvent.class))).thenAnswer(new MuleEventCheckAnswer(event));
        when(mep2.process(any(MuleEvent.class))).thenAnswer(new MuleEventCheckAnswer());

        final MuleEvent result = router.route(new OutboundRoutingTestEvent(message, session, muleContext));
        assertNull("Async call shouldn't return any result.", result);
    }
View Full Code Here

        MuleMessage message = new DefaultMuleMessage(MESSAGE, muleContext);
        message.setOutboundProperty(MailProperties.TO_ADDRESSES_PROPERTY, EMAIL);
        MuleSession session = getTestSession(null, muleContext);
        DefaultMuleEvent event = new DefaultMuleEvent(message, MessageExchangePattern.ONE_WAY,
            getTestService("apple", Apple.class), session, new ResponseOutputStream(System.out));
        endpoint.process(event);

        getServers().waitForIncomingEmail(AbstractEmailFunctionalTestCase.DELIVERY_DELAY_MS, 1);
        MimeMessage[] messages = getServers().getReceivedMessages();
        assertNotNull("did not receive any messages", messages);
        assertEquals("did not receive 1 mail", 1, messages.length);
View Full Code Here

        MuleMessage message = new DefaultMuleMessage(payload, muleContext);
        assertTrue(router.isMatch(message));

        when(mockendpoint1.process(any(MuleEvent.class))).thenAnswer(new MuleEventCheckAnswer());
        when(mockendpoint2.process(any(MuleEvent.class))).thenAnswer(new MuleEventCheckAnswer());
        when(mockendpoint3.process(any(MuleEvent.class))).thenAnswer(new MuleEventCheckAnswer());
        router.route(new OutboundRoutingTestEvent(message, session, muleContext));
    }

    @Test
    public void testMessageSplitterRouterRequestResponse() throws Exception
View Full Code Here

            if (sendTransformed && endpoint.getTransformers() != null)
            {
                event.getMessage().applyTransformers(event, endpoint.getTransformers());
            }

            MuleEvent result = endpoint.process(event);
            if (statistics != null && statistics.isEnabled())
            {
                statistics.incrementRoutedMessage(getEndpoint());
            }
            return result;
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.