Package org.apache.maven.plugin.failsafe
Class VerifyMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.maven.plugin.failsafe.VerifyMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo,org.apache.maven.plugin.surefire.SurefireReportParameters
@Mojo(name="verify", defaultPhase=VERIFY, requiresProject=true, threadSafe=true) public class VerifyMojo extends org.apache.maven.plugin.AbstractMojo implements org.apache.maven.plugin.surefire.SurefireReportParametersVerify integration tests ran using Surefire.
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.FilebasedirThe base directory of the project being tested.private java.util.Collection<org.apache.maven.surefire.cli.CommandLineOption>cliprivate org.apache.maven.plugin.surefire.log.PluginConsoleLoggerconsoleLoggerprivate java.lang.StringencodingDeprecated.since of 2.20.1private java.lang.BooleanfailIfNoTestsSet this to "true" to cause a failure if there are no tests to run.private org.codehaus.plexus.logging.Loggerloggerprivate java.io.FilereportsDirectoryBase directory where all reports are written to.private org.apache.maven.execution.MavenSessionsessionThe current build session instance.private booleanskipSet this to 'true' to bypass unit tests entirely.private booleanskipExecDeprecated.Use -DskipTests instead.private booleanskipITsSet this to 'true' to skip running integration tests, but still compile them.private booleanskipTestsSet this to 'true' to skip running tests, but still compile them.private java.io.FilesummaryFileThe summary file to read integration test results from.private java.io.File[]summaryFilesAdditional summary files to read integration test results from.private java.io.FiletestClassesDirectoryThe directory containing generated test classes of the project being tested.private booleantestFailureIgnoreSet this to true to ignore a failure during testing.
-
Constructor Summary
Constructors Constructor Description VerifyMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private java.util.Collection<org.apache.maven.surefire.cli.CommandLineOption>commandLineOptions()voidexecute()private booleanexistsSummary()private booleanexistsSummaryFile()private booleanexistsSummaryFiles()java.io.FilegetBasedir()private org.apache.maven.plugin.surefire.log.PluginConsoleLoggergetConsoleLogger()protected java.lang.String[]getDefaultIncludes()java.lang.BooleangetFailIfNoTests()protected java.lang.StringgetPluginName()java.io.FilegetReportsDirectory()java.io.FilegetTestClassesDirectory()booleanisSkip()booleanisSkipExec()Deprecated.booleanisSkipITs()booleanisSkipTests()booleanisTestFailureIgnore()private voidlogDebugOrCliShowErrors(java.lang.String s)private org.apache.maven.surefire.suite.RunResultreadSummary(java.io.File summaryFile)voidsetBasedir(java.io.File basedir)voidsetFailIfNoTests(boolean failIfNoTests)voidsetReportsDirectory(java.io.File reportsDirectory)voidsetSkip(boolean skip)voidsetSkipExec(boolean skipExec)Deprecated.voidsetSkipITs(boolean skipITs)voidsetSkipTests(boolean skipTests)voidsetTestClassesDirectory(java.io.File testClassesDirectory)voidsetTestFailureIgnore(boolean testFailureIgnore)protected booleanverifyParameters()
-
-
-
Field Detail
-
skipTests
@Parameter(property="skipTests") private boolean skipTests
Set this to 'true' to skip running tests, but still compile them. Its use is NOT RECOMMENDED, but quite convenient on occasion.- Since:
- 2.4
-
skipITs
@Parameter(property="skipITs") private boolean skipITs
Set this to 'true' to skip running integration tests, but still compile them. Its use is NOT RECOMMENDED, but quite convenient on occasion.- Since:
- 2.4.3-alpha-2
-
skipExec
@Deprecated @Parameter(property="maven.test.skip.exec") private boolean skipExec
Deprecated.Use -DskipTests instead.This old parameter is just like skipTests, but bound to the old property maven.test.skip.exec.- Since:
- 2.3
-
skip
@Parameter(property="maven.test.skip", defaultValue="false") private boolean skipSet this to 'true' to bypass unit tests entirely. Its use is NOT RECOMMENDED, especially if you enable it using the "maven.test.skip" property, because maven.test.skip disables both running the tests and compiling the tests. Consider using the skipTests parameter instead.
-
testFailureIgnore
@Parameter(property="maven.test.failure.ignore", defaultValue="false") private boolean testFailureIgnoreSet this to true to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion.
-
basedir
@Parameter(defaultValue="${basedir}") private java.io.File basedirThe base directory of the project being tested. This can be obtained in your unit test by System.getProperty("basedir").
-
testClassesDirectory
@Parameter(defaultValue="${project.build.testOutputDirectory}") private java.io.File testClassesDirectoryThe directory containing generated test classes of the project being tested. This will be included at the beginning the test classpath.
-
reportsDirectory
@Parameter(defaultValue="${project.build.directory}/failsafe-reports") private java.io.File reportsDirectoryBase directory where all reports are written to.
-
summaryFile
@Parameter(defaultValue="${project.build.directory}/failsafe-reports/failsafe-summary.xml", required=true) private java.io.File summaryFileThe summary file to read integration test results from.
-
summaryFiles
@Parameter private java.io.File[] summaryFiles
Additional summary files to read integration test results from.- Since:
- 2.6
-
failIfNoTests
@Parameter(property="failIfNoTests") private java.lang.Boolean failIfNoTests
Set this to "true" to cause a failure if there are no tests to run.- Since:
- 2.4
-
encoding
@Parameter(property="encoding", defaultValue="${project.reporting.outputEncoding}") private java.lang.String encodingDeprecated.since of 2.20.1The character encoding scheme to be applied. Deprecated since 2.20.1 and used encoding UTF-8 in failsafe-summary.xml.
-
session
@Component private org.apache.maven.execution.MavenSession session
The current build session instance.
-
logger
@Component private org.codehaus.plexus.logging.Logger logger
-
cli
private java.util.Collection<org.apache.maven.surefire.cli.CommandLineOption> cli
-
consoleLogger
private volatile org.apache.maven.plugin.surefire.log.PluginConsoleLogger consoleLogger
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Specified by:
executein interfaceorg.apache.maven.plugin.Mojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
getConsoleLogger
private org.apache.maven.plugin.surefire.log.PluginConsoleLogger getConsoleLogger()
-
readSummary
private org.apache.maven.surefire.suite.RunResult readSummary(java.io.File summaryFile) throws java.lang.Exception- Throws:
java.lang.Exception
-
verifyParameters
protected boolean verifyParameters() throws org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoFailureException
-
getPluginName
protected java.lang.String getPluginName()
-
getDefaultIncludes
protected java.lang.String[] getDefaultIncludes()
-
isSkipTests
public boolean isSkipTests()
- Specified by:
isSkipTestsin interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
setSkipTests
public void setSkipTests(boolean skipTests)
- Specified by:
setSkipTestsin interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
isSkipITs
public boolean isSkipITs()
-
setSkipITs
public void setSkipITs(boolean skipITs)
-
isSkipExec
@Deprecated public boolean isSkipExec()
Deprecated.- Specified by:
isSkipExecin interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
setSkipExec
@Deprecated public void setSkipExec(boolean skipExec)
Deprecated.- Specified by:
setSkipExecin interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
isSkip
public boolean isSkip()
- Specified by:
isSkipin interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
setSkip
public void setSkip(boolean skip)
- Specified by:
setSkipin interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
isTestFailureIgnore
public boolean isTestFailureIgnore()
- Specified by:
isTestFailureIgnorein interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
setTestFailureIgnore
public void setTestFailureIgnore(boolean testFailureIgnore)
- Specified by:
setTestFailureIgnorein interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
getBasedir
public java.io.File getBasedir()
- Specified by:
getBasedirin interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
setBasedir
public void setBasedir(java.io.File basedir)
- Specified by:
setBasedirin interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
getTestClassesDirectory
public java.io.File getTestClassesDirectory()
- Specified by:
getTestClassesDirectoryin interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
setTestClassesDirectory
public void setTestClassesDirectory(java.io.File testClassesDirectory)
- Specified by:
setTestClassesDirectoryin interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
getReportsDirectory
public java.io.File getReportsDirectory()
- Specified by:
getReportsDirectoryin interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
setReportsDirectory
public void setReportsDirectory(java.io.File reportsDirectory)
- Specified by:
setReportsDirectoryin interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
getFailIfNoTests
public java.lang.Boolean getFailIfNoTests()
- Specified by:
getFailIfNoTestsin interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
setFailIfNoTests
public void setFailIfNoTests(boolean failIfNoTests)
- Specified by:
setFailIfNoTestsin interfaceorg.apache.maven.plugin.surefire.SurefireReportParameters
-
existsSummaryFile
private boolean existsSummaryFile()
-
existsSummaryFiles
private boolean existsSummaryFiles()
-
existsSummary
private boolean existsSummary()
-
commandLineOptions
private java.util.Collection<org.apache.maven.surefire.cli.CommandLineOption> commandLineOptions()
-
logDebugOrCliShowErrors
private void logDebugOrCliShowErrors(java.lang.String s)
-
-