Package org.apache.examples.panorama.startup.impl

Examples of org.apache.examples.panorama.startup.impl.TaskExecutor


{

    @Service( id="Startup" )
    public Runnable getStartupService()
    {
        TaskExecutor executor = new TaskExecutor();
        executor.setTasks(configuration("tasks", List.class));
        // Some of the logic which is automatically provided by the builder factory
        // must be done manually
        ErrorLog errorLog = new ErrorLogImpl(new DefaultErrorHandler(), LogFactory.getLog(TaskExecutor.class));
        executor.setErrorLog(errorLog);
        executor.setMessages(new MessageFormatter(PanoramaStartupModule.class, "panorama"));
        executor.setLog(LogFactory.getLog(TaskExecutor.class));
       
        return executor;
    }
View Full Code Here


        tasks.add(t2);

        MockControl logControl = newControl(Log.class);
        Log log = (Log) logControl.getMock();

        TaskExecutor e = new TaskExecutor();

        ErrorLog errorLog = (ErrorLog) newMock(ErrorLog.class);

        e.setErrorLog(errorLog);
        e.setLog(log);
        e.setMessages(getMessages());
        e.setTasks(tasks);

        // Note the ordering; explicitly set, to check that ordering does
        // take place.
        log.info("Executing task Fixture #2.");
        log.info("Executing task Fixture #1.");
        log.info("Executed 2 tasks \\(in \\d+ milliseconds\\)\\.");
        logControl.setMatcher(new RegexpMatcher());

        replayControls();

        e.run();

        assertListsEqual(new String[]
        { "f2", "f1" }, _tokens);

        verifyControls();
View Full Code Here

        log.info("Executed one task with one failure \\(in \\d+ milliseconds\\)\\.");
        logControl.setMatcher(new AggregateArgumentsMatcher(new RegexpMatcher()));

        replayControls();

        TaskExecutor e = new TaskExecutor();

        e.setErrorLog(errorLog);
        e.setLog(log);
        e.setMessages(getMessages());
        e.setTasks(tasks);

        e.run();

        verifyControls();
    }
View Full Code Here

TOP

Related Classes of org.apache.examples.panorama.startup.impl.TaskExecutor

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.