Class JUnitTestRunner

  • All Implemented Interfaces:
    junit.framework.TestListener, IJUnitTestRunner

    @Deprecated
    public class JUnitTestRunner
    extends java.lang.Object
    implements junit.framework.TestListener, IJUnitTestRunner
    Deprecated.
    - Support for running JUnit tests stands deprecated as of TestNG 7.7.0
    A JUnit TestRunner that records/triggers all information/events necessary to TestNG.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SUITE_METHODNAME
      Deprecated.
       
    • Constructor Summary

      Constructors 
      Constructor Description
      JUnitTestRunner​(ITestObjectFactory objectFactory, org.testng.internal.ITestResultNotifier tr)
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addError​(junit.framework.Test test, java.lang.Throwable t)
      Deprecated.
       
      void addFailure​(junit.framework.Test test, junit.framework.AssertionFailedError t)
      Deprecated.
       
      protected junit.framework.TestResult createTestResult()
      Deprecated.
      Creates the TestResult to be used for the test run.
      protected junit.framework.TestResult doRun​(junit.framework.Test suite)
      Deprecated.
       
      void endTest​(junit.framework.Test test)
      Deprecated.
       
      protected junit.framework.Test getTest​(java.lang.Class<? extends junit.framework.Test> testClass, java.lang.String... methods)
      Deprecated.
      Returns the Test corresponding to the given suite.
      java.util.List<ITestNGMethod> getTestMethods()
      Deprecated.
      Needed from TestRunner in order to figure out what JUnit test methods were run.
      void run​(java.lang.Class testClass, java.lang.String... methods)
      Deprecated.
      A start implementation that ignores the TestResult
      protected void runFailed​(java.lang.Class clazz, java.lang.String message)
      Deprecated.
       
      void setInvokedMethodListeners​(java.util.Collection<IInvokedMethodListener> listeners)
      Deprecated.
       
      junit.framework.TestResult start​(java.lang.Class testCase, java.lang.String... methods)
      Deprecated.
      Starts a test run.
      void startTest​(junit.framework.Test test)
      Deprecated.
       
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SUITE_METHODNAME

        public static final java.lang.String SUITE_METHODNAME
        Deprecated.
        See Also:
        Constant Field Values
    • Constructor Detail

      • JUnitTestRunner

        public JUnitTestRunner​(ITestObjectFactory objectFactory,
                               org.testng.internal.ITestResultNotifier tr)
        Deprecated.
    • Method Detail

      • getTestMethods

        public java.util.List<ITestNGMethod> getTestMethods()
        Deprecated.
        Needed from TestRunner in order to figure out what JUnit test methods were run.
        Specified by:
        getTestMethods in interface IJUnitTestRunner
        Returns:
        the list of all JUnit test methods run
      • startTest

        public void startTest​(junit.framework.Test test)
        Deprecated.
        Specified by:
        startTest in interface junit.framework.TestListener
        See Also:
        TestListener.startTest(junit.framework.Test)
      • addError

        public void addError​(junit.framework.Test test,
                             java.lang.Throwable t)
        Deprecated.
        Specified by:
        addError in interface junit.framework.TestListener
        See Also:
        TestListener.addError(junit.framework.Test, java.lang.Throwable)
      • addFailure

        public void addFailure​(junit.framework.Test test,
                               junit.framework.AssertionFailedError t)
        Deprecated.
        Specified by:
        addFailure in interface junit.framework.TestListener
        See Also:
        TestListener.addFailure(junit.framework.Test, junit.framework.AssertionFailedError)
      • endTest

        public void endTest​(junit.framework.Test test)
        Deprecated.
        Specified by:
        endTest in interface junit.framework.TestListener
        See Also:
        TestListener.endTest(junit.framework.Test)
      • getTest

        protected junit.framework.Test getTest​(java.lang.Class<? extends junit.framework.Test> testClass,
                                               java.lang.String... methods)
        Deprecated.
        Returns the Test corresponding to the given suite. This is a template method, subclasses override runFailed(), clearStatus().
        Parameters:
        testClass - The test class
        methods - The test methods
        Returns:
        The corresponding Test
      • run

        public void run​(java.lang.Class testClass,
                        java.lang.String... methods)
        Deprecated.
        A start implementation that ignores the TestResult
        Specified by:
        run in interface IJUnitTestRunner
        Parameters:
        testClass - the JUnit test class
      • start

        public junit.framework.TestResult start​(java.lang.Class testCase,
                                                java.lang.String... methods)
        Deprecated.
        Starts a test run. Analyzes the command line arguments and runs the given test suite.
        Parameters:
        testCase - The test class to run
        methods - The test methods to run
        Returns:
        The test result
      • runFailed

        protected void runFailed​(java.lang.Class clazz,
                                 java.lang.String message)
        Deprecated.
      • createTestResult

        protected junit.framework.TestResult createTestResult()
        Deprecated.
        Creates the TestResult to be used for the test run.
        Returns:
        The created test result
      • doRun

        protected junit.framework.TestResult doRun​(junit.framework.Test suite)
        Deprecated.