Package org.apache.maven.surefire.junit4
Class JUnit4Provider
java.lang.Object
org.apache.maven.surefire.api.provider.AbstractProvider
org.apache.maven.surefire.junit4.JUnit4Provider
- All Implemented Interfaces:
SurefireProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClassMethodIndexer
private final CommandChainReader
private final String
private final JUnit4TestChecker
private final ProviderParameters
private final int
private final RunOrderCalculator
private final ScanResult
private final ClassLoader
private final TestListResolver
private TestsToRun
private static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
countTestsInRunner
(org.junit.runner.Description description) JUnit error: test count includes one test-class as a suite which has filtered out all children.private org.junit.runner.manipulation.Filter
(package private) static org.junit.runner.Description
createTestsDescription
(Iterable<Class<?>> classes) private static void
private void
executeTestSet
(Class<?> clazz, RunListener reporter, Notifier notifier, RunModeSetter runMode) private void
executeWithRerun
(Class<?> clazz, Notifier notifier, RunModeSetter runMode) private int
Determines the number of forks.private static boolean
hasFilteredOutAllChildren
(org.junit.runner.Description description) Runs a forked testprivate boolean
private static boolean
private boolean
private void
registerPleaseStopJUnitListener
(Notifier notifier) private void
registerShutdownListener
(TestsToRun testsToRun) private TestsToRun
private void
setTestsToRun
(Object forkTestSet) private void
Methods inherited from class org.apache.maven.surefire.api.provider.AbstractProvider
cancel
-
Field Details
-
UNDETERMINED_TESTS_DESCRIPTION
- See Also:
-
classMethodIndexer
-
testClassLoader
-
customRunListeners
-
jUnit4TestChecker
-
testResolver
-
providerParameters
-
runOrderCalculator
-
scanResult
-
rerunFailingTestsCount
private final int rerunFailingTestsCount -
commandsReader
-
testsToRun
-
-
Constructor Details
-
JUnit4Provider
-
-
Method Details
-
invoke
Description copied from interface:SurefireProvider
Runs a forked test- Parameters:
forkTestSet
- An item from the iterator in #getSuites. Will be null for forkmode never or always. When this is non-null, the forked process will run only that test and probably not scan the classpath- Returns:
- A result of the invocation
- Throws:
TestSetFailedException
- When testset fails
-
setTestsToRun
- Throws:
TestSetFailedException
-
isRerunFailingTests
private boolean isRerunFailingTests() -
isFailFast
private boolean isFailFast() -
getSkipAfterFailureCount
private int getSkipAfterFailureCount() -
registerShutdownListener
-
registerPleaseStopJUnitListener
-
executeTestSet
private void executeTestSet(Class<?> clazz, RunListener reporter, Notifier notifier, RunModeSetter runMode) -
executeWithRerun
-
getSuites
Description copied from interface:SurefireProvider
Determines the number of forks.
Called when forkmode is different from "never" or "always", allows the provider to define how to behave for the fork.- Returns:
- An iterator that will trigger one fork per item
-
scanClassPath
-
upgradeCheck
- Throws:
TestSetFailedException
-
createTestsDescription
-
isJUnit4UpgradeCheck
private static boolean isJUnit4UpgradeCheck() -
execute
-
countTestsInRunner
private static int countTestsInRunner(org.junit.runner.Description description) JUnit error: test count includes one test-class as a suite which has filtered out all children. Then the child test has a description "initializationError0(org.junit.runner.manipulation.Filter)" for JUnit 4.0 or "initializationError(org.junit.runner.manipulation.Filter)" for JUnit 4.12 and Description#isTest() returns true, but this description is not a real test and therefore it should not be included in the entire test count. -
hasFilteredOutAllChildren
private static boolean hasFilteredOutAllChildren(org.junit.runner.Description description) -
createMethodFilter
private org.junit.runner.manipulation.Filter createMethodFilter()
-