Package randoop.util

Class ProgressDisplay

  • All Implemented Interfaces:
    Runnable

    public class ProgressDisplay
    extends Thread
    Modified from Daikon.FileIOProgress.
    • Field Detail

      • print_synchro

        public static final Object print_synchro
        Global lock to prevent interleaving of progress display messages.
      • exit_if_no_steps_after_milliseconds

        private static int exit_if_no_steps_after_milliseconds
        Give up after this many milliseconds, if the generator has not taken a step. That is, if it has not attempted to generate a new test sequence.
      • shouldStop

        public boolean shouldStop
        Clients should set this variable instead of calling Thread.stop(), which is deprecated. Typically a client calls "display()" before setting this.
      • lastStepTime

        private long lastStepTime
        When the most recent step completed.
      • lastNumSteps

        private long lastNumSteps
        The step number of the most recent step.
    • Constructor Detail

      • ProgressDisplay

        public ProgressDisplay​(AbstractGenerator generator,
                               ProgressDisplay.Mode outputMode)
        Creates a new ProgressDisplay.
        Parameters:
        generator - the test generator
        outputMode - the output mode
    • Method Detail

      • message

        public String message​(boolean withTime)
        Return the progress message.
        Parameters:
        withTime - whether to include time and memory usage
        Returns:
        the progress message
      • run

        public void run()
        Specified by:
        run in interface Runnable
        Overrides:
        run in class Thread
      • exitDueToNoSteps

        private void exitDueToNoSteps()
        Exit due to too much time without taking a step.
      • printAllStackTraces

        private void printAllStackTraces()
      • updateLastStepTime

        private void updateLastStepTime()
        Set lastStepTime to when the most recent step completed.
      • noProgressOutput

        private boolean noProgressOutput()
        Return true iff no progress output should be displayed.
        Returns:
        true iff no progress output should be displayed
      • clear

        public void clear()
        Clear the display; good to do before printing to System.out.
      • display

        public void display​(boolean withTime)
        Displays the current status. Call this if you don't want to wait until the next automatic display.
        Parameters:
        withTime - whether to print time and memory usage
      • display

        private void display​(String message)
        Displays the given message.
        Parameters:
        message - the message to display