Package 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

Fields
Modifier and Type
Field
Description
`protected JFrame`
`fFrame`

### Fields inherited from class junit.runner.BaseTestRunner

`SUITE_METHODNAME`

## Constructor Summary

Constructors
Constructor
Description
`TestRunner()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`aboutToStart(Test testSuite)`
`void`
`browseTestClasses()`
`protected void`
`clearStatus()`
Clears the status message.
`protected Component`
`createBrowseButton()`
`protected CounterPanel`
`createCounterPanel()`
`protected JPanel`
`createFailedPanel()`
`protected FailureDetailView`
`createFailureDetailView()`
`protected JFrame`
`createFrame()`
`protected JMenu`
`createJUnitMenu()`
Creates the JUnit menu.
`protected JLabel`
`createLogo()`
`protected void`
`createMenus(JMenuBar mb)`
`protected JButton`
`createQuitButton()`
`protected JButton`
`createRunButton()`
`protected StatusLine`
`createStatusLine()`
`protected JComboBox`
`createSuiteCombo()`
`protected TestResult`
`createTestResult()`
`protected JTabbedPane`
`createTestRunViews()`
`protected JFrame`
`createUI(String suiteName)`
`protected JCheckBox`
`createUseLoaderCheckBox()`
`ListModel`
`getFailures()`
Returns the failure model
`static Icon`
`getIconResource(Class clazz, String name)`
`protected String`
`getSuiteText()`
`void`
`handleTestSelected(Test test)`
Handles the selection of a Test.
`void`
`insertUpdate(DocumentEvent event)`
`protected Object`
`instanciateClass(String fullClassName, Object param)`
`static void`
`main(String[] args)`
`void`
`removeUpdate(DocumentEvent event)`
`protected void`
`reset()`
`static void`
`run(Class test)`
`protected void`
`runFailed(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(String suiteName)`
`void`
`start(String[] args)`
Starts the TestRunner
`void`
`terminate()`
Terminates the TestRunner
`void`
`testEnded(String stringName)`
`void`
`testFailed(int status, Test test, Throwable t)`
`void`
`testStarted(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 Details

### fFrame

protected JFrame fFrame

## Constructor Details

### TestRunner

public TestRunner()

## Method Details

### main

public static void main(String[] args)

### run

public static void run(Class test)

### testFailed

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

Specified by:
  `testFailed` in class `BaseTestRunner`

### testStarted

public void testStarted(String testName)

Specified by:
  `testStarted` in class `BaseTestRunner`

### testEnded

public void testEnded(String stringName)

Specified by:
  `testEnded` in class `BaseTestRunner`

### setSuite

public void setSuite(String suiteName)

### aboutToStart

protected void aboutToStart(Test testSuite)

### runFinished

protected void runFinished(Test testSuite)

### createCounterPanel

protected CounterPanel createCounterPanel()

### createFailedPanel

protected JPanel createFailedPanel()

### createFailureDetailView

protected FailureDetailView createFailureDetailView()

### createJUnitMenu

protected JMenu createJUnitMenu()
Creates the JUnit menu. Clients override this method to add additional menu items.

### createFrame

protected JFrame createFrame()

### createLogo

protected JLabel createLogo()

### createMenus

protected void createMenus(JMenuBar mb)

### createUseLoaderCheckBox

protected JCheckBox createUseLoaderCheckBox()

### createQuitButton

protected JButton createQuitButton()

### createRunButton

protected JButton createRunButton()

### createBrowseButton

protected Component createBrowseButton()

### createStatusLine

protected StatusLine createStatusLine()

### createSuiteCombo

protected JComboBox createSuiteCombo()

### createTestRunViews

protected JTabbedPane createTestRunViews()

### testViewChanged

public void testViewChanged()

### createTestResult

protected TestResult createTestResult()

### createUI

protected JFrame createUI(String suiteName)

### getSuiteText

protected String getSuiteText()

### getFailures

public ListModel getFailures()
Description copied from interface: `TestRunContext`
Returns the failure model

Specified by:
  `getFailures` in interface `TestRunContext`

### insertUpdate

public void insertUpdate(DocumentEvent event)

### instanciateClass

protected Object instanciateClass(String fullClassName, Object param)

### browseTestClasses

public void browseTestClasses()

### removeUpdate

public void removeUpdate(DocumentEvent event)

### reset

protected void reset()

### runFailed

protected void runFailed(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(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 Icon getIconResource(Class clazz, String name)