Package org.mule.tck.listener

Examples of org.mule.tck.listener.FlowExecutionListener


    @Before
    public void setUp()
    {
        retrievedMessages = new HashSet<Object>();
        flowExecutionListener = new FlowExecutionListener("retrieveEmails", muleContext);
    }
View Full Code Here


    @Test
    public void testSynchProcessingStrategy() throws Exception
    {
        sendMessage("vm://testSynch");
        new FlowExecutionListener("synchFlow", muleContext).waitUntilFlowIsComplete();
        file = new File(FILE_PATH);
        String str = FileUtils.readFileToString(file);

        Assert.assertEquals("Part 1Part 2", str);
    }
View Full Code Here

    }

    @Test
    public void handleRejectedEventWithExceptionStrategy() throws Exception
    {
        FlowExecutionListener flowExecutionListener = new FlowExecutionListener("sedaFlowCrash", muleContext).setTimeoutInMillis(5000).setNumberOfExecutionsRequired(3);
        // Send 3 messages
        MuleClient client = muleContext.getClient();
        int nrMessages = 3;
        for (int i = 0; i < nrMessages; i++)
        {
            client.dispatch("vm://flow.in", "some data " + i, null);
        }
        flowExecutionListener.waitUntilFlowIsComplete();
        // Receive 2 messages
        for (int i = 0; i < 2; i++)
        {
            MuleMessage result = client.request("vm://flow.out", RECEIVE_TIMEOUT);
            assertNotNull(result);
View Full Code Here

    private void verifyAppProcessMessageWithAppClassLoader(FakeMuleServer fakeMuleServer, String appName, String requestUrl) throws MuleException
    {
        MuleContext applicationContext = fakeMuleServer.findApplication(appName).getMuleContext();
        final AtomicReference<ClassLoader> executionClassLoader = new AtomicReference<ClassLoader>();
        FlowExecutionListener flowExecutionListener = new FlowExecutionListener(applicationContext);
        flowExecutionListener.addListener(new Callback<MuleEvent>()
        {
            @Override
            public void execute(MuleEvent source)
            {
                executionClassLoader.set(Thread.currentThread().getContextClassLoader());
            }
        });
        applicationContext.getClient().send(String.format(requestUrl, dynamicPort.getNumber()), "test-data", null);
        flowExecutionListener.waitUntilFlowIsComplete();
        assertThat(executionClassLoader.get(), Is.is(applicationContext.getExecutionClassLoader()));
    }
View Full Code Here

    }

    @Test
    public void testNoException() throws Exception
    {
        FlowExecutionListener flowExecutionListener = new FlowExecutionListener("NoException", muleContext);
        createFileOnFtpServer("noException/test1");
        flowExecutionListener.waitUntilFlowIsComplete();
        prober.check(new Probe()
        {
            @Override
            public boolean isSatisfied()
            {
View Full Code Here

    }

    @Test
    public void testRouterException() throws Exception
    {
        FlowExecutionListener flowExecutionListener = new FlowExecutionListener("RouterException", muleContext);
        createFileOnFtpServer("routerException/test1");
        flowExecutionListener.waitUntilFlowIsComplete();
        prober.check(new Probe()
        {
            @Override
            public boolean isSatisfied()
            {
View Full Code Here

    }

    @Test
    public void testComponentException() throws Exception
    {
        FlowExecutionListener flowExecutionListener = new FlowExecutionListener("ComponentException", muleContext);
        createFileOnFtpServer("componentException/test1");
        flowExecutionListener.waitUntilFlowIsComplete();
        prober.check(new Probe()
        {
            @Override
            public boolean isSatisfied()
            {
View Full Code Here

    }

    @Test
    public void testCatchExceptionStrategyConsumesMessage() throws Exception
    {
        FlowExecutionListener flowExecutionListener = new FlowExecutionListener("CatchExceptionStrategy", muleContext);
        createFileOnFtpServer("exceptionHandled/test1");
        flowExecutionListener.waitUntilFlowIsComplete();
        prober.check(new Probe()
        {
            @Override
            public boolean isSatisfied()
            {
View Full Code Here

    }

    @Test
    public void testDefaultExceptionStrategyConsumesMessage() throws Exception
    {
        FlowExecutionListener flowExecutionListener = new FlowExecutionListener("DefaultExceptionStrategyCommit", muleContext);
        createFileOnFtpServer("commitOnException/test1");
        flowExecutionListener.waitUntilFlowIsComplete();
        prober.check(new Probe()
        {
            @Override
            public boolean isSatisfied()
            {
View Full Code Here

TOP

Related Classes of org.mule.tck.listener.FlowExecutionListener

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.