public abstract class AbstractSurefireMojo extends AbstractMojo implements SurefireExecutionParameters
Modifier and Type | Field and Description |
---|---|
protected File |
basedir
The base directory of the project being tested.
|
static String |
FORK_NUMBER_PLACEHOLDER
The placeholder that is replaced by the executing fork's running number.
|
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.
|
static String |
THREAD_NUMBER_PLACEHOLDER
The placeholder that is replaced by the executing thread's running number.
|
Constructor and Description |
---|
AbstractSurefireMojo() |
getLog, getPluginContext, setLog, setPluginContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBasedir, getClassesDirectory, getDebugForkedProcess, getFailIfNoSpecifiedTests, getForkedProcessExitTimeoutInSeconds, getForkedProcessTimeoutInSeconds, getParallelTestsTimeoutForcedInSeconds, getParallelTestsTimeoutInSeconds, getReportFormat, getReportsDirectory, getShutdown, getSkipAfterFailureCount, getTest, getTestClassesDirectory, isPrintSummary, isSkip, isSkipExec, isSkipTests, isUseFile, isUseManifestOnlyJar, isUseSystemClassLoader, setBasedir, setClassesDirectory, setDebugForkedProcess, setFailIfNoSpecifiedTests, setForkedProcessExitTimeoutInSeconds, setForkedProcessTimeoutInSeconds, setParallelTestsTimeoutForcedInSeconds, setParallelTestsTimeoutInSeconds, setPrintSummary, setReportFormat, setReportsDirectory, setSkip, setSkipExec, setSkipTests, setTest, setTestClassesDirectory, setUseFile, setUseManifestOnlyJar, setUseSystemClassLoader
@Parameter(property="skipTests", defaultValue="false") protected boolean skipTests
@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}") protected File basedir
@Parameter(defaultValue="${project.build.testOutputDirectory}") protected File testClassesDirectory
public static final String THREAD_NUMBER_PLACEHOLDER
public static final String FORK_NUMBER_PLACEHOLDER
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()
getSuiteXmlFiles()
as list
.
Never returns null.protected abstract boolean hasSuiteXmlFiles()
true
if suite-xml files array
is not empty.public abstract File[] getSuiteXmlFiles()
public abstract void setSuiteXmlFiles(File[] suiteXmlFiles)
public abstract String getRunOrder()
public abstract void setRunOrder(String runOrder)
protected abstract void handleSummary(RunResult summary, Exception firstForkException) throws MojoExecutionException, MojoFailureException
protected abstract boolean isSkipExecution()
protected abstract String[] getDefaultIncludes()
protected abstract String getReportSchemaLocation()
protected abstract Artifact getMojoArtifact()
public void execute() throws MojoExecutionException, MojoFailureException
execute
in interface Mojo
MojoExecutionException
MojoFailureException
@Nonnull protected final PluginConsoleLogger getConsoleLogger()
protected List<ProviderInfo> createProviders() throws MojoFailureException, 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()
protected int getEffectiveForkCount()
protected int convertWithCoreCount(String count)
protected void addPluginSpecificChecksumItems(ChecksumCalculator checksum)
protected boolean hasExecutedBefore()
@Nonnull protected ClassLoaderConfiguration getClassLoaderConfiguration()
public List<String> getExcludes()
getExcludes
in interface SurefireExecutionParameters
public void setExcludes(List<String> excludes)
setExcludes
in interface SurefireExecutionParameters
public ArtifactRepository getLocalRepository()
getLocalRepository
in interface SurefireExecutionParameters
public void setLocalRepository(ArtifactRepository localRepository)
setLocalRepository
in interface SurefireExecutionParameters
public Properties getSystemProperties()
public void setSystemProperties(Properties systemProperties)
public void setSystemPropertyVariables(Map<String,String> systemPropertyVariables)
public File getSystemPropertiesFile()
public void setSystemPropertiesFile(File systemPropertiesFile)
public void setProperties(Properties properties)
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 getForkMode()
public void setForkMode(String forkMode)
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 ArtifactResolver getArtifactResolver()
public void setArtifactResolver(ArtifactResolver artifactResolver)
public ArtifactFactory getArtifactFactory()
public void setArtifactFactory(ArtifactFactory artifactFactory)
public List<ArtifactRepository> getRemoteRepositories()
public void setRemoteRepositories(List<ArtifactRepository> remoteRepositories)
public ArtifactMetadataSource getMetadataSource()
public void setMetadataSource(ArtifactMetadataSource metadataSource)
public boolean isDisableXmlReport()
public void setDisableXmlReport(boolean disableXmlReport)
public boolean isEnableAssertions()
public boolean effectiveIsEnableAssertions()
public void setEnableAssertions(boolean enableAssertions)
public MavenSession getSession()
public void setSession(MavenSession session)
public String getObjectFactory()
public void setObjectFactory(String objectFactory)
public ToolchainManager getToolchainManager()
public void setToolchainManager(ToolchainManager toolchainManager)
public boolean isMavenParallel()
public String[] getDependenciesToScan()
public void setDependenciesToScan(String[] dependenciesToScan)
public PluginDescriptor getPluginDescriptor()
public MavenProject getProject()
public void setProject(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–2018 The Apache Software Foundation. All rights reserved.