junit.awtui
Class TestRunner

java.lang.Object
  extended by junit.runner.BaseTestRunner
      extended by junit.awtui.TestRunner
All Implemented Interfaces:
TestListener

public class TestRunner
extends BaseTestRunner

An AWT 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.awtui.TestRunner [-noloading] [TestCase]
 
TestRunner takes as an optional argument the name of the testcase class to be run.


Field Summary
protected  Vector fExceptions
           
protected  Vector fFailedTests
           
protected  List fFailureList
           
protected  Frame fFrame
           
protected  Logo fLogo
           
protected  Label fNumberOfErrors
           
protected  Label fNumberOfFailures
           
protected  Label fNumberOfRuns
           
protected  ProgressBar fProgressIndicator
           
protected  Button fQuitButton
           
protected  Button fRerunButton
           
protected  Button fRun
           
protected  Thread fRunner
           
protected  TextField fStatusLine
           
protected  TextField fSuiteField
           
protected  TestResult fTestResult
           
protected  TextArea fTraceArea
           
protected  Checkbox fUseLoadingRunner
           
private static int GAP
           
protected static Font PLAIN_FONT
           
 
Fields inherited from class junit.runner.BaseTestRunner
SUITE_METHODNAME
 
Constructor Summary
TestRunner()
           
 
Method Summary
private  void about()
           
protected  void addGrid(Panel p, Component co, int x, int y, int w, int fill, double wx, int anchor)
           
private  void addToCounterPanel(Panel counter, Component comp, int gridx, int gridy, int gridwidth, int gridheight, double weightx, double weighty, int anchor, int fill, Insets insets)
           
private  void appendFailure(String kind, Test test, Throwable t)
           
protected  void clearStatus()
          Clears the status message.
protected  Panel createCounterPanel()
           
protected  Menu createJUnitMenu()
          Creates the JUnit menu.
protected  void createMenus(MenuBar mb)
           
protected  TestResult createTestResult()
           
protected  Frame createUI(String suiteName)
           
 void failureSelected()
           
 Thread getRunner()
           
private  boolean isErrorSelected()
           
private  Image loadFrameIcon()
           
static void main(String[] args)
           
 void rerun()
           
private  void rerunTest(Test test)
           
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.
 void runSuite()
           
private  void setLabelValue(Label label, int value)
           
 void setSuiteName(String suite)
           
private  boolean shouldReload()
           
private  void showErrorTrace()
           
private  void showInfo(String message)
           
private  void showStatus(String status)
           
 void start(String[] args)
          Starts the TestRunner
 void testEnded(String testName)
           
 void testFailed(int status, Test test, Throwable t)
           
 void testStarted(String testName)
           
 
Methods inherited from class junit.runner.BaseTestRunner
addError, addFailure, elapsedTimeAsString, endTest, extractClassName, getFilteredTrace, getFilteredTrace, getLoader, getPreference, getPreference, getPreferences, getTest, 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 Frame fFrame

fExceptions

protected Vector fExceptions

fFailedTests

protected Vector fFailedTests

fRunner

protected Thread fRunner

fTestResult

protected TestResult fTestResult

fTraceArea

protected TextArea fTraceArea

fSuiteField

protected TextField fSuiteField

fRun

protected Button fRun

fProgressIndicator

protected ProgressBar fProgressIndicator

fFailureList

protected List fFailureList

fLogo

protected Logo fLogo

fNumberOfErrors

protected Label fNumberOfErrors

fNumberOfFailures

protected Label fNumberOfFailures

fNumberOfRuns

protected Label fNumberOfRuns

fQuitButton

protected Button fQuitButton

fRerunButton

protected Button fRerunButton

fStatusLine

protected TextField fStatusLine

fUseLoadingRunner

protected Checkbox fUseLoadingRunner

PLAIN_FONT

protected static final Font PLAIN_FONT

GAP

private static final int GAP
See Also:
Constant Field Values
Constructor Detail

TestRunner

public TestRunner()
Method Detail

about

private void about()

testStarted

public void testStarted(String testName)
Specified by:
testStarted in class BaseTestRunner

testEnded

public void testEnded(String testName)
Specified by:
testEnded in class BaseTestRunner

testFailed

public void testFailed(int status,
                       Test test,
                       Throwable t)
Specified by:
testFailed in class BaseTestRunner

addGrid

protected void addGrid(Panel p,
                       Component co,
                       int x,
                       int y,
                       int w,
                       int fill,
                       double wx,
                       int anchor)

appendFailure

private void appendFailure(String kind,
                           Test test,
                           Throwable t)

createJUnitMenu

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


createMenus

protected void createMenus(MenuBar mb)

createTestResult

protected TestResult createTestResult()

createUI

protected Frame createUI(String suiteName)

createCounterPanel

protected Panel createCounterPanel()

addToCounterPanel

private void addToCounterPanel(Panel counter,
                               Component comp,
                               int gridx,
                               int gridy,
                               int gridwidth,
                               int gridheight,
                               double weightx,
                               double weighty,
                               int anchor,
                               int fill,
                               Insets insets)

failureSelected

public void failureSelected()

isErrorSelected

private boolean isErrorSelected()

loadFrameIcon

private Image loadFrameIcon()

getRunner

public Thread getRunner()

main

public static void main(String[] args)

run

public static void run(Class test)

rerun

public void rerun()

rerunTest

private void rerunTest(Test test)

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()

shouldReload

private boolean shouldReload()

setLabelValue

private void setLabelValue(Label label,
                           int value)

setSuiteName

public void setSuiteName(String suite)

showErrorTrace

private void showErrorTrace()

showInfo

private void showInfo(String message)

clearStatus

protected void clearStatus()
Description copied from class: BaseTestRunner
Clears the status message.

Overrides:
clearStatus in class BaseTestRunner

showStatus

private void showStatus(String status)

start

public void start(String[] args)
Starts the TestRunner