|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.utep.cs.et.gui.tester.DefaultTester
public class DefaultTester
The default tester class responsible for generating test cases
dynamically and displaying them. This class implements both the
view and the controller, and the view can be obtained by calling
the getView() method. The test cases are generated by
calling an external test case generation tool.
| Nested Class Summary | |
|---|---|
private static class |
DefaultTester.StatisticsDialog
A dialog window to display test case generation statistics. |
private static class |
DefaultTester.TestCaseCellRenderer
A cell renderer to render test cases displayed in the testcase subpane. |
private static class |
DefaultTester.TestCaseList
A special JList to contain test cases. |
private class |
DefaultTester.TesterView
Tester pane with multiple subpanes that can be dynamically configured on-the-fly. |
| Field Summary | |
|---|---|
private List<ClassFileChangeListener> |
classFileChangeListeners
Registered class file change listeners. |
private Class |
clazz
Currently loaded class. |
private static int |
DIVIDER_SIZE
Divider size. |
private File |
file
The file from which the current class was loaded. |
private MethodTree |
methodTree
The tree model for the method pane to displays all the methods and constructors of the class under test. |
private JTextArea |
spec
The pane to display the specification of the currently selected method or constructor. |
private Statistics |
stat
The test statistics manager. |
private DefaultTester.StatisticsDialog |
statDialog
Dialog window showing test statistics. |
private JTextPane |
testcaseDescription
The pane to display the description of the currently selected test case. |
private OutputTextArea |
testcaseFailure
The pane to display the failure message, if exists, of the currently selected test case. |
private DefaultListModel |
testcases
The list of test cases of the currently selected method or constructor. |
private DefaultTester.TestCaseList |
testcasesList
The view to show the testcases. |
private DefaultTester.TesterView |
theView
The view of this test wizard. |
private List<JLabel> |
titleBars
The title bars of all subpanes. |
| Constructor Summary | |
|---|---|
DefaultTester()
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
addClassFileChangeListener(ClassFileChangeListener l)
Registers the given class file change listener. |
private void |
autoEnableAction(AbstractAction act)
Automatically enables and disables the given action based on the method selections. |
(package private) void |
classBeingOpened(EtClass clazz)
Called to refresh the view, as the given class is being loaded by the the method list pane. |
private JSplitPane |
createDescriptionPane()
Creates a description pane that displays a description of the currently selected test case. |
private JPanel |
createMethodPane()
Creates a method pane that displays all the methods and constructors of the class under test. |
private JPopupMenu |
createMethodPanePopupMenu()
Creates a popup menu for the method list pane. |
private JPanel |
createSpecPane()
Creates a specification pane that displays the specification of the currently selected method. |
protected TestCaseGenerationListener |
createTestCaseGenerationListener(EtMethod emeth)
Creates a test case generation listener for testing the given method. |
private JPanel |
createTestCasePane()
Creates a test case pane that lists all the test cases of the currently selected method. |
private JPopupMenu |
createTestCasesPanePopupMenu()
Creates a popup menu for the test cases pane. |
private JLabel |
createTitleBar(String title)
Creates a title bar of the given title string. |
private void |
doJUnitExport(Collection<EtMethod> methods)
Exports test cases of the methods correcponding to the given rows of the method tree pane. |
private void |
doJUnitExport(EtTestCase[] testcases)
Exports the given test cases. |
protected void |
doTest(Collection meths)
Tests all the methods contained in the given collecton. |
protected void |
doTest(EtMethod emeth)
Tests the given method. |
protected boolean |
enableStatDialog()
Returns true if the test statistics dialog has to be enabled. |
ExplorerComponent |
getExplorerView()
Returns the view to be added to the explorer pane. |
OptionPanel |
getOptionPanel()
Returns the option panel of this tester. |
private AbstractAction |
getPopExport()
Creates an action to export all the test cases of the currently selected methods and consturctors as a JUnit test. |
private AbstractAction |
getPopExportAll()
Creates an action to export all the test cases as a JUnit test. |
private AbstractAction |
getPopOpen()
Creates an action to load a class file for testing. |
protected AbstractAction |
getPopTest()
Creates an action to generate test cases for the currently selected method or constructor. |
protected AbstractAction |
getPopTestAll()
Creates an action to generate test cases for all the methods and constructors. |
protected AbstractAction |
getPopTestDeclared()
Creates an action to generate test cases for the declared methods. |
protected AbstractAction |
getPopTestInherited()
Creates an action to generate test cases for the inherited methods. |
private AbstractAction |
getTCPopExport()
Creates an action to export all currently selected test cases displayed in the test cases pane. |
private AbstractAction |
getTCPopExportAll()
Creates an action to export all the test cases displayed in the test cases pane. |
private AbstractAction |
getTCPopExportFailed()
Creates an action to export all the failed test cases displayed in the test cases pane. |
private AbstractAction |
getTCPopExportSuccessful()
Creates an action to export all the successful test cases displayed in the test cases pane. |
JComponent |
getView()
Returns the view of this tester. |
boolean |
loadFile(File file)
Loads the given class file for testing and returns true if the file was loaded successfuly. |
private static JScrollPane |
makeScrollable(JComponent comp)
Adds horizontal and vertical scroll bars to the given component. |
(package private) void |
methodSelected(EtMethod meth)
Called to refresh the view, as the given method has been selected from the method list pane. |
private void |
notifyFileLoaded(File file)
Notifies to the registered class file change listeners that the given class file was successfully loaded by this tester. |
void |
setCloseViewAction(AbstractAction action)
Given the action that closes this editor's view, provides an appropriate user interface for it, such as a popup menu. |
void |
setDropTarget(DropTarget dropTarget)
Associates a drop target with this tester so that its method names subpane accepts drops of class files. |
void |
setSourceCodeViewer(SourceCodeViewer viewer)
Sets the the source code viewer to locate and highlight the source code lines corresponding to the error messages obtained from the test case generation tool. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Class clazz
private File file
private MethodTree methodTree
private DefaultTester.TesterView theView
private Statistics stat
private List<JLabel> titleBars
private final JTextPane testcaseDescription
private final OutputTextArea testcaseFailure
private final JTextArea spec
private final DefaultListModel testcases
private DefaultTester.TestCaseList testcasesList
private final List<ClassFileChangeListener> classFileChangeListeners
private final DefaultTester.StatisticsDialog statDialog
private static final int DIVIDER_SIZE
| Constructor Detail |
|---|
public DefaultTester()
| Method Detail |
|---|
public JComponent getView()
JPanel.
getView in interface Testerpublic ExplorerComponent getExplorerView()
getExplorerView in interface Testerpublic OptionPanel getOptionPanel()
getOptionPanel in interface Testerpublic boolean loadFile(File file)
loadFile in interface Testerpublic void addClassFileChangeListener(ClassFileChangeListener l)
addClassFileChangeListener in interface Testerpublic void setSourceCodeViewer(SourceCodeViewer viewer)
setSourceCodeViewer in interface Testerpublic void setDropTarget(DropTarget dropTarget)
setDropTarget in interface Testerpublic void setCloseViewAction(AbstractAction action)
setCloseViewAction in interface Testerprotected TestCaseGenerationListener createTestCaseGenerationListener(EtMethod emeth)
void methodSelected(EtMethod meth)
void classBeingOpened(EtClass clazz)
private void notifyFileLoaded(File file)
private JPanel createMethodPane()
private JLabel createTitleBar(String title)
titleBars.
private JPanel createTestCasePane()
private JSplitPane createDescriptionPane()
private JPanel createSpecPane()
private static JScrollPane makeScrollable(JComponent comp)
private JPopupMenu createMethodPanePopupMenu()
private JPopupMenu createTestCasesPanePopupMenu()
private AbstractAction getPopExport()
private AbstractAction getPopExportAll()
private AbstractAction getTCPopExport()
private AbstractAction getTCPopExportFailed()
private AbstractAction getTCPopExportSuccessful()
private AbstractAction getTCPopExportAll()
private AbstractAction getPopOpen()
protected AbstractAction getPopTest()
protected AbstractAction getPopTestInherited()
protected AbstractAction getPopTestDeclared()
protected AbstractAction getPopTestAll()
protected void doTest(Collection meths)
protected void doTest(EtMethod emeth)
protected boolean enableStatDialog()
private void doJUnitExport(Collection<EtMethod> methods)
private void doJUnitExport(EtTestCase[] testcases)
private void autoEnableAction(AbstractAction act)
|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||