TestRunner
Keywords: junit.swingui.TestRunner class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## junit.swingui
Class TestRunner

    java.lang.Object
      junit.runner.BaseTestRunner
          junit.swingui.TestRunner

All Implemented Interfaces:
  TestListener, TestRunContext

    public class TestRunner

extends BaseTestRunner
implements TestRunContext

A Swing based user interface to run tests. Enter the name of a class which either provides a static suite method or is a subclass of TestCase.

     Synopsis: java junit.swingui.TestRunner [-noloading] [TestCase]

TestRunner takes as an optional argument the name of the testcase class to be run.

Field Summary
`protected javax.swing.JFrame` | `fFrame`

Fields inherited from class junit.runner.BaseTestRunner
`SUITE_METHODNAME`

Constructor Summary
`TestRunner()`

Method Summary
`protected void` | `aboutToStart(Test testSuite)`
`void` | `browseTestClasses()`
`protected void` | `clearStatus()` Clears the status message.
`protected java.awt.Component` | `createBrowseButton()`
`protected CounterPanel` | `createCounterPanel()`
`protected javax.swing.JPanel` | `createFailedPanel()`
`protected FailureDetailView` | `createFailureDetailView()`
`protected javax.swing.JFrame` | `createFrame()`
`protected javax.swing.JMenu` | `createJUnitMenu()` Creates the JUnit menu.
`protected javax.swing.JLabel` | `createLogo()`
`protected void` | `createMenus(javax.swing.JMenuBar mb)`
`protected javax.swing.JButton` | `createQuitButton()`
`protected javax.swing.JButton` | `createRunButton()`
`protected StatusLine` | `createStatusLine()`
`protected javax.swing.JComboBox` | `createSuiteCombo()`
`protected TestResult` | `createTestResult()`
`protected javax.swing.JTabbedPane` | `createTestRunViews()`
`protected javax.swing.JFrame` | `createUI(java.lang.String suiteName)`
`protected javax.swing.JCheckBox` | `createUseLoaderCheckBox()`
`javax.swing.ListModel` | `getFailures()` Returns the failure model
`static javax.swing.Icon` | `getIconResource(java.lang.Class clazz, java.lang.String name)`
`protected java.lang.String` | `getSuiteText()`
`void` | `handleTestSelected(Test test)` Handles the selection of a Test.
`void` | `insertUpdate(javax.swing.event.DocumentEvent event)`
`protected java.lang.Object` | `instanciateClass(java.lang.String fullClassName, java.lang.Object param)`
`static void` | `main(java.lang.String[] args)`
`void` | `removeUpdate(javax.swing.event.DocumentEvent event)`
`protected void` | `reset()`
`static void` | `run(java.lang.Class test)`
`protected void` | `runFailed(java.lang.String message)` Override to define how to handle a failed loading of a test suite.
`protected void` | `runFinished(Test testSuite)`
`void` | `runSuite()`
`protected void` | `runTest(Test testSuite)`
`void` | `setSuite(java.lang.String suiteName)`
`void` | `start(java.lang.String[] args)` Starts the TestRunner
`void` | `terminate()` Terminates the TestRunner
`void` | `testEnded(java.lang.String stringName)`
`void` | `testFailed(int status, Test test, java.lang.Throwable t)`
`void` | `testStarted(java.lang.String testName)`
`void` | `testViewChanged()`
`void` | `textChanged()`

Methods inherited from class junit.runner.BaseTestRunner
`addError, addFailure, elapsedTimeAsString, endTest, extractClassName, getFilteredTrace, getFilteredTrace, getLoader, getPreference, getPreference, getPreferences, getTest, inMac, inVAJava, loadSuiteClass, processArguments, savePreferences, setLoading, setPreference, setPreferences, showStackRaw, startTest, truncate, useReloadingTestSuiteLoader`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### fFrame

    protected javax.swing.JFrame fFrame

Constructor Detail

### TestRunner

    public TestRunner()

Method Detail

### main

    public static void main(java.lang.String[] args)

### run

    public static void run(java.lang.Class test)

### testFailed

    public void testFailed(int status,
                           Test test,
                           java.lang.Throwable t)

  Specified by:
    `testFailed` in class `BaseTestRunner`

### testStarted

    public void testStarted(java.lang.String testName)

  Specified by:
    `testStarted` in class `BaseTestRunner`

### testEnded

    public void testEnded(java.lang.String stringName)

  Specified by:
    `testEnded` in class `BaseTestRunner`

### setSuite

    public void setSuite(java.lang.String suiteName)

### aboutToStart

    protected void aboutToStart(Test testSuite)

### runFinished

    protected void runFinished(Test testSuite)

### createCounterPanel

    protected CounterPanel createCounterPanel()

### createFailedPanel

    protected javax.swing.JPanel createFailedPanel()

### createFailureDetailView

    protected FailureDetailView createFailureDetailView()

### createJUnitMenu

    protected javax.swing.JMenu createJUnitMenu()

  Creates the JUnit menu. Clients override this method to add additional menu items.

### createFrame

    protected javax.swing.JFrame createFrame()

### createLogo

    protected javax.swing.JLabel createLogo()

### createMenus

    protected void createMenus(javax.swing.JMenuBar mb)

### createUseLoaderCheckBox

    protected javax.swing.JCheckBox createUseLoaderCheckBox()

### createQuitButton

    protected javax.swing.JButton createQuitButton()

### createRunButton

    protected javax.swing.JButton createRunButton()

### createBrowseButton

    protected java.awt.Component createBrowseButton()

### createStatusLine

    protected StatusLine createStatusLine()

### createSuiteCombo

    protected javax.swing.JComboBox createSuiteCombo()

### createTestRunViews

    protected javax.swing.JTabbedPane createTestRunViews()

### testViewChanged

    public void testViewChanged()

### createTestResult

    protected TestResult createTestResult()

### createUI

    protected javax.swing.JFrame createUI(java.lang.String suiteName)

### getSuiteText

    protected java.lang.String getSuiteText()

### getFailures

    public javax.swing.ListModel getFailures()

  Description copied from interface: `TestRunContext`
  Returns the failure model

  Specified by:
    `getFailures` in interface `TestRunContext`

### insertUpdate

    public void insertUpdate(javax.swing.event.DocumentEvent event)

### instanciateClass

    protected java.lang.Object instanciateClass(java.lang.String fullClassName,
                                                java.lang.Object param)

### browseTestClasses

    public void browseTestClasses()

### removeUpdate

    public void removeUpdate(javax.swing.event.DocumentEvent event)

### reset

    protected void reset()

### runFailed

    protected void runFailed(java.lang.String message)

  Description copied from class: `BaseTestRunner`
  Override to define how to handle a failed loading of a test suite.

  Specified by:
    `runFailed` in class `BaseTestRunner`

### runSuite

    public void runSuite()

### runTest

    protected void runTest(Test testSuite)

### handleTestSelected

    public void handleTestSelected(Test test)

  Description copied from interface: `TestRunContext`
  Handles the selection of a Test.

  Specified by:
    `handleTestSelected` in interface `TestRunContext`

### start

    public void start(java.lang.String[] args)

  Starts the TestRunner

### terminate

    public void terminate()

  Terminates the TestRunner

### textChanged

    public void textChanged()

### clearStatus

    protected void clearStatus()

  Description copied from class: `BaseTestRunner`
  Clears the status message.

  Overrides:
    `clearStatus` in class `BaseTestRunner`

### getIconResource

    public static javax.swing.Icon getIconResource(java.lang.Class clazz,
                                                   java.lang.String name)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD