Class ForkClient

  • All Implemented Interfaces:
    EventHandler<Event>

    public final class ForkClient
    extends java.lang.Object
    implements EventHandler<Event>
    Knows how to reconstruct *all* the state transmitted over stdout by the forked process.
    • Method Detail

      • kill

        public void kill()
      • tryToTimeout

        public void tryToTimeout​(long currentTimeMillis,
                                 int forkedProcessTimeoutInSeconds)
        Called in concurrent Thread. Will shutdown if timeout was reached.
        Parameters:
        currentTimeMillis - current time in millis seconds
        forkedProcessTimeoutInSeconds - timeout in seconds given by MOJO
      • setCurrentStartTime

        private void setCurrentStartTime()
      • hadTimeout

        public boolean hadTimeout()
      • dumpToLoFile

        void dumpToLoFile​(java.lang.String msg)
      • writeTestOutput

        private void writeTestOutput​(java.lang.String output,
                                     boolean isStdout,
                                     boolean newLine,
                                     RunMode runMode,
                                     java.lang.Long testRunId)
      • getTestVmSystemProperties

        public java.util.Map<java.lang.String,​java.lang.String> getTestVmSystemProperties()
      • getReporter

        public RunListener getReporter()
        Used when getting reporters on the plugin side of a fork. Used by testing purposes only. May not be volatile variable.
        Returns:
        A mock provider reporter
      • getOrCreateConsoleLogger

        private ConsoleLogger getOrCreateConsoleLogger()
      • close

        public void close​(boolean hadTimeout)
      • isSaidGoodBye

        public boolean isSaidGoodBye()
      • isErrorInFork

        public boolean isErrorInFork()
      • testsInProgress

        public java.util.Set<java.lang.String> testsInProgress()
      • hasTestsInProgress

        public boolean hasTestsInProgress()