Class ParallelComputer

  • Direct Known Subclasses:
    ParallelComputerBuilder.PC

    public abstract class ParallelComputer
    extends org.junit.runner.Computer
    ParallelComputer extends JUnit Computer and has a shutdown functionality.
    Since:
    2.16
    See Also:
    ParallelComputerBuilder
    • Field Detail

      • DAEMON_THREAD_FACTORY

        private static final java.util.concurrent.ThreadFactory DAEMON_THREAD_FACTORY
      • forcedShutdownStatus

        private final ShutdownStatus forcedShutdownStatus
      • timeoutNanos

        private final long timeoutNanos
      • timeoutForcedNanos

        private final long timeoutForcedNanos
      • shutdownScheduler

        private java.util.concurrent.ScheduledExecutorService shutdownScheduler
    • Constructor Detail

      • ParallelComputer

        public ParallelComputer​(double timeoutInSeconds,
                                double timeoutForcedInSeconds)
    • Method Detail

      • describeStopped

        protected abstract ShutdownResult describeStopped​(boolean shutdownNow)
      • shutdownThreadPoolsAwaitingKilled

        protected abstract boolean shutdownThreadPoolsAwaitingKilled()
      • beforeRunQuietly

        protected final void beforeRunQuietly()
      • afterRunQuietly

        protected final boolean afterRunQuietly()
      • scheduleShutdown

        private java.util.concurrent.Future<ShutdownResult> scheduleShutdown()
      • scheduleForcedShutdown

        private java.util.concurrent.Future<ShutdownResult> scheduleForcedShutdown()
      • getShutdownScheduler

        private java.util.concurrent.ScheduledExecutorService getShutdownScheduler()
      • createShutdownTask

        private java.util.concurrent.Callable<ShutdownResult> createShutdownTask()
      • createForcedShutdownTask

        private java.util.concurrent.Callable<ShutdownResult> createForcedShutdownTask()
      • nanosToSeconds

        private double nanosToSeconds​(long nanos)
      • hasTimeout

        private boolean hasTimeout()
      • hasTimeoutForced

        private boolean hasTimeoutForced()
      • secondsToNanos

        private static long secondsToNanos​(double seconds)
      • minTimeout

        private static long minTimeout​(long timeout1,
                                       long timeout2)
      • printShutdownHook

        private static void printShutdownHook​(java.util.Collection<java.lang.String> executedTests,
                                              java.util.Collection<java.lang.String> incompleteTests,
                                              java.util.concurrent.Future<ShutdownResult> testsBeforeShutdown)
                                       throws java.util.concurrent.ExecutionException,
                                              java.lang.InterruptedException
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException