Class GUIRunner.TestCaseLister

  • All Implemented Interfaces:
    GUIRunner.Selector, java.util.EventListener, javax.swing.event.ListSelectionListener
    Enclosing class:
    GUIRunner

    static class GUIRunner.TestCaseLister
    extends java.lang.Object
    implements javax.swing.event.ListSelectionListener, GUIRunner.Selector
    Represents the list of testcases already failed shown in one of the tabs and a stackTraceLister which represents the stack trace box below the tabbed pane.
    • Constructor Detail

      • TestCaseLister

        TestCaseLister()
    • Method Detail

      • getFailList

        javax.swing.JList<TestCase> getFailList()
      • getStackTraceBox

        java.awt.Component getStackTraceBox()
      • initClassStructure

        void initClassStructure()
        Clears the failure list, its selection and the failure stack.
      • startTestRun

        void startTestRun()
      • noteReportResult

        void noteReportResult​(TestCase testCase)
        Notifies that the singular test testCase is finished.

        If the test failed, it should be in the failure list failureListMod. If so the element is added if not yet present.

        If testCase is selected then if testCase failed, the stack trace stackTraceLister is set to the stacktrace of the failure; otherwise the stacktrace is cleared.

        Parameters:
        testCase - The testcase comprising the result of the singular test finished.
      • addSelectedTestCaseByNeed

        void addSelectedTestCaseByNeed​(TestCase testCase)
        Adds testCase to the failure list if not yet listed. It is assumed that testCase failed and that it is selected in the GUIRunner.HierarchyWrapper.
        Parameters:
        testCase - a testcase which failed.
      • setSelection

        public void setSelection​(int index)
        Description copied from interface: GUIRunner.Selector
        Sets selection of indexth item and clears other selections.
        Specified by:
        setSelection in interface GUIRunner.Selector
        Parameters:
        index - a non-negative int value representing the index of a testcase. **** CAUTION: This presupposes that in a tree only the leaves can be selected.
      • valueChanged

        public void valueChanged​(javax.swing.event.ListSelectionEvent lse)
        Called whenever the value of the selection changes.

        CAUTION: From the documentation of ListSelectionEvent: queries from ListSelectionModel, rather from ListSelectionEvent.

        If an entry is selected, stackTraceLister is notified of the stacktrace of the throwable of the according testcase and selector is notified of the selection to trigger the according selection which in turn has further effects invoking GUIRunner.HierarchyWrapper.valueChanged(TreeSelectionEvent). Deselection causes stackTraceLister to clear the stacktrace and also affects selector like selection of the root.

        Specified by:
        valueChanged in interface javax.swing.event.ListSelectionListener