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

        public void start​(java.lang.String[] args)
        Starts the TestRunner
      • terminate

        public void terminate()
        Terminates the TestRunner
      • textChanged

        public void textChanged()
      • getIconResource

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