Package org.apache.maven.surefire.booter
Class BaseProviderFactory
- java.lang.Object
-
- org.apache.maven.surefire.booter.BaseProviderFactory
-
- All Implemented Interfaces:
DirectoryScannerParametersAware
,FailFastAware
,MainCliOptionsAware
,ProviderPropertiesAware
,ReporterConfigurationAware
,RunOrderParametersAware
,ShutdownAware
,SurefireClassLoadersAware
,TestArtifactInfoAware
,TestRequestAware
,ProviderParameters
public class BaseProviderFactory extends java.lang.Object implements DirectoryScannerParametersAware, ReporterConfigurationAware, SurefireClassLoadersAware, TestRequestAware, ProviderPropertiesAware, ProviderParameters, TestArtifactInfoAware, RunOrderParametersAware, MainCliOptionsAware, FailFastAware, ShutdownAware
-
-
Field Summary
Fields Modifier and Type Field Description private DirectoryScannerParameters
directoryScannerParameters
private ForkedChannelEncoder
forkedChannelEncoder
private boolean
insideFork
private java.util.List<CommandLineOption>
mainCliOptions
private java.util.Map<java.lang.String,java.lang.String>
providerProperties
private ReporterConfiguration
reporterConfiguration
private ReporterFactory
reporterFactory
private RunOrderParameters
runOrderParameters
private Shutdown
shutdown
private int
skipAfterFailureCount
private java.lang.Integer
systemExitTimeout
private TestArtifactInfo
testArtifactInfo
private java.lang.ClassLoader
testClassLoader
private TestRequest
testRequest
-
Constructor Summary
Constructors Constructor Description BaseProviderFactory(ReporterFactory reporterFactory, boolean insideFork)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ConsoleStream
getConsoleLogger()
Gets a logger intended for console output.DirectoryScanner
getDirectoryScanner()
Deprecated.DirectoryScannerParameters
getDirectoryScannerParameters()
The raw parameters used in creating the directory scannerForkedChannelEncoder
getForkedChannelEncoder()
java.util.List<CommandLineOption>
getMainCliOptions()
java.util.Map<java.lang.String,java.lang.String>
getProviderProperties()
The per-provider specific properties that may come all the way from the plugin's properties setting.ReporterConfiguration
getReporterConfiguration()
The raw parameters used in creating the ReporterManagerFactoryReporterFactory
getReporterFactory()
Provides features for creating reporting objectsRunOrderCalculator
getRunOrderCalculator()
Provides a service to calculate run order of tests.ScanResult
getScanResult()
Provides the result of the directory scan performed in the pluginShutdown
getShutdown()
int
getSkipAfterFailureCount()
java.lang.Integer
getSystemExitTimeout()
TestArtifactInfo
getTestArtifactInfo()
Artifact info about the artifact used to autodetect providerjava.lang.ClassLoader
getTestClassLoader()
The class loader for the testsTestRequest
getTestRequest()
Contains information about requested test suites or individual tests from the command line.private int
getThreadCount()
boolean
isInsideFork()
void
setClassLoaders(java.lang.ClassLoader testClassLoader)
void
setDirectoryScannerParameters(DirectoryScannerParameters directoryScannerParameters)
void
setForkedChannelEncoder(ForkedChannelEncoder forkedChannelEncoder)
void
setMainCliOptions(java.util.List<CommandLineOption> mainCliOptions)
void
setProviderProperties(java.util.Map<java.lang.String,java.lang.String> providerProperties)
void
setReporterConfiguration(ReporterConfiguration reporterConfiguration)
void
setRunOrderParameters(RunOrderParameters runOrderParameters)
void
setShutdown(Shutdown shutdown)
void
setSkipAfterFailureCount(int skipAfterFailureCount)
void
setSystemExitTimeout(java.lang.Integer systemExitTimeout)
void
setTestArtifactInfo(TestArtifactInfo testArtifactInfo)
void
setTestRequest(TestRequest testRequest)
-
-
-
Field Detail
-
reporterFactory
private final ReporterFactory reporterFactory
-
insideFork
private final boolean insideFork
-
forkedChannelEncoder
private ForkedChannelEncoder forkedChannelEncoder
-
mainCliOptions
private java.util.List<CommandLineOption> mainCliOptions
-
providerProperties
private java.util.Map<java.lang.String,java.lang.String> providerProperties
-
directoryScannerParameters
private DirectoryScannerParameters directoryScannerParameters
-
reporterConfiguration
private ReporterConfiguration reporterConfiguration
-
runOrderParameters
private RunOrderParameters runOrderParameters
-
testClassLoader
private java.lang.ClassLoader testClassLoader
-
testRequest
private TestRequest testRequest
-
testArtifactInfo
private TestArtifactInfo testArtifactInfo
-
skipAfterFailureCount
private int skipAfterFailureCount
-
shutdown
private Shutdown shutdown
-
systemExitTimeout
private java.lang.Integer systemExitTimeout
-
-
Constructor Detail
-
BaseProviderFactory
public BaseProviderFactory(ReporterFactory reporterFactory, boolean insideFork)
-
-
Method Detail
-
getDirectoryScanner
@Deprecated public DirectoryScanner getDirectoryScanner()
Deprecated.Description copied from interface:ProviderParameters
Provides a directory scanner that enforces the includes/excludes parameters that were passed to surefire. See #getDirectoryScannerParameters for details- Specified by:
getDirectoryScanner
in interfaceProviderParameters
- Returns:
- The directory scanner
-
getScanResult
public ScanResult getScanResult()
Description copied from interface:ProviderParameters
Provides the result of the directory scan performed in the plugin- Specified by:
getScanResult
in interfaceProviderParameters
- Returns:
- The scan result
-
getThreadCount
private int getThreadCount()
-
getRunOrderCalculator
public RunOrderCalculator getRunOrderCalculator()
Description copied from interface:ProviderParameters
Provides a service to calculate run order of tests. Applied after directory scanning.- Specified by:
getRunOrderCalculator
in interfaceProviderParameters
- Returns:
- A RunOrderCalculator
-
getReporterFactory
public ReporterFactory getReporterFactory()
Description copied from interface:ProviderParameters
Provides features for creating reporting objects- Specified by:
getReporterFactory
in interfaceProviderParameters
- Returns:
- A ReporterFactory that allows the creation of one or more ReporterManagers
-
setDirectoryScannerParameters
public void setDirectoryScannerParameters(DirectoryScannerParameters directoryScannerParameters)
- Specified by:
setDirectoryScannerParameters
in interfaceDirectoryScannerParametersAware
-
setReporterConfiguration
public void setReporterConfiguration(ReporterConfiguration reporterConfiguration)
- Specified by:
setReporterConfiguration
in interfaceReporterConfigurationAware
-
setClassLoaders
public void setClassLoaders(java.lang.ClassLoader testClassLoader)
- Specified by:
setClassLoaders
in interfaceSurefireClassLoadersAware
-
getConsoleLogger
public ConsoleStream getConsoleLogger()
Description copied from interface:ProviderParameters
Gets a logger intended for console output.
This output is intended for provider-oriented messages that are not attached to a single test-set and will normally be written to something console-like immediately.- Specified by:
getConsoleLogger
in interfaceProviderParameters
- Returns:
- A console stream logger
-
setTestRequest
public void setTestRequest(TestRequest testRequest)
- Specified by:
setTestRequest
in interfaceTestRequestAware
-
getDirectoryScannerParameters
public DirectoryScannerParameters getDirectoryScannerParameters()
Description copied from interface:ProviderParameters
The raw parameters used in creating the directory scanner- Specified by:
getDirectoryScannerParameters
in interfaceProviderParameters
- Returns:
- The parameters
-
getReporterConfiguration
public ReporterConfiguration getReporterConfiguration()
Description copied from interface:ProviderParameters
The raw parameters used in creating the ReporterManagerFactory- Specified by:
getReporterConfiguration
in interfaceProviderParameters
- Returns:
- The reporter configuration
-
getTestRequest
public TestRequest getTestRequest()
Description copied from interface:ProviderParameters
Contains information about requested test suites or individual tests from the command line.- Specified by:
getTestRequest
in interfaceProviderParameters
- Returns:
- The testRequest
-
getTestClassLoader
public java.lang.ClassLoader getTestClassLoader()
Description copied from interface:ProviderParameters
The class loader for the tests- Specified by:
getTestClassLoader
in interfaceProviderParameters
- Returns:
- the classloader
-
setProviderProperties
public void setProviderProperties(java.util.Map<java.lang.String,java.lang.String> providerProperties)
- Specified by:
setProviderProperties
in interfaceProviderPropertiesAware
-
getProviderProperties
public java.util.Map<java.lang.String,java.lang.String> getProviderProperties()
Description copied from interface:ProviderParameters
The per-provider specific properties that may come all the way from the plugin's properties setting.- Specified by:
getProviderProperties
in interfaceProviderParameters
- Returns:
- the provider specific properties
-
getTestArtifactInfo
public TestArtifactInfo getTestArtifactInfo()
Description copied from interface:ProviderParameters
Artifact info about the artifact used to autodetect provider- Specified by:
getTestArtifactInfo
in interfaceProviderParameters
- Returns:
- The artifactinfo, or null if autodetect was not used.
-
setTestArtifactInfo
public void setTestArtifactInfo(TestArtifactInfo testArtifactInfo)
- Specified by:
setTestArtifactInfo
in interfaceTestArtifactInfoAware
-
setRunOrderParameters
public void setRunOrderParameters(RunOrderParameters runOrderParameters)
- Specified by:
setRunOrderParameters
in interfaceRunOrderParametersAware
-
getMainCliOptions
public java.util.List<CommandLineOption> getMainCliOptions()
- Specified by:
getMainCliOptions
in interfaceProviderParameters
-
setMainCliOptions
public void setMainCliOptions(java.util.List<CommandLineOption> mainCliOptions)
- Specified by:
setMainCliOptions
in interfaceMainCliOptionsAware
-
getSkipAfterFailureCount
public int getSkipAfterFailureCount()
- Specified by:
getSkipAfterFailureCount
in interfaceProviderParameters
- Returns:
- Defaults to 0. Configured with parameter
skipAfterFailureCount
in POM.
-
setSkipAfterFailureCount
public void setSkipAfterFailureCount(int skipAfterFailureCount)
- Specified by:
setSkipAfterFailureCount
in interfaceFailFastAware
-
isInsideFork
public boolean isInsideFork()
- Specified by:
isInsideFork
in interfaceProviderParameters
- Returns:
true
if test provider appears in forked jvm; Otherwisefalse
means in-plugin provider.
-
getShutdown
public Shutdown getShutdown()
- Specified by:
getShutdown
in interfaceProviderParameters
-
setShutdown
public void setShutdown(Shutdown shutdown)
- Specified by:
setShutdown
in interfaceShutdownAware
-
getSystemExitTimeout
public java.lang.Integer getSystemExitTimeout()
- Specified by:
getSystemExitTimeout
in interfaceProviderParameters
-
setSystemExitTimeout
public void setSystemExitTimeout(java.lang.Integer systemExitTimeout)
-
getForkedChannelEncoder
public ForkedChannelEncoder getForkedChannelEncoder()
- Specified by:
getForkedChannelEncoder
in interfaceProviderParameters
-
setForkedChannelEncoder
public void setForkedChannelEncoder(ForkedChannelEncoder forkedChannelEncoder)
-
-