Package org.apache.maven.surefire.booter
Class ProviderFactory.ProviderProxy
java.lang.Object
org.apache.maven.surefire.booter.ProviderFactory.ProviderProxy
- All Implemented Interfaces:
SurefireProvider
- Enclosing class:
- ProviderFactory
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateProviderProxy(Object providerInOtherClassLoader, ClassLoader testsClassLoader) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Makes an attempt at cancelling the current run, giving the provider a chance to notify reporting that the remaining tests have been cancelled due to timeout.Determines the number of forks.Runs a forked testprivate ClassLoaderswapClassLoader(ClassLoader newClassLoader)
-
Field Details
-
providerInOtherClassLoader
-
testsClassLoader
-
-
Constructor Details
-
ProviderProxy
-
-
Method Details
-
getSuites
Description copied from interface:SurefireProviderDetermines the number of forks.
Called when forkmode is different from "never" or "always", allows the provider to define how to behave for the fork.- Specified by:
getSuitesin interfaceSurefireProvider- Returns:
- An iterator that will trigger one fork per item
-
invoke
Description copied from interface:SurefireProviderRuns a forked test- Specified by:
invokein interfaceSurefireProvider- 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:
ReporterException- When reporting failsInvocationTargetException- fails inProviderFactory
-
swapClassLoader
-
cancel
public void cancel()Description copied from interface:SurefireProviderMakes an attempt at cancelling the current run, giving the provider a chance to notify reporting that the remaining tests have been cancelled due to timeout.
If the provider thinks it can terminate properly it is the responsibility of the invoke method to return a RunResult with a booter code of failure.
It is up to the provider to find out how to implement this method properly. A provider may also choose to not do anything at all in this method, which means surefire will kill the forked process soon afterwards anyway.
Will be called on a different thread than the one calling invoke.- Specified by:
cancelin interfaceSurefireProvider
-