Class Scheduler

  • All Implemented Interfaces:
    org.junit.runners.model.RunnerScheduler

    public class Scheduler
    extends Object
    implements org.junit.runners.model.RunnerScheduler
    Schedules tests, controls thread resources, awaiting tests and other schedulers finished, and a master scheduler can shutdown slaves.
    The scheduler objects should be first created (and wired) and set in runners ParentRunner.setScheduler(org.junit.runners.model.RunnerScheduler).
    A new instance of scheduling strategy should be passed to the constructor of this scheduler.
    Since:
    2.16
    Author:
    Tibor Digana (tibor17)
    • Method Detail

      • logQuietly

        protected void logQuietly​(Throwable t)
      • logQuietly

        protected void logQuietly​(String msg)
      • describeStopped

        protected ShutdownResult describeStopped​(boolean stopNow)
        Attempts to stop all actively executing tasks and immediately returns a collection of descriptions of those tasks which have started prior to this call.
        This scheduler and other registered schedulers will stop, see register(Scheduler). If shutdownNow is set, waiting methods will be interrupted via Thread.interrupt().
        Parameters:
        stopNow - if true interrupts waiting test methods
        Returns:
        collection of descriptions started before shutting down
      • shutdownThreadPoolsAwaitingKilled

        protected boolean shutdownThreadPoolsAwaitingKilled()
      • beforeExecute

        protected void beforeExecute()
      • afterExecute

        protected void afterExecute()
      • schedule

        public void schedule​(Runnable childStatement)
        Specified by:
        schedule in interface org.junit.runners.model.RunnerScheduler
      • finished

        public void finished()
        Specified by:
        finished in interface org.junit.runners.model.RunnerScheduler