Package org.mule.api

Examples of org.mule.api.MuleSession


    public static MuleEvent getTestEvent(Object data,
                                         FlowConstruct flowConstruct,
                                         InboundEndpoint endpoint,
                                         MuleContext context) throws Exception
    {
        final MuleSession session = getTestSession(flowConstruct, context);

        final MuleMessageFactory factory = endpoint.getConnector().createMuleMessageFactory();
        final MuleMessage message = factory.create(data, endpoint.getEncoding(), context);

        return new DefaultMuleEvent(message, endpoint, flowConstruct, session);
View Full Code Here


    @Test
    public void testRoundRobin() throws Exception
    {
        RoundRobin rr = new RoundRobin();
        MuleSession session = getTestSession(null, muleContext);
        List<TestProcessor> routes = new ArrayList<TestProcessor>(NUMBER_OF_ROUTES);
        for (int i = 0; i < NUMBER_OF_ROUTES; i++)
        {
            routes.add(new TestProcessor());
        }
View Full Code Here

    @Test
    public void testIdempotentReceiver() throws Exception
    {
        Service service = getTestService();

        MuleSession session = mock(MuleSession.class);
        when(session.getFlowConstruct()).thenReturn(service);

        InboundEndpoint endpoint1 = getTestInboundEndpoint("Test1Provider", "test://Test1Provider?exchangePattern=one-way");

        IdempotentMessageFilter ir = new IdempotentMessageFilter();
        ir.setIdExpression("#[header:id]");
View Full Code Here

    }

    @Test
    public void testFirstSuccessful() throws Exception
    {
        MuleSession session = getTestSession(null, muleContext);

        FirstSuccessful fs = createFirstSuccessfulRouter(new TestProcessor("abc"),
            new TestProcessor("def"), new TestProcessor("ghi"));
        fs.initialise();
View Full Code Here

    @Test
    public void testMessageAggregator() throws Exception
    {
        Service testService = getTestService("test", Apple.class);
        MuleSession session = getTestSession(testService, muleContext);

        TestEventAggregator router = new TestEventAggregator(3);
        router.setMuleContext(muleContext);
        router.setFlowConstruct(testService);
        router.initialise();
View Full Code Here

        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());

        MuleSession session = mock(MuleSession.class);
        router.route(new OutboundRoutingTestEvent(message, session, muleContext));

        endpoints = new ArrayList<MessageProcessor>();
        endpoints.add(mockendpoint4);
        endpoints.add(mockendpoint5);
View Full Code Here

    @Test
    public void testCorrelationGroupSizePropertySet() throws Exception
    {
        Service testService = getTestService("test", Apple.class);
        MuleSession session = getTestSession(testService, muleContext);

        OutboundEndpoint endpoint = getTestOutboundEndpoint("Test1Endpoint",
            "test://endpoint?exchangePattern=request-response");
        ListMessageSplitter router = new ListMessageSplitter();
        router.setFilter(null);
View Full Code Here

        assertTrue(asyncSplitter.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());

        MuleSession session = mock(MuleSession.class);
        asyncSplitter.route(new OutboundRoutingTestEvent(message, session, muleContext));

        message = new DefaultMuleMessage(payload, muleContext);
        MuleEvent event = new OutboundRoutingTestEvent(message, null, muleContext);
View Full Code Here

    }

    @Test
    public void testRecipientListRouterAsync() throws Exception
    {
        MuleSession session = mock(MuleSession.class);

        OutboundEndpoint endpoint1 = getTestOutboundEndpoint("Test1Provider");
        assertNotNull(endpoint1);
        OutboundEndpoint mockendpoint1 = RouterTestUtils.createMockEndpoint(endpoint1);
View Full Code Here


    @Test
    public void testRecipientListRouterSync() throws Exception
    {
        MuleSession session = mock(MuleSession.class);

        OutboundEndpoint endpoint1 = getTestOutboundEndpoint("Test1Provider");
        assertNotNull(endpoint1);

        List<String> recipients = new ArrayList<String>();
View Full Code Here

TOP

Related Classes of org.mule.api.MuleSession

Copyright © 2018 www.massapicom. 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.