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 DirectoryScannerParametersdirectoryScannerParametersprivate ForkedChannelEncoderforkedChannelEncoderprivate booleaninsideForkprivate java.util.List<CommandLineOption>mainCliOptionsprivate java.util.Map<java.lang.String,java.lang.String>providerPropertiesprivate ReporterConfigurationreporterConfigurationprivate ReporterFactoryreporterFactoryprivate RunOrderParametersrunOrderParametersprivate Shutdownshutdownprivate intskipAfterFailureCountprivate java.lang.IntegersystemExitTimeoutprivate TestArtifactInfotestArtifactInfoprivate java.lang.ClassLoadertestClassLoaderprivate TestRequesttestRequest
-
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 ConsoleStreamgetConsoleLogger()Gets a logger intended for console output.DirectoryScannergetDirectoryScanner()Deprecated.DirectoryScannerParametersgetDirectoryScannerParameters()The raw parameters used in creating the directory scannerForkedChannelEncodergetForkedChannelEncoder()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.ReporterConfigurationgetReporterConfiguration()The raw parameters used in creating the ReporterManagerFactoryReporterFactorygetReporterFactory()Provides features for creating reporting objectsRunOrderCalculatorgetRunOrderCalculator()Provides a service to calculate run order of tests.ScanResultgetScanResult()Provides the result of the directory scan performed in the pluginShutdowngetShutdown()intgetSkipAfterFailureCount()java.lang.IntegergetSystemExitTimeout()TestArtifactInfogetTestArtifactInfo()Artifact info about the artifact used to autodetect providerjava.lang.ClassLoadergetTestClassLoader()The class loader for the testsTestRequestgetTestRequest()Contains information about requested test suites or individual tests from the command line.private intgetThreadCount()booleanisInsideFork()voidsetClassLoaders(java.lang.ClassLoader testClassLoader)voidsetDirectoryScannerParameters(DirectoryScannerParameters directoryScannerParameters)voidsetForkedChannelEncoder(ForkedChannelEncoder forkedChannelEncoder)voidsetMainCliOptions(java.util.List<CommandLineOption> mainCliOptions)voidsetProviderProperties(java.util.Map<java.lang.String,java.lang.String> providerProperties)voidsetReporterConfiguration(ReporterConfiguration reporterConfiguration)voidsetRunOrderParameters(RunOrderParameters runOrderParameters)voidsetShutdown(Shutdown shutdown)voidsetSkipAfterFailureCount(int skipAfterFailureCount)voidsetSystemExitTimeout(java.lang.Integer systemExitTimeout)voidsetTestArtifactInfo(TestArtifactInfo testArtifactInfo)voidsetTestRequest(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:ProviderParametersProvides a directory scanner that enforces the includes/excludes parameters that were passed to surefire. See #getDirectoryScannerParameters for details- Specified by:
getDirectoryScannerin interfaceProviderParameters- Returns:
- The directory scanner
-
getScanResult
public ScanResult getScanResult()
Description copied from interface:ProviderParametersProvides the result of the directory scan performed in the plugin- Specified by:
getScanResultin interfaceProviderParameters- Returns:
- The scan result
-
getThreadCount
private int getThreadCount()
-
getRunOrderCalculator
public RunOrderCalculator getRunOrderCalculator()
Description copied from interface:ProviderParametersProvides a service to calculate run order of tests. Applied after directory scanning.- Specified by:
getRunOrderCalculatorin interfaceProviderParameters- Returns:
- A RunOrderCalculator
-
getReporterFactory
public ReporterFactory getReporterFactory()
Description copied from interface:ProviderParametersProvides features for creating reporting objects- Specified by:
getReporterFactoryin interfaceProviderParameters- Returns:
- A ReporterFactory that allows the creation of one or more ReporterManagers
-
setDirectoryScannerParameters
public void setDirectoryScannerParameters(DirectoryScannerParameters directoryScannerParameters)
- Specified by:
setDirectoryScannerParametersin interfaceDirectoryScannerParametersAware
-
setReporterConfiguration
public void setReporterConfiguration(ReporterConfiguration reporterConfiguration)
- Specified by:
setReporterConfigurationin interfaceReporterConfigurationAware
-
setClassLoaders
public void setClassLoaders(java.lang.ClassLoader testClassLoader)
- Specified by:
setClassLoadersin interfaceSurefireClassLoadersAware
-
getConsoleLogger
public ConsoleStream getConsoleLogger()
Description copied from interface:ProviderParametersGets 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:
getConsoleLoggerin interfaceProviderParameters- Returns:
- A console stream logger
-
setTestRequest
public void setTestRequest(TestRequest testRequest)
- Specified by:
setTestRequestin interfaceTestRequestAware
-
getDirectoryScannerParameters
public DirectoryScannerParameters getDirectoryScannerParameters()
Description copied from interface:ProviderParametersThe raw parameters used in creating the directory scanner- Specified by:
getDirectoryScannerParametersin interfaceProviderParameters- Returns:
- The parameters
-
getReporterConfiguration
public ReporterConfiguration getReporterConfiguration()
Description copied from interface:ProviderParametersThe raw parameters used in creating the ReporterManagerFactory- Specified by:
getReporterConfigurationin interfaceProviderParameters- Returns:
- The reporter configuration
-
getTestRequest
public TestRequest getTestRequest()
Description copied from interface:ProviderParametersContains information about requested test suites or individual tests from the command line.- Specified by:
getTestRequestin interfaceProviderParameters- Returns:
- The testRequest
-
getTestClassLoader
public java.lang.ClassLoader getTestClassLoader()
Description copied from interface:ProviderParametersThe class loader for the tests- Specified by:
getTestClassLoaderin interfaceProviderParameters- Returns:
- the classloader
-
setProviderProperties
public void setProviderProperties(java.util.Map<java.lang.String,java.lang.String> providerProperties)
- Specified by:
setProviderPropertiesin interfaceProviderPropertiesAware
-
getProviderProperties
public java.util.Map<java.lang.String,java.lang.String> getProviderProperties()
Description copied from interface:ProviderParametersThe per-provider specific properties that may come all the way from the plugin's properties setting.- Specified by:
getProviderPropertiesin interfaceProviderParameters- Returns:
- the provider specific properties
-
getTestArtifactInfo
public TestArtifactInfo getTestArtifactInfo()
Description copied from interface:ProviderParametersArtifact info about the artifact used to autodetect provider- Specified by:
getTestArtifactInfoin interfaceProviderParameters- Returns:
- The artifactinfo, or null if autodetect was not used.
-
setTestArtifactInfo
public void setTestArtifactInfo(TestArtifactInfo testArtifactInfo)
- Specified by:
setTestArtifactInfoin interfaceTestArtifactInfoAware
-
setRunOrderParameters
public void setRunOrderParameters(RunOrderParameters runOrderParameters)
- Specified by:
setRunOrderParametersin interfaceRunOrderParametersAware
-
getMainCliOptions
public java.util.List<CommandLineOption> getMainCliOptions()
- Specified by:
getMainCliOptionsin interfaceProviderParameters
-
setMainCliOptions
public void setMainCliOptions(java.util.List<CommandLineOption> mainCliOptions)
- Specified by:
setMainCliOptionsin interfaceMainCliOptionsAware
-
getSkipAfterFailureCount
public int getSkipAfterFailureCount()
- Specified by:
getSkipAfterFailureCountin interfaceProviderParameters- Returns:
- Defaults to 0. Configured with parameter
skipAfterFailureCountin POM.
-
setSkipAfterFailureCount
public void setSkipAfterFailureCount(int skipAfterFailureCount)
- Specified by:
setSkipAfterFailureCountin interfaceFailFastAware
-
isInsideFork
public boolean isInsideFork()
- Specified by:
isInsideForkin interfaceProviderParameters- Returns:
trueif test provider appears in forked jvm; Otherwisefalsemeans in-plugin provider.
-
getShutdown
public Shutdown getShutdown()
- Specified by:
getShutdownin interfaceProviderParameters
-
setShutdown
public void setShutdown(Shutdown shutdown)
- Specified by:
setShutdownin interfaceShutdownAware
-
getSystemExitTimeout
public java.lang.Integer getSystemExitTimeout()
- Specified by:
getSystemExitTimeoutin interfaceProviderParameters
-
setSystemExitTimeout
public void setSystemExitTimeout(java.lang.Integer systemExitTimeout)
-
getForkedChannelEncoder
public ForkedChannelEncoder getForkedChannelEncoder()
- Specified by:
getForkedChannelEncoderin interfaceProviderParameters
-
setForkedChannelEncoder
public void setForkedChannelEncoder(ForkedChannelEncoder forkedChannelEncoder)
-
-