Class ForkedBooter


  • public final class ForkedBooter
    extends java.lang.Object
    The part of the booter that is unique to a forked vm.
    Deals with deserialization of the booter wire-level protocol
    • Field Detail

      • DEFAULT_SYSTEM_EXIT_TIMEOUT_IN_SECONDS

        private static final long DEFAULT_SYSTEM_EXIT_TIMEOUT_IN_SECONDS
        See Also:
        Constant Field Values
      • PING_TIMEOUT_IN_SECONDS

        private static final long PING_TIMEOUT_IN_SECONDS
        See Also:
        Constant Field Values
      • LAST_DITCH_SHUTDOWN_THREAD

        private static final java.lang.String LAST_DITCH_SHUTDOWN_THREAD
        See Also:
        Constant Field Values
      • exitBarrier

        private final java.util.concurrent.Semaphore exitBarrier
      • systemExitTimeoutInSeconds

        private volatile long systemExitTimeoutInSeconds
      • jvmTerminator

        private java.util.concurrent.ScheduledThreadPoolExecutor jvmTerminator
      • testSet

        private java.lang.Object testSet
    • Constructor Detail

      • ForkedBooter

        public ForkedBooter()
    • Method Detail

      • setupBooter

        private void setupBooter​(java.lang.String tmpDir,
                                 java.lang.String dumpFileName,
                                 java.lang.String surefirePropsFileName,
                                 java.lang.String effectiveSystemPropertiesFileName)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • execute

        private void execute()
      • createTestSet

        private java.lang.Object createTestSet​(TypeEncodedValue forkedTestSet,
                                               boolean readTestsFromCommandReader,
                                               java.lang.ClassLoader cl)
      • cancelPingScheduler

        private void cancelPingScheduler()
      • createPingHandler

        private CommandListener createPingHandler​(java.util.concurrent.atomic.AtomicBoolean pingDone)
      • createPingJob

        private java.lang.Runnable createPingJob​(java.util.concurrent.atomic.AtomicBoolean pingDone,
                                                 PpidChecker pluginProcessChecker)
      • kill

        private void kill()
      • kill

        private void kill​(int returnCode)
      • exit1

        private void exit1()
      • acknowledgedExit

        private void acknowledgedExit()
      • getJvmTerminator

        private java.util.concurrent.ScheduledThreadPoolExecutor getJvmTerminator()
      • launchLastDitchDaemonShutdownThread

        private void launchLastDitchDaemonShutdownThread​(int returnCode)
      • main

        public static void main​(java.lang.String[] args)
        This method is invoked when Surefire is forked - this method parses and organizes the arguments passed to it and then calls the Surefire class' run method.
        The system exit code will be 1 if an exception is thrown.
        Parameters:
        args - Commandline arguments
      • run

        private static void run​(ForkedBooter booter,
                                java.lang.String[] args)
        created for testing purposes.
        Parameters:
        booter - booter in JVM
        args - arguments passed to JVM
      • canUseNewPingMechanism

        private static boolean canUseNewPingMechanism​(PpidChecker pluginProcessChecker)
      • acquireOnePermit

        private static void acquireOnePermit​(java.util.concurrent.Semaphore barrier,
                                             long timeoutMillis)
      • createPingScheduler

        private static java.util.concurrent.ScheduledExecutorService createPingScheduler()
      • createSurefirePropertiesIfFileExists

        private static java.io.InputStream createSurefirePropertiesIfFileExists​(java.lang.String tmpDir,
                                                                                java.lang.String propFileName)
                                                                         throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • isDebugging

        private static boolean isDebugging()
      • generateThreadDump

        private static java.lang.String generateThreadDump()
      • getProcessName

        private static java.lang.String getProcessName()