|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
ij2x.plugin.frame.InteractiveTestCase
public abstract class InteractiveTestCase
Base class for supporting inclusion of interactive tests into a JUnit test case. Note that the interactive tests are NOT executed by the JUnit framework and are not automated. They are typically used for visual inspection of features during development. It is convenient to include the interactive tests along with the automated JUnit tests since they may share resources and it keeps tests focused in a single place.
All interactive test methods should be prefixed with "interactive", e.g. interactiveTestTableSorting().
The test class's main
method should be used to control which
interactive tests should run. Use runInteractiveTests()
method
to run all interactive tests in the class.
Ultimately we need to investigate moving to a mechanism which can help automate interactive tests. JFCUnit is being investigated. In the meantime, this is quick and dirty and cheap.
Field Summary | |
---|---|
protected java.awt.Point |
frameLocation
|
protected boolean |
systemLF
|
Constructor Summary | |
---|---|
InteractiveTestCase()
|
|
InteractiveTestCase(java.lang.String testTitle)
|
Method Summary | |
---|---|
void |
addAction(org.jdesktop.swingx.JXFrame frame,
javax.swing.Action action)
|
void |
addComponentOrientationToggle(org.jdesktop.swingx.JXFrame frame)
Creates and adds a button toggling the frame's componentOrientation. |
void |
addMessage(org.jdesktop.swingx.JXFrame frame,
java.lang.String message)
|
void |
addSearchModeToggle(org.jdesktop.swingx.JXFrame frame)
Creates and adds a button toggling the frame's componentOrientation. |
void |
addStatusComponent(org.jdesktop.swingx.JXFrame frame,
javax.swing.JComponent component)
Adds the component to the statusbar of the frame. |
void |
addStatusMessage(org.jdesktop.swingx.JXFrame frame,
java.lang.String message)
|
protected void |
createAndAddMenus(javax.swing.JMenuBar bar,
javax.swing.JComponent component)
Creates menus and adds them to the given menu bar. |
protected javax.swing.JMenuBar |
createAndFillMenuBar(javax.swing.JComponent component)
Creates, fills and returns a JMenuBar. |
protected javax.swing.JMenu |
createPlafMenu()
Creates a menu filled with one SetPlafAction for each of the currently installed LFs. |
org.jdesktop.swingx.JXStatusBar |
getStatusBar(org.jdesktop.swingx.JXFrame frame)
Returns the JXFrame 's status bar. |
static boolean |
isCrossPlatformLF()
Returns whether the current lf is the cross-platform lf. |
static boolean |
isSystemLF()
Returns whether the current lf is the system lf. |
void |
runInteractiveTests()
Runs all test methods which are prefixed with "interactive". |
void |
runInteractiveTests(java.lang.String regexPattern)
Runs all tests whose method names match the specified regex pattern. |
static void |
setSystemLF(boolean system)
PENDING: JW - this is about toggling the LF, does nothing to update the UI. |
void |
show(org.jdesktop.swingx.JXFrame frame)
Packs and shows the frame. |
void |
show(org.jdesktop.swingx.JXFrame frame,
int width,
int height)
Packs, sizes and shows the frame. |
org.jdesktop.swingx.JXFrame |
showInFrame(javax.swing.JComponent component,
java.lang.String title)
Creates, shows and returns a JXFrame with the specified title, containing the component. |
org.jdesktop.swingx.JXFrame |
showInFrame(javax.swing.JComponent component,
java.lang.String title,
boolean showMenu)
Creates, shows and returns a JXFrame with the specified title, containing the component. |
org.jdesktop.swingx.JXFrame |
showWithScrollingInFrame(javax.swing.JComponent leftComp,
javax.swing.JComponent rightComp,
java.lang.String title)
Creates and returns a JXFrame with the specified title, containing two components individually wrapped into a JScrollPane. |
org.jdesktop.swingx.JXFrame |
showWithScrollingInFrame(javax.swing.JComponent component,
java.lang.String title)
Creates, shows and returns a JXFrame with the specified title, containing the component wrapped into a JScrollPane. |
org.jdesktop.swingx.JXFrame |
wrapInFrame(javax.swing.JComponent component,
java.lang.String title)
Creates and returns a JXFrame with the specified title, containing the component. |
org.jdesktop.swingx.JXFrame |
wrapInFrame(javax.swing.JComponent component,
java.lang.String title,
boolean showMenu)
|
org.jdesktop.swingx.JXFrame |
wrapWithScrollingInFrame(javax.swing.JComponent leftComp,
javax.swing.JComponent rightComp,
java.lang.String title)
Creates and returns a JXFrame with the specified title, containing two components individually wrapped into a JScrollPane. |
org.jdesktop.swingx.JXFrame |
wrapWithScrollingInFrame(javax.swing.JComponent component,
java.lang.String title)
Creates and returns a JXFrame with the specified title, containing the component wrapped into a JScrollPane. |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.awt.Point frameLocation
protected boolean systemLF
Constructor Detail |
---|
public InteractiveTestCase()
public InteractiveTestCase(java.lang.String testTitle)
Method Detail |
---|
public void runInteractiveTests(java.lang.String regexPattern) throws java.lang.Exception
regexPattern
- regular expression pattern used to match test method names
java.lang.Exception
public void runInteractiveTests() throws java.lang.Exception
java.lang.Exception
public org.jdesktop.swingx.JXFrame wrapWithScrollingInFrame(javax.swing.JComponent component, java.lang.String title)
component
- the JComponent to wraptitle
- the title to show in the frame
public org.jdesktop.swingx.JXFrame wrapWithScrollingInFrame(javax.swing.JComponent leftComp, javax.swing.JComponent rightComp, java.lang.String title)
leftComp
- the left JComponent to wraprightComp
- the right JComponent to wraptitle
- the title to show in the frame
public org.jdesktop.swingx.JXFrame wrapInFrame(javax.swing.JComponent component, java.lang.String title)
component
- the JComponent to wraptitle
- the title to show in the frame
public org.jdesktop.swingx.JXFrame showWithScrollingInFrame(javax.swing.JComponent component, java.lang.String title)
component
- the JComponent to wraptitle
- the title to show in the frame
wrapWithScrollingInFrame(JComponent, String)
public org.jdesktop.swingx.JXFrame showWithScrollingInFrame(javax.swing.JComponent leftComp, javax.swing.JComponent rightComp, java.lang.String title)
leftComp
- the left JComponent to wraprightComp
- the right JComponent to wraptitle
- the title to show in the frame
public org.jdesktop.swingx.JXFrame showInFrame(javax.swing.JComponent component, java.lang.String title)
component
- the JComponent to wraptitle
- the title to show in the frame
public org.jdesktop.swingx.JXFrame showInFrame(javax.swing.JComponent component, java.lang.String title, boolean showMenu)
component
- the JComponent to wraptitle
- the title to show in the frameshowMenu
- flag to indicate whether a JMenuBar should be added
public org.jdesktop.swingx.JXFrame wrapInFrame(javax.swing.JComponent component, java.lang.String title, boolean showMenu)
public void show(org.jdesktop.swingx.JXFrame frame)
frame
- public void show(org.jdesktop.swingx.JXFrame frame, int width, int height)
frame
- public void addAction(org.jdesktop.swingx.JXFrame frame, javax.swing.Action action)
public void addComponentOrientationToggle(org.jdesktop.swingx.JXFrame frame)
frame
- public void addSearchModeToggle(org.jdesktop.swingx.JXFrame frame)
frame
- public void addMessage(org.jdesktop.swingx.JXFrame frame, java.lang.String message)
public org.jdesktop.swingx.JXStatusBar getStatusBar(org.jdesktop.swingx.JXFrame frame)
JXFrame
's status bar. Lazily creates and
sets an instance if necessary.
frame
- the target frame
public void addStatusComponent(org.jdesktop.swingx.JXFrame frame, javax.swing.JComponent component)
frame
- component
- public void addStatusMessage(org.jdesktop.swingx.JXFrame frame, java.lang.String message)
frame
- string
- protected javax.swing.JMenuBar createAndFillMenuBar(javax.swing.JComponent component)
component
- the component that was added to the frame.
createAndAddMenus(javax.swing.JMenuBar, javax.swing.JComponent)
protected void createAndAddMenus(javax.swing.JMenuBar bar, javax.swing.JComponent component)
This implementation adds a menu to choose the LF.
bar
- the menubar to fillcomponent
- the component that was added to the frame.protected javax.swing.JMenu createPlafMenu()
public static void setSystemLF(boolean system)
system
- public static boolean isSystemLF()
public static boolean isCrossPlatformLF()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |