Class TestMethod

  • All Implemented Interfaces:
    ConsoleOutputReceiver

    class TestMethod
    extends java.lang.Object
    implements ConsoleOutputReceiver
    Represents the test-state of a single test method that is run.
    Notes about thread safety: This instance is serially confined to 1-3 threads (construction, test-run, reporting), without any actual parallel access
    • Field Detail

      • TEST_METHOD

        private static final java.lang.InheritableThreadLocal<TestMethod> TEST_METHOD
      • output

        private final java.util.concurrent.atomic.AtomicReference<LogicalStream> output
      • testSet

        private final TestSet testSet
      • startTime

        private final long startTime
      • endTime

        private volatile long endTime
      • testFailure

        private volatile ReportEntry testFailure
      • testIgnored

        private volatile ReportEntry testIgnored
      • testAssumption

        private volatile ReportEntry testAssumption
    • Method Detail

      • testFinished

        void testFinished()
      • testIgnored

        void testIgnored​(ReportEntry description)
      • testFailure

        void testFailure​(ReportEntry failure)
      • testAssumption

        void testAssumption​(ReportEntry failure)
      • setEndTime

        private void setEndTime()
      • getElapsed

        int getElapsed()
      • getStartTime

        long getStartTime()
      • getEndTime

        long getEndTime()
      • attachToThread

        void attachToThread()
      • detachFromCurrentThread

        void detachFromCurrentThread()
      • getThreadTestMethod

        static TestMethod getThreadTestMethod()
      • writeTestOutput

        public void writeTestOutput​(java.lang.String output,
                                    boolean newLine,
                                    boolean stdout)
        Description copied from interface: ConsoleOutputReceiver
        Forwards process output from the running test-case into the reporting system
        Specified by:
        writeTestOutput in interface ConsoleOutputReceiver
        Parameters:
        output - stdout/sterr output from running tests
        newLine - print on new line
        stdout - Indicates if this is stdout