org.apache.maven.plugin.failsafe
Class IntegrationTestMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.surefire.AbstractSurefireMojo
          extended by org.apache.maven.plugin.failsafe.IntegrationTestMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, SurefireExecutionParameters

@Mojo(name="integration-test",
      requiresProject=true,
      requiresDependencyResolution=TEST,
      defaultPhase=INTEGRATION_TEST,
      threadSafe=true)
public class IntegrationTestMojo
extends AbstractSurefireMojo

Run integration tests using Surefire.

Author:
Jason van Zyl, Stephen Connolly

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.maven.plugin.surefire.AbstractSurefireMojo
AbstractSurefireMojo.DynamicProviderInfo
 
Field Summary
protected  int rerunFailingTestsCount
          The number of times each failing test will be rerun.
 
Fields inherited from class org.apache.maven.plugin.surefire.AbstractSurefireMojo
argLine, artifactFactory, artifactResolver, basedir, childDelegation, classesDirectory, disableXmlReport, enableAssertions, environmentVariables, excludedGroups, excludes, excludesFile, failIfNoTests, FORK_NUMBER_PLACEHOLDER, forkMode, groups, includesFile, junitArtifactName, jvm, localRepository, metadataSource, objectFactory, parallel, parallelMavenExecution, parallelOptimized, perCoreThreadCount, pluginArtifactMap, pluginDescriptor, project, projectArtifactMap, properties, redirectTestOutputToFile, remoteRepositories, reportNameSuffix, runOrder, session, skip, skipExec, skipTests, suiteXmlFiles, systemProperties, systemPropertiesFile, systemPropertyVariables, testClassesDirectory, testNGArtifactName, testSourceDirectory, THREAD_NUMBER_PLACEHOLDER, threadCount, threadCountClasses, threadCountMethods, threadCountSuites, toolchainManager, trimStackTrace, useUnlimitedThreads, workingDirectory
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
IntegrationTestMojo()
           
 
Method Summary
protected  void addPluginSpecificChecksumItems(ChecksumCalculator checksum)
           
 File getBasedir()
           
 File getClassesDirectory()
           
 String getDebugForkedProcess()
           
protected  String[] getDefaultIncludes()
           
 Boolean getFailIfNoSpecifiedTests()
           
 int getForkedProcessTimeoutInSeconds()
           
 List<String> getIncludes()
           
 double getParallelTestsTimeoutForcedInSeconds()
           
 double getParallelTestsTimeoutInSeconds()
           
protected  String getPluginName()
           
 String getReportFormat()
           
 File getReportsDirectory()
           
protected  int getRerunFailingTestsCount()
           
 File getSummaryFile()
           
 String getTest()
           
 File getTestClassesDirectory()
           
 String getTestMethod()
           
protected  void handleSummary(RunResult summary, Exception firstForkException)
           
 boolean isPrintSummary()
           
 boolean isSkip()
           
 boolean isSkipExec()
          Deprecated. 
protected  boolean isSkipExecution()
           
 boolean isSkipITs()
           
 boolean isSkipTests()
           
 boolean isTestFailureIgnore()
           
 boolean isUseFile()
           
 boolean isUseManifestOnlyJar()
           
 boolean isUseSystemClassLoader()
           
 void setBasedir(File basedir)
           
 void setClassesDirectory(File classesDirectory)
           
 void setDebugForkedProcess(String debugForkedProcess)
           
 void setFailIfNoSpecifiedTests(Boolean failIfNoSpecifiedTests)
           
 void setForkedProcessTimeoutInSeconds(int forkedProcessTimeoutInSeconds)
           
 void setIncludes(List<String> includes)
           
 void setParallelTestsTimeoutForcedInSeconds(double parallelTestsTimeoutForcedInSeconds)
           
 void setParallelTestsTimeoutInSeconds(double parallelTestsTimeoutInSeconds)
           
 void setPrintSummary(boolean printSummary)
           
 void setReportFormat(String reportFormat)
           
 void setReportsDirectory(File reportsDirectory)
           
 void setSkip(boolean skip)
           
 void setSkipExec(boolean skipExec)
          Deprecated. 
 void setSkipITs(boolean skipITs)
           
 void setSkipTests(boolean skipTests)
           
 void setSummaryFile(File summaryFile)
           
 void setTest(String test)
           
 void setTestClassesDirectory(File testClassesDirectory)
           
 void setTestFailureIgnore(boolean testFailureIgnore)
           
 void setUseFile(boolean useFile)
           
 void setUseManifestOnlyJar(boolean useManifestOnlyJar)
           
 void setUseSystemClassLoader(boolean useSystemClassLoader)
           
 
Methods inherited from class org.apache.maven.plugin.surefire.AbstractSurefireMojo
cleanupForkConfiguration, convertWithCoreCount, createCopyAndReplaceForkNumPlaceholder, createForkStarter, createInprocessStarter, createProviders, effectiveIsEnableAssertions, execute, executeAfterPreconditionsChecked, getAdditionalClasspathElements, getArgLine, getArtifactFactory, getArtifactResolver, getClassLoaderConfiguration, getClasspathDependencyExcludes, getClasspathDependencyScopeExclude, getDependenciesToScan, getEffectiveForkCount, getEnvironmentVariables, getExcludedGroups, getExcludes, getExcludesFile, getFailIfNoTests, getForkConfiguration, getForkCount, getForkMode, getGroups, getIncludesFile, getJunitArtifactName, getJvm, getLocalRepository, getMetadataSource, getObjectFactory, getParallel, getPerCoreThreadCount, getPluginArtifactMap, getPluginDescriptor, getProject, getProjectArtifactMap, getProperties, getRemoteRepositories, getReportNameSuffix, getRunOrder, getSession, getStatisticsFileName, getSuiteXmlFiles, getSystemProperties, getSystemPropertiesFile, getSystemPropertyVariables, getTestNGArtifactName, getTestSourceDirectory, getThreadCount, getThreadCountClasses, getThreadCountMethods, getThreadCountSuites, getToolchainManager, getUseUnlimitedThreads, getWorkingDirectory, hasExecutedBefore, isAnyConcurrencySelected, isAnyGroupsSelected, isChildDelegation, isDisableXmlReport, isEnableAssertions, isMavenParallel, isParallelOptimized, isRedirectTestOutputToFile, isReuseForks, isTrimStackTrace, logReportsDirectory, setAdditionalClasspathElements, setArgLine, setArtifactFactory, setArtifactResolver, setChildDelegation, setClasspathDependencyExcludes, setClasspathDependencyScopeExclude, setDependenciesToScan, setDisableXmlReport, setEnableAssertions, setEnvironmentVariables, setExcludedGroups, setExcludes, setFailIfNoTests, setForkMode, setGroups, setJunitArtifactName, setLocalRepository, setMetadataSource, setObjectFactory, setParallel, setParallelOptimized, setPerCoreThreadCount, setPluginArtifactMap, setProject, setProjectArtifactMap, setProperties, setRedirectTestOutputToFile, setRemoteRepositories, setReportNameSuffix, setRunOrder, setSession, setSuiteXmlFiles, setSystemProperties, setSystemPropertiesFile, setSystemPropertyVariables, setTestNGArtifactName, setTestSourceDirectory, setThreadCount, setThreadCountClasses, setThreadCountMethods, setThreadCountSuites, setToolchainManager, setTrimStackTrace, setUseUnlimitedThreads, setWorkingDirectory, showToLog
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rerunFailingTestsCount

@Parameter(property="failsafe.rerunFailingTestsCount",
           defaultValue="0")
protected int rerunFailingTestsCount
The number of times each failing test will be rerun. If set larger than 0, rerun failing tests immediately after they fail. If a failing test passes in any of those reruns, it will be marked as pass and reported as a "flake". However, all the failing attempts will be recorded.

Constructor Detail

IntegrationTestMojo

public IntegrationTestMojo()
Method Detail

getRerunFailingTestsCount

protected int getRerunFailingTestsCount()
Specified by:
getRerunFailingTestsCount in class AbstractSurefireMojo

handleSummary

protected void handleSummary(RunResult summary,
                             Exception firstForkException)
                      throws org.apache.maven.plugin.MojoExecutionException,
                             org.apache.maven.plugin.MojoFailureException
Specified by:
handleSummary in class AbstractSurefireMojo
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

isSkipExecution

protected boolean isSkipExecution()
Specified by:
isSkipExecution in class AbstractSurefireMojo

getPluginName

protected String getPluginName()
Specified by:
getPluginName in class AbstractSurefireMojo

getDefaultIncludes

protected String[] getDefaultIncludes()
Specified by:
getDefaultIncludes in class AbstractSurefireMojo

isSkipTests

public boolean isSkipTests()

setSkipTests

public void setSkipTests(boolean skipTests)

isSkipITs

public boolean isSkipITs()

setSkipITs

public void setSkipITs(boolean skipITs)

isSkipExec

@Deprecated
public boolean isSkipExec()
Deprecated. 


setSkipExec

@Deprecated
public void setSkipExec(boolean skipExec)
Deprecated. 


isSkip

public boolean isSkip()

setSkip

public void setSkip(boolean skip)

getBasedir

public File getBasedir()

setBasedir

public void setBasedir(File basedir)

getTestClassesDirectory

public File getTestClassesDirectory()

setTestClassesDirectory

public void setTestClassesDirectory(File testClassesDirectory)

getClassesDirectory

public File getClassesDirectory()

setClassesDirectory

public void setClassesDirectory(File classesDirectory)

getReportsDirectory

public File getReportsDirectory()

setReportsDirectory

public void setReportsDirectory(File reportsDirectory)

getTest

public String getTest()

setTest

public void setTest(String test)

getTestMethod

public String getTestMethod()
Since:
2.7.3

getSummaryFile

public File getSummaryFile()

setSummaryFile

public void setSummaryFile(File summaryFile)

isPrintSummary

public boolean isPrintSummary()

setPrintSummary

public void setPrintSummary(boolean printSummary)

getReportFormat

public String getReportFormat()

setReportFormat

public void setReportFormat(String reportFormat)

isUseFile

public boolean isUseFile()

setUseFile

public void setUseFile(boolean useFile)

getDebugForkedProcess

public String getDebugForkedProcess()

setDebugForkedProcess

public void setDebugForkedProcess(String debugForkedProcess)

getForkedProcessTimeoutInSeconds

public int getForkedProcessTimeoutInSeconds()

setForkedProcessTimeoutInSeconds

public void setForkedProcessTimeoutInSeconds(int forkedProcessTimeoutInSeconds)

getParallelTestsTimeoutInSeconds

public double getParallelTestsTimeoutInSeconds()

setParallelTestsTimeoutInSeconds

public void setParallelTestsTimeoutInSeconds(double parallelTestsTimeoutInSeconds)

getParallelTestsTimeoutForcedInSeconds

public double getParallelTestsTimeoutForcedInSeconds()

setParallelTestsTimeoutForcedInSeconds

public void setParallelTestsTimeoutForcedInSeconds(double parallelTestsTimeoutForcedInSeconds)

isUseSystemClassLoader

public boolean isUseSystemClassLoader()

setUseSystemClassLoader

public void setUseSystemClassLoader(boolean useSystemClassLoader)

isUseManifestOnlyJar

public boolean isUseManifestOnlyJar()

setUseManifestOnlyJar

public void setUseManifestOnlyJar(boolean useManifestOnlyJar)

isTestFailureIgnore

public boolean isTestFailureIgnore()

setTestFailureIgnore

public void setTestFailureIgnore(boolean testFailureIgnore)

addPluginSpecificChecksumItems

protected void addPluginSpecificChecksumItems(ChecksumCalculator checksum)
Overrides:
addPluginSpecificChecksumItems in class AbstractSurefireMojo

getFailIfNoSpecifiedTests

public Boolean getFailIfNoSpecifiedTests()

setFailIfNoSpecifiedTests

public void setFailIfNoSpecifiedTests(Boolean failIfNoSpecifiedTests)

getIncludes

public List<String> getIncludes()
Specified by:
getIncludes in interface SurefireExecutionParameters
Specified by:
getIncludes in class AbstractSurefireMojo

setIncludes

public void setIncludes(List<String> includes)
Specified by:
setIncludes in interface SurefireExecutionParameters
Specified by:
setIncludes in class AbstractSurefireMojo


Copyright © 2004–2014 The Apache Software Foundation. All rights reserved.