static class GUIRunner.TestCaseLister extends Object implements ListSelectionListener, GUIRunner.Selector
stackTraceLister
which represents the stack trace box below the tabbed pane.| Modifier and Type | Field and Description |
|---|---|
private DefaultListModel<TestCase> |
failureListMod
The list of testcases which are either ignored,
failed in some sense or with hurt assumption.
|
private ListSelectionModel |
failureSelection
The current selection of
failureListMod. |
private GUIRunner.Selector |
selector
Selector to be influenced:
If this is in the selected tab,
selector
is the tab with the GUIRunner.HierarchyWrapper;
otherwise it is GUIRunner.TabChangeListener.EMPTY_SELECTOR. |
private GUIRunner.StackTraceLister |
stackTraceLister
Contains the stack trace
if a failure in
failureListMod is selected
which caused an exception. |
| Constructor and Description |
|---|
TestCaseLister() |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
addSelectedTestCaseByNeed(TestCase testCase)
Adds
testCase to the failure list if not yet listed. |
void |
clearSelection()
Clears the selection.
|
(package private) JList<TestCase> |
getFailList() |
(package private) Component |
getStackTraceBox() |
(package private) void |
initClassStructure()
Clears the failure list, its selection and the failure stack.
|
(package private) void |
noteReportResult(TestCase testCase)
Notifies that the singular test
testCase is finished. |
void |
registerSelector(GUIRunner.Selector selector)
Acquaints this selector with another one
which is notified of the selection events
of this
Selector. |
void |
setSelection(int index)
Sets selection of
indexth item
and clears other selections. |
(package private) void |
startTestRun() |
void |
valueChanged(ListSelectionEvent lse)
Called whenever the value of the selection changes.
|
private final ListSelectionModel failureSelection
failureListMod.
At most one entry is selected.
If so, the according element in
GUIRunner.HierarchyWrapper.treeSelection is selected also.valueChanged(ListSelectionEvent)private final DefaultListModel<TestCase> failureListMod
private final GUIRunner.StackTraceLister stackTraceLister
failureListMod is selected
which caused an exception.
This is true if an assertion was wrong, an assumption was wron
or if the execution of a testcase could not be completed
due to an exception.private GUIRunner.Selector selector
selector
is the tab with the GUIRunner.HierarchyWrapper;
otherwise it is GUIRunner.TabChangeListener.EMPTY_SELECTOR.
Set by registerSelector(GUIRunner.Selector).Component getStackTraceBox()
void initClassStructure()
void startTestRun()
void noteReportResult(TestCase testCase)
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.
testCase - The testcase comprising the result of the singular test finished.void addSelectedTestCaseByNeed(TestCase testCase)
testCase to the failure list if not yet listed.
It is assumed that testCase failed
and that it is selected in the GUIRunner.HierarchyWrapper.testCase - a testcase which failed.public void setSelection(int index)
GUIRunner.Selectorindexth item
and clears other selections.setSelection in interface GUIRunner.Selectorindex - a non-negative int value
representing the index of a testcase.
**** CAUTION: This presupposes that in a tree
only the leaves can be selected.public void clearSelection()
GUIRunner.SelectorclearSelection in interface GUIRunner.Selectorpublic void registerSelector(GUIRunner.Selector selector)
GUIRunner.SelectorSelector.
The one in the foreground is notified directly by a mouse event,
whereas the one in the background is selected via registration.
The one in the background in turn
notifies the empty selector
GUIRunner.TabChangeListener.EMPTY_SELECTOR
which takes no actions.registerSelector in interface GUIRunner.Selectorselector - another Selector.GUIRunner.TabChangeListener.setSelUnSel(int)public void valueChanged(ListSelectionEvent lse)
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.
valueChanged in interface ListSelectionListenerCopyright © 2012–2018 Simuline Organization (l2r). All rights reserved.