public abstract class AbstractSurefireMojo extends org.apache.maven.plugin.AbstractMojo implements SurefireExecutionParameters
Modifier and Type | Field and Description |
---|---|
protected File |
basedir
The base directory of the project being tested.
|
protected boolean |
skip
Set this to "true" to bypass unit tests entirely.
|
protected boolean |
skipExec
Deprecated.
Use skipTests instead.
|
protected boolean |
skipTests
Set this to "true" to skip running tests, but still compile them.
|
protected File |
testClassesDirectory
The directory containing generated test classes of the project being tested.
|
Constructor and Description |
---|
AbstractSurefireMojo() |
Modifier and Type | Method and Description |
---|---|
protected void |
addPluginSpecificChecksumItems(ChecksumCalculator checksum) |
protected void |
cleanupForkConfiguration(ForkConfiguration forkConfiguration) |
protected int |
convertWithCoreCount(String count) |
static SurefireProperties |
createCopyAndReplaceForkNumPlaceholder(SurefireProperties effectiveSystemProperties,
int threadNumber) |
protected List<ProviderInfo> |
createProviders(org.apache.maven.plugin.surefire.TestClassPath testClasspath) |
boolean |
effectiveIsEnableAssertions() |
void |
execute() |
String[] |
getAdditionalClasspathElements() |
String |
getArgLine() |
protected ClassLoaderConfiguration |
getClassLoaderConfiguration() |
String[] |
getClasspathDependencyExcludes() |
String |
getClasspathDependencyScopeExclude() |
protected PluginConsoleLogger |
getConsoleLogger() |
protected abstract String[] |
getDefaultIncludes() |
String[] |
getDependenciesToScan() |
protected int |
getEffectiveForkCount() |
protected abstract String |
getEnableProcessChecker() |
Map<String,String> |
getEnvironmentVariables() |
protected abstract String[] |
getExcludedEnvironmentVariables() |
String |
getExcludedGroups() |
abstract File |
getExcludesFile() |
boolean |
getFailIfNoTests() |
String |
getForkCount() |
protected abstract ForkNodeFactory |
getForkNode() |
String |
getGroups() |
abstract List<String> |
getIncludes() |
abstract File |
getIncludesFile() |
Map<String,String> |
getJdkToolchain() |
String |
getJunitArtifactName() |
String |
getJvm() |
String |
getLocalRepositoryPath() |
protected org.apache.maven.artifact.Artifact |
getMojoArtifact()
This plugin MOJO artifact.
|
String |
getObjectFactory() |
String |
getParallel() |
boolean |
getPerCoreThreadCount() |
Map<String,org.apache.maven.artifact.Artifact> |
getPluginArtifactMap() |
org.apache.maven.plugin.descriptor.PluginDescriptor |
getPluginDescriptor() |
protected abstract String |
getPluginName() |
org.apache.maven.project.MavenProject |
getProject() |
Map<String,org.apache.maven.artifact.Artifact> |
getProjectArtifactMap() |
File |
getProjectBuildDirectory() |
String |
getReportNameSuffix() |
protected abstract String |
getReportSchemaLocation() |
protected abstract int |
getRerunFailingTestsCount() |
abstract String |
getRunOrder() |
abstract Long |
getRunOrderRandomSeed() |
org.apache.maven.execution.MavenSession |
getSession() |
TestListResolver |
getSpecificTests() |
abstract File[] |
getSuiteXmlFiles() |
Properties |
getSystemProperties() |
abstract File |
getSystemPropertiesFile()
List of System properties, loaded from a file, to pass to the JUnit tests.
|
Map<String,String> |
getSystemPropertyVariables() |
String |
getTempDir() |
String |
getTestNGArtifactName() |
File |
getTestSourceDirectory() |
int |
getThreadCount() |
int |
getThreadCountClasses() |
int |
getThreadCountMethods() |
int |
getThreadCountSuites() |
org.apache.maven.toolchain.ToolchainManager |
getToolchainManager() |
boolean |
getUseUnlimitedThreads() |
File |
getWorkingDirectory() |
protected abstract void |
handleSummary(RunResult summary,
Exception firstForkException) |
protected boolean |
hasExecutedBefore() |
protected abstract boolean |
hasSuiteXmlFiles() |
protected boolean |
isAnyConcurrencySelected() |
protected boolean |
isAnyGroupsSelected() |
boolean |
isChildDelegation() |
Boolean |
isDisableXmlReport() |
boolean |
isEnableAssertions() |
boolean |
isEnableOutErrElements() |
boolean |
isEnablePropertiesElement() |
protected boolean |
isForking() |
boolean |
isMavenParallel() |
boolean |
isParallelOptimized() |
boolean |
isRedirectTestOutputToFile() |
boolean |
isReuseForks() |
protected abstract boolean |
isSkipExecution() |
boolean |
isTrimStackTrace() |
protected void |
logDebugOrCliShowErrors(String s) |
protected void |
logReportsDirectory() |
protected Collection<org.apache.maven.artifact.Artifact> |
resolveDependencies(List<org.apache.maven.model.Dependency> dependencies) |
void |
setAdditionalClasspathElements(String[] additionalClasspathElements) |
void |
setArgLine(String argLine) |
void |
setChildDelegation(boolean childDelegation) |
void |
setClasspathDependencyExcludes(String[] classpathDependencyExcludes) |
void |
setClasspathDependencyScopeExclude(String classpathDependencyScopeExclude) |
void |
setDependenciesToScan(String[] dependenciesToScan) |
void |
setDisableXmlReport(Boolean disableXmlReport) |
void |
setEnableAssertions(boolean enableAssertions) |
void |
setEnableOutErrElements(boolean enableOutErrElements) |
void |
setEnablePropertiesElement(boolean enablePropertiesElement) |
void |
setEnvironmentVariables(Map<String,String> environmentVariables) |
void |
setExcludedGroups(String excludedGroups) |
void |
setFailIfNoTests(boolean failIfNoTests) |
void |
setGroups(String groups) |
abstract void |
setIncludes(List<String> includes) |
void |
setJdkToolchain(Map<String,String> jdkToolchain) |
void |
setJunitArtifactName(String junitArtifactName) |
void |
setObjectFactory(String objectFactory) |
void |
setParallel(String parallel) |
void |
setParallelOptimized(boolean parallelOptimized) |
void |
setPerCoreThreadCount(boolean perCoreThreadCount) |
void |
setPluginArtifactMap(Map<String,org.apache.maven.artifact.Artifact> pluginArtifactMap) |
void |
setProject(org.apache.maven.project.MavenProject project) |
void |
setProjectArtifactMap(Map<String,org.apache.maven.artifact.Artifact> projectArtifactMap) |
void |
setProjectBuildDirectory(File projectBuildDirectory) |
void |
setProperties(Properties properties) |
void |
setRedirectTestOutputToFile(boolean redirectTestOutputToFile) |
void |
setReportNameSuffix(String reportNameSuffix) |
abstract void |
setRunOrder(String runOrder) |
abstract void |
setRunOrderRandomSeed(Long runOrderRandomSeed) |
void |
setSession(org.apache.maven.execution.MavenSession session) |
abstract void |
setSuiteXmlFiles(File[] suiteXmlFiles) |
void |
setSystemProperties(Properties systemProperties) |
abstract void |
setSystemPropertiesFile(File systemPropertiesFile) |
void |
setSystemPropertyVariables(Map<String,String> systemPropertyVariables) |
void |
setTempDir(String tempDir) |
void |
setTestNGArtifactName(String testNGArtifactName) |
void |
setTestSourceDirectory(File testSourceDirectory) |
void |
setThreadCount(int threadCount) |
void |
setThreadCountClasses(int threadCountClasses) |
void |
setThreadCountMethods(int threadCountMethods) |
void |
setThreadCountSuites(int threadCountSuites) |
void |
setToolchainManager(org.apache.maven.toolchain.ToolchainManager toolchainManager) |
void |
setTrimStackTrace(boolean trimStackTrace) |
protected abstract void |
setUseModulePath(boolean useModulePath) |
void |
setUseUnlimitedThreads(boolean useUnlimitedThreads) |
void |
setWorkingDirectory(File workingDirectory) |
protected abstract List<File> |
suiteXmlFiles()
Calls
getSuiteXmlFiles() as list . |
protected abstract boolean |
useModulePath() |
protected void |
warnIfIllegalFailOnFlakeCount() |
getLog, getPluginContext, setLog, setPluginContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBasedir, getDebugForkedProcess, getEncoding, getExcludeJUnit5Engines, getExcludes, getFailIfNoSpecifiedTests, getForkedProcessExitTimeoutInSeconds, getForkedProcessTimeoutInSeconds, getIncludeJUnit5Engines, getMainBuildPath, getParallelTestsTimeoutForcedInSeconds, getParallelTestsTimeoutInSeconds, getReportFormat, getReportsDirectory, getShutdown, getSkipAfterFailureCount, getTest, getTestClassesDirectory, isPrintSummary, isSkip, isSkipExec, isSkipTests, isUseFile, isUseManifestOnlyJar, isUseSystemClassLoader, setBasedir, setDebugForkedProcess, setEncoding, setExcludeJUnit5Engines, setExcludes, setFailIfNoSpecifiedTests, setForkedProcessExitTimeoutInSeconds, setForkedProcessTimeoutInSeconds, setIncludeJUnit5Engines, setMainBuildPath, setParallelTestsTimeoutForcedInSeconds, setParallelTestsTimeoutInSeconds, setPrintSummary, setReportFormat, setReportsDirectory, setSkip, setSkipExec, setSkipTests, setTest, setTestClassesDirectory, setUseFile, setUseManifestOnlyJar, setUseSystemClassLoader
@Parameter(property="skipTests", defaultValue="false") protected boolean skipTests
skipTests
and the parameter will be removed in
Failsafe 3.0.0 as it is a source of conflicts between Failsafe and Surefire plugin.@Deprecated @Parameter(property="maven.test.skip.exec") protected boolean skipExec
skipTests
, but bound to the old property "maven.test.skip.exec".@Parameter(property="maven.test.skip", defaultValue="false") protected boolean skip
skipTests
parameter instead.@Parameter(defaultValue="${basedir}", readonly=true, required=true) protected File basedir
@Parameter(defaultValue="${project.build.testOutputDirectory}") protected File testClassesDirectory
protected abstract String getPluginName()
protected abstract int getRerunFailingTestsCount()
public abstract List<String> getIncludes()
getIncludes
in interface SurefireExecutionParameters
public abstract File getIncludesFile()
public abstract void setIncludes(List<String> includes)
setIncludes
in interface SurefireExecutionParameters
public abstract File getExcludesFile()
protected abstract List<File> suiteXmlFiles()
protected abstract boolean hasSuiteXmlFiles()
true
if suite-xml files array
is not empty.protected abstract String[] getExcludedEnvironmentVariables()
public abstract File[] getSuiteXmlFiles()
public abstract void setSuiteXmlFiles(File[] suiteXmlFiles)
public abstract String getRunOrder()
public abstract void setRunOrder(String runOrder)
public abstract Long getRunOrderRandomSeed()
public abstract void setRunOrderRandomSeed(Long runOrderRandomSeed)
protected abstract void handleSummary(RunResult summary, Exception firstForkException) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
protected abstract boolean isSkipExecution()
protected abstract String[] getDefaultIncludes()
protected abstract String getReportSchemaLocation()
protected abstract boolean useModulePath()
protected abstract void setUseModulePath(boolean useModulePath)
protected abstract String getEnableProcessChecker()
protected abstract ForkNodeFactory getForkNode()
protected org.apache.maven.artifact.Artifact getMojoArtifact()
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
execute
in interface org.apache.maven.plugin.Mojo
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
@Nonnull protected final PluginConsoleLogger getConsoleLogger()
protected List<ProviderInfo> createProviders(org.apache.maven.plugin.surefire.TestClassPath testClasspath) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
public static SurefireProperties createCopyAndReplaceForkNumPlaceholder(SurefireProperties effectiveSystemProperties, int threadNumber)
protected void cleanupForkConfiguration(ForkConfiguration forkConfiguration)
protected void logReportsDirectory()
protected boolean isAnyConcurrencySelected()
protected boolean isAnyGroupsSelected()
protected boolean isForking()
public TestListResolver getSpecificTests() throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureException
protected int getEffectiveForkCount()
protected int convertWithCoreCount(String count)
protected void addPluginSpecificChecksumItems(ChecksumCalculator checksum)
protected boolean hasExecutedBefore()
@Nonnull protected ClassLoaderConfiguration getClassLoaderConfiguration()
protected Collection<org.apache.maven.artifact.Artifact> resolveDependencies(List<org.apache.maven.model.Dependency> dependencies) throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureException
protected void warnIfIllegalFailOnFlakeCount() throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureException
public String getLocalRepositoryPath()
getLocalRepositoryPath
in interface SurefireExecutionParameters
public Properties getSystemProperties()
public void setSystemProperties(Properties systemProperties)
public void setSystemPropertyVariables(Map<String,String> systemPropertyVariables)
public abstract File getSystemPropertiesFile()
public abstract void setSystemPropertiesFile(File systemPropertiesFile)
public void setProperties(Properties properties)
public void setPluginArtifactMap(Map<String,org.apache.maven.artifact.Artifact> pluginArtifactMap)
public void setProjectArtifactMap(Map<String,org.apache.maven.artifact.Artifact> projectArtifactMap)
public String getReportNameSuffix()
public void setReportNameSuffix(String reportNameSuffix)
public boolean isRedirectTestOutputToFile()
public void setRedirectTestOutputToFile(boolean redirectTestOutputToFile)
public boolean getFailIfNoTests()
public void setFailIfNoTests(boolean failIfNoTests)
public String getJvm()
public String getArgLine()
public void setArgLine(String argLine)
public void setEnvironmentVariables(Map<String,String> environmentVariables)
public File getWorkingDirectory()
public void setWorkingDirectory(File workingDirectory)
public boolean isChildDelegation()
public void setChildDelegation(boolean childDelegation)
public String getGroups()
public void setGroups(String groups)
public String getExcludedGroups()
public void setExcludedGroups(String excludedGroups)
public String getJunitArtifactName()
public void setJunitArtifactName(String junitArtifactName)
public String getTestNGArtifactName()
public void setTestNGArtifactName(String testNGArtifactName)
public int getThreadCount()
public void setThreadCount(int threadCount)
public boolean getPerCoreThreadCount()
public void setPerCoreThreadCount(boolean perCoreThreadCount)
public boolean getUseUnlimitedThreads()
public void setUseUnlimitedThreads(boolean useUnlimitedThreads)
public String getParallel()
public void setParallel(String parallel)
public boolean isParallelOptimized()
public void setParallelOptimized(boolean parallelOptimized)
public int getThreadCountSuites()
public void setThreadCountSuites(int threadCountSuites)
public int getThreadCountClasses()
public void setThreadCountClasses(int threadCountClasses)
public int getThreadCountMethods()
public void setThreadCountMethods(int threadCountMethods)
public boolean isTrimStackTrace()
public void setTrimStackTrace(boolean trimStackTrace)
public Boolean isDisableXmlReport()
public void setDisableXmlReport(Boolean disableXmlReport)
public boolean isEnableAssertions()
public boolean effectiveIsEnableAssertions()
public void setEnableAssertions(boolean enableAssertions)
public boolean isEnableOutErrElements()
public void setEnableOutErrElements(boolean enableOutErrElements)
public boolean isEnablePropertiesElement()
public void setEnablePropertiesElement(boolean enablePropertiesElement)
public org.apache.maven.execution.MavenSession getSession()
public void setSession(org.apache.maven.execution.MavenSession session)
public String getObjectFactory()
public void setObjectFactory(String objectFactory)
public org.apache.maven.toolchain.ToolchainManager getToolchainManager()
public void setToolchainManager(org.apache.maven.toolchain.ToolchainManager toolchainManager)
public boolean isMavenParallel()
public String[] getDependenciesToScan()
public void setDependenciesToScan(String[] dependenciesToScan)
public org.apache.maven.plugin.descriptor.PluginDescriptor getPluginDescriptor()
public org.apache.maven.project.MavenProject getProject()
public void setProject(org.apache.maven.project.MavenProject project)
public File getTestSourceDirectory()
getTestSourceDirectory
in interface SurefireExecutionParameters
public void setTestSourceDirectory(File testSourceDirectory)
setTestSourceDirectory
in interface SurefireExecutionParameters
public String getForkCount()
public boolean isReuseForks()
public String[] getAdditionalClasspathElements()
public void setAdditionalClasspathElements(String[] additionalClasspathElements)
public String[] getClasspathDependencyExcludes()
public void setClasspathDependencyExcludes(String[] classpathDependencyExcludes)
public String getClasspathDependencyScopeExclude()
public void setClasspathDependencyScopeExclude(String classpathDependencyScopeExclude)
public File getProjectBuildDirectory()
public void setProjectBuildDirectory(File projectBuildDirectory)
protected void logDebugOrCliShowErrors(String s)
public String getTempDir()
public void setTempDir(String tempDir)
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.