Package org.testng.junit
Class JUnit4TestRunner
java.lang.Object
org.testng.junit.JUnit4TestRunner
- All Implemented Interfaces:
IJUnitTestRunner
A JUnit TestRunner that records/triggers all information/events necessary to TestNG.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<org.junit.runner.Description,ITestResult> private Collection<IInvokedMethodListener>private final List<ITestListener>private final List<ITestNGMethod>private final ITestResultNotifierprivate final ITestObjectFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate ITestResultcreateTestResult(ITestObjectFactory objectFactory, org.junit.runner.Description test) Needed from TestRunner in order to figure out what JUnit test methods were run.private static booleanisAssumptionFailed(org.junit.runner.notification.Failure failure) voidAstartimplementation that ignores theTestResultvoidorg.junit.runner.ResultStarts a test run.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.testng.junit.IJUnitTestRunner
setTestResultNotifier
-
Field Details
-
objectFactory
-
m_parentRunner
-
m_listeners
-
m_methods
-
m_invokeListeners
-
m_foundMethods
-
-
Constructor Details
-
JUnit4TestRunner
-
-
Method Details
-
getTestMethods
Needed from TestRunner in order to figure out what JUnit test methods were run.- Specified by:
getTestMethodsin interfaceIJUnitTestRunner- Returns:
- the list of all JUnit test methods run
-
setInvokedMethodListeners
- Specified by:
setInvokedMethodListenersin interfaceIJUnitTestRunner
-
run
Astartimplementation that ignores theTestResult- Specified by:
runin interfaceIJUnitTestRunner- Parameters:
testClass- the JUnit test class
-
start
Starts a test run. Analyzes the command line arguments and runs the given test suite.- Parameters:
testCase- The test classmethods- The test methods- Returns:
- The result
-
createTestResult
private ITestResult createTestResult(ITestObjectFactory objectFactory, org.junit.runner.Description test) -
isAssumptionFailed
private static boolean isAssumptionFailed(org.junit.runner.notification.Failure failure)
-