Package junit.swingui

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