Package org.mule.tck

Examples of org.mule.tck.TriggerableMessageSource


        return new SensingNullMessageProcessor();
    }

    public TriggerableMessageSource getTriggerableMessageSource(MessageProcessor listener)
    {
        return new TriggerableMessageSource(listener);
    }
View Full Code Here


        return new TriggerableMessageSource(listener);
    }

    public TriggerableMessageSource getTriggerableMessageSource()
    {
        return new TriggerableMessageSource();
    }
View Full Code Here

    }

    @Test
    public void requestResponse() throws MuleException
    {
        TriggerableMessageSource source = new TriggerableMessageSource();
        pipeline.setMessageSource(source);
        pipeline.initialise();

        event = new DefaultMuleEvent(new DefaultMuleMessage("request", muleContext),
            MessageExchangePattern.REQUEST_RESPONSE, pipeline);

        source.trigger(event);

        verify(notificationManager, times(1)).fireNotification(
            argThat(new PipelineMessageNotificiationArgumentMatcher(
                PipelineMessageNotification.PROCESS_START, false, event)));
        verify(notificationManager, times(1)).fireNotification(
View Full Code Here

    }

    @Test
    public void oneWay() throws MuleException, InterruptedException
    {
        TriggerableMessageSource source = new TriggerableMessageSource();
        pipeline.setMessageSource(source);
        pipeline.initialise();

        event = new DefaultMuleEvent(new DefaultMuleMessage("request", muleContext),
            MessageExchangePattern.ONE_WAY, pipeline);

        source.trigger(event);
        pipeline.latch.await(AbstractMuleContextTestCase.RECEIVE_TIMEOUT, TimeUnit.MILLISECONDS);

        verify(notificationManager, times(1)).fireNotification(
            argThat(new PipelineMessageNotificiationArgumentMatcher(
                PipelineMessageNotification.PROCESS_START, false, event)));
View Full Code Here

    }

    @Test
    public void requestResponseRequestException() throws MuleException, InterruptedException
    {
        TriggerableMessageSource source = new TriggerableMessageSource();
        pipeline.setMessageSource(source);
        pipeline.setExceptionListener(new DefaultMessagingExceptionStrategy());
        List<MessageProcessor> processors = new ArrayList<MessageProcessor>();
        processors.add(new MessageProcessor()
        {
            @Override
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                throw new RuntimeException("error");
            }
        });
        pipeline.setMessageProcessors(processors);
        pipeline.initialise();

        event = new DefaultMuleEvent(new DefaultMuleMessage("request", muleContext),
            MessageExchangePattern.REQUEST_RESPONSE, pipeline);

        try
        {
            source.trigger(event);
        }
        catch (Exception e)
        {
        }
View Full Code Here

    }

    @Test
    public void requestResponseResponseException() throws MuleException, InterruptedException
    {
        TriggerableMessageSource source = new TriggerableMessageSource();
        pipeline.setMessageSource(source);
        pipeline.setExceptionListener(new DefaultMessagingExceptionStrategy());
        List<MessageProcessor> processors = new ArrayList<MessageProcessor>();
        processors.add(new AbstractInterceptingMessageProcessor()
        {
            @Override
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                processNext(event);
                throw new RuntimeException("error");
            }
        });
        pipeline.setMessageProcessors(processors);
        pipeline.initialise();

        event = new DefaultMuleEvent(new DefaultMuleMessage("request", muleContext),
            MessageExchangePattern.REQUEST_RESPONSE, pipeline);

        try
        {
            source.trigger(event);
        }
        catch (Exception e)
        {
        }
        verify(notificationManager, times(1)).fireNotification(
View Full Code Here

    }

    @Test
    public void oneWayRequestException() throws MuleException, InterruptedException
    {
        TriggerableMessageSource source = new TriggerableMessageSource();
        pipeline.setMessageSource(source);
        pipeline.setExceptionListener(new DefaultMessagingExceptionStrategy());
        List<MessageProcessor> processors = new ArrayList<MessageProcessor>();
        processors.add(new MessageProcessor()
        {
            @Override
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                throw new RuntimeException("error");
            }
        });
        pipeline.setMessageProcessors(processors);
        pipeline.initialise();

        event = new DefaultMuleEvent(new DefaultMuleMessage("request", muleContext),
            MessageExchangePattern.ONE_WAY, pipeline);

        try
        {
            source.trigger(event);
        }
        catch (Exception e)
        {
        }
        verify(notificationManager, times(1)).fireNotification(
View Full Code Here

    }

    @Test
    public void oneWayAsyncRequestException() throws MuleException, InterruptedException
    {
        TriggerableMessageSource source = new TriggerableMessageSource();
        Flow pipeline = new Flow("test", muleContext);
        pipeline.setProcessingStrategy(new AsynchronousProcessingStrategy());
        final CountDownLatch latch = new CountDownLatch(1);
        pipeline.setMessageSource(source);
        pipeline.setExceptionListener(new DefaultMessagingExceptionStrategy());
        List<MessageProcessor> processors = new ArrayList<MessageProcessor>();
        processors.add(new MessageProcessor()
        {
            @Override
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                latch.countDown();
                throw new RuntimeException("error");
            }
        });
        pipeline.setMessageProcessors(processors);
        pipeline.initialise();
        pipeline.start();

        event = new DefaultMuleEvent(new DefaultMuleMessage("request", muleContext),
            MessageExchangePattern.ONE_WAY, pipeline);

        source.trigger(event);
        latch.await(AbstractMuleContextTestCase.RECEIVE_TIMEOUT, TimeUnit.MILLISECONDS);
        Thread.sleep(2000);

        verify(notificationManager, times(1)).fireNotification(
            argThat(new PipelineMessageNotificiationArgumentMatcher(
View Full Code Here

        return new SensingNullMessageProcessor();
    }

    public TriggerableMessageSource getTriggerableMessageSource(MessageProcessor listener)
    {
        return new TriggerableMessageSource(listener);
    }
View Full Code Here

        return new TriggerableMessageSource(listener);
    }

    public TriggerableMessageSource getTriggerableMessageSource()
    {
        return new TriggerableMessageSource();
    }
View Full Code Here

TOP

Related Classes of org.mule.tck.TriggerableMessageSource

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.