Examples of FlowExecutionListener


Examples of org.mule.tck.listener.FlowExecutionListener

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

Examples of org.mule.tck.listener.FlowExecutionListener

    @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

Examples of org.mule.tck.listener.FlowExecutionListener

    }

    @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

Examples of org.mule.tck.listener.FlowExecutionListener

    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

Examples of org.mule.tck.listener.FlowExecutionListener

    }

    @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

Examples of org.mule.tck.listener.FlowExecutionListener

    }

    @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

Examples of org.mule.tck.listener.FlowExecutionListener

    }

    @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

Examples of org.mule.tck.listener.FlowExecutionListener

    }

    @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

Examples of org.mule.tck.listener.FlowExecutionListener

    }

    @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

Examples of org.springframework.webflow.execution.FlowExecutionListener

  public void testFlowStateExceptionHandlingTransition() {
    new EndState(flow, "end");
    TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler();
    handler.add(TestException.class, "end");
    flow.getExceptionHandlerSet().add(handler);
    FlowExecutionListener listener = new FlowExecutionListenerAdapter() {
      public void sessionEnding(RequestContext context, FlowSession session, MutableAttributeMap output) {
        assertTrue(context.getFlashScope().contains("flowExecutionException"));
        assertTrue(context.getFlashScope().contains("rootCauseException"));
        assertTrue(context.getFlashScope().get("rootCauseException") instanceof TestException);
      }
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.