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,SurefireReportParameters
@Mojo(name="verify",
defaultPhase=VERIFY,
requiresProject=true,
threadSafe=true)
public class VerifyMojo
extends org.apache.maven.plugin.AbstractMojo
implements SurefireReportParameters
Verify integration tests ran using Surefire.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FileThe base directory of the project being tested.private Collection<CommandLineOption> private PluginConsoleLoggerprivate StringDeprecated.since of 2.20.1private booleanSet this to "true" to cause a failure if there are no tests to run.private intSet this to a value greater than 0 to fail the whole test set if the cumulative number of flakes reaches this threshold.private org.codehaus.plexus.logging.Loggerprivate FileBase directory where all reports are written to.private org.apache.maven.execution.MavenSessionThe current build session instance.private booleanSet this to 'true' to bypass unit tests entirely.private booleanDeprecated.Use -DskipTests instead.private booleanSet this to 'true' to skip running integration tests, but still compile them.private booleanSet this to 'true' to skip running tests, but still compile them.private FileThe summary file to read integration test results from.private File[]Additional summary files to read integration test results from.private FileThe directory containing generated test classes of the project being tested.private booleanSet this to true to ignore a failure during testing.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Collection<CommandLineOption> voidexecute()private booleanprivate booleanprivate booleanprivate ExceptiongetBooterForkException(RunResult summary) private PluginConsoleLoggerprotected String[]booleanintprotected Stringorg.apache.maven.execution.MavenSessionbooleanisSkip()booleanDeprecated.booleanbooleanbooleanprivate voidprivate RunResultreadSummary(File summaryFile) voidsetBasedir(File basedir) voidsetFailIfNoTests(boolean failIfNoTests) voidsetFailOnFlakeCount(int failOnFlakeCount) (package private) voidsetLogger(org.codehaus.plexus.logging.Logger logger) voidsetReportsDirectory(File reportsDirectory) voidsetSession(org.apache.maven.execution.MavenSession session) voidsetSkip(boolean skip) voidsetSkipExec(boolean skipExec) Deprecated.voidsetSkipITs(boolean skipITs) voidsetSkipTests(boolean skipTests) voidsetSummaryFile(File summaryFile) voidsetTestClassesDirectory(File testClassesDirectory) voidsetTestFailureIgnore(boolean testFailureIgnore) protected booleanMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
skipTests
@Parameter(property="skipTests") private boolean skipTestsSet 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 skipITsSet 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.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
The base directory of the project being tested. This can be obtained in your unit test by System.getProperty("basedir"). -
testClassesDirectory
The 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 File reportsDirectoryBase directory where all reports are written to. -
summaryFile
@Parameter(defaultValue="${project.build.directory}/failsafe-reports/failsafe-summary.xml", required=true) private File summaryFileThe summary file to read integration test results from. -
summaryFiles
Additional summary files to read integration test results from.- Since:
- 2.6
-
failIfNoTests
@Parameter(property="failIfNoTests", defaultValue="false") private boolean failIfNoTestsSet this to "true" to cause a failure if there are no tests to run. Defaults to "false".- Since:
- 2.4
-
failOnFlakeCount
@Parameter(property="failsafe.failOnFlakeCount", defaultValue="0") private int failOnFlakeCountSet this to a value greater than 0 to fail the whole test set if the cumulative number of flakes reaches this threshold. Set to 0 to allow an unlimited number of flakes.- Since:
- 3.0.0-M6
-
encoding
@Parameter(property="encoding", defaultValue="${project.reporting.outputEncoding}") private String encodingDeprecated.since of 2.20.1The character encoding scheme to be applied. Deprecated since 2.20.1 and used encoding UTF-8 infailsafe-summary.xml. -
session
@Parameter(defaultValue="${session}", readonly=true) private org.apache.maven.execution.MavenSession sessionThe current build session instance. -
logger
@Component private org.codehaus.plexus.logging.Logger logger -
cli
-
consoleLogger
-
-
Constructor Details
-
VerifyMojo
public VerifyMojo()
-
-
Method Details
-
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
-
getBooterForkException
-
setLogger
void setLogger(org.codehaus.plexus.logging.Logger logger) -
getConsoleLogger
-
readSummary
- Throws:
Exception
-
verifyParameters
protected boolean verifyParameters() throws org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoFailureException
-
getPluginName
-
getDefaultIncludes
-
isSkipTests
public boolean isSkipTests()- Specified by:
isSkipTestsin interfaceSurefireReportParameters
-
setSkipTests
public void setSkipTests(boolean skipTests) - Specified by:
setSkipTestsin interfaceSurefireReportParameters
-
isSkipITs
public boolean isSkipITs() -
setSkipITs
public void setSkipITs(boolean skipITs) -
isSkipExec
Deprecated.- Specified by:
isSkipExecin interfaceSurefireReportParameters
-
setSkipExec
Deprecated.- Specified by:
setSkipExecin interfaceSurefireReportParameters
-
isSkip
public boolean isSkip()- Specified by:
isSkipin interfaceSurefireReportParameters
-
setSkip
public void setSkip(boolean skip) - Specified by:
setSkipin interfaceSurefireReportParameters
-
isTestFailureIgnore
public boolean isTestFailureIgnore()- Specified by:
isTestFailureIgnorein interfaceSurefireReportParameters
-
setTestFailureIgnore
public void setTestFailureIgnore(boolean testFailureIgnore) - Specified by:
setTestFailureIgnorein interfaceSurefireReportParameters
-
getBasedir
- Specified by:
getBasedirin interfaceSurefireReportParameters
-
setBasedir
- Specified by:
setBasedirin interfaceSurefireReportParameters
-
getTestClassesDirectory
- Specified by:
getTestClassesDirectoryin interfaceSurefireReportParameters
-
setTestClassesDirectory
- Specified by:
setTestClassesDirectoryin interfaceSurefireReportParameters
-
getReportsDirectory
- Specified by:
getReportsDirectoryin interfaceSurefireReportParameters
-
setReportsDirectory
- Specified by:
setReportsDirectoryin interfaceSurefireReportParameters
-
getSummaryFile
-
setSummaryFile
-
getFailIfNoTests
public boolean getFailIfNoTests()- Specified by:
getFailIfNoTestsin interfaceSurefireReportParameters
-
setFailIfNoTests
public void setFailIfNoTests(boolean failIfNoTests) - Specified by:
setFailIfNoTestsin interfaceSurefireReportParameters
-
getFailOnFlakeCount
public int getFailOnFlakeCount()- Specified by:
getFailOnFlakeCountin interfaceSurefireReportParameters
-
setFailOnFlakeCount
public void setFailOnFlakeCount(int failOnFlakeCount) - Specified by:
setFailOnFlakeCountin interfaceSurefireReportParameters
-
getSession
public org.apache.maven.execution.MavenSession getSession() -
setSession
public void setSession(org.apache.maven.execution.MavenSession session) -
existsSummaryFile
private boolean existsSummaryFile() -
existsSummaryFiles
private boolean existsSummaryFiles() -
existsSummary
private boolean existsSummary() -
commandLineOptions
-
logDebugOrCliShowErrors
-