View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.plugin.surefire;
20  
21  import java.io.File;
22  import java.util.List;
23  
24  import org.apache.maven.plugin.MojoExecutionException;
25  import org.apache.maven.plugin.MojoFailureException;
26  import org.apache.maven.plugin.surefire.booterclient.ChecksumCalculator;
27  import org.apache.maven.plugins.annotations.LifecyclePhase;
28  import org.apache.maven.plugins.annotations.Mojo;
29  import org.apache.maven.plugins.annotations.Parameter;
30  import org.apache.maven.plugins.annotations.ResolutionScope;
31  import org.apache.maven.surefire.api.suite.RunResult;
32  import org.apache.maven.surefire.extensions.ForkNodeFactory;
33  
34  import static org.apache.maven.plugin.surefire.SurefireHelper.reportExecution;
35  
36  /**
37   * Run tests using Surefire.
38   *
39   * @author Jason van Zyl
40   */
41  @Mojo(
42          name = "test",
43          defaultPhase = LifecyclePhase.TEST,
44          threadSafe = true,
45          requiresDependencyResolution = ResolutionScope.TEST)
46  public class SurefireMojo extends AbstractSurefireMojo implements SurefireReportParameters {
47  
48      /**
49       * The directory containing generated classes of the project being tested. This will be included after the test
50       * classes in the test classpath.
51       */
52      @Parameter(defaultValue = "${project.build.outputDirectory}")
53      private File classesDirectory;
54  
55      /**
56       * Set this to "true" to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on
57       * occasion.
58       */
59      @Parameter(property = "maven.test.failure.ignore", defaultValue = "false")
60      private boolean testFailureIgnore;
61  
62      /**
63       * Base directory where all reports are written to.
64       */
65      @Parameter(defaultValue = "${project.build.directory}/surefire-reports")
66      private File reportsDirectory;
67  
68      @SuppressWarnings("checkstyle:linelength")
69      /**
70       * Specify this parameter to run individual tests by file name, overriding the parameter {@code includes} and
71       * {@code excludes}. Each pattern you specify here will be used to create an include pattern formatted like
72       * <code>**{@literal /}${test}.java</code>, so you can just type {@code -Dtest=MyTest} to run a single test called
73       * "foo/MyTest.java". The test patterns prefixed with a <em>!</em> will be excluded.
74       * <br>
75       * This parameter overrides the parameter {@code includes}, {@code excludes}.
76       * <br>
77       * Since 2.7.3, you can execute a limited number of methods in the test by adding <i>#myMethod</i> or
78       * <i>#my*ethod</i>. For example, {@code -Dtest=MyTest#myMethod}. This is supported for junit 4.x and TestNg.<br>
79       * <br>
80       * Since 2.19 a complex syntax is supported in one parameter:
81       * <pre><code>"-Dtest=???Test, !Unstable*, pkg{@literal /}**{@literal /}Ci*leTest.java, *Test#test*One+testTwo?????, #fast*+slowTest"</code></pre>
82       * or e.g.
83       * <pre><code>"-Dtest=Basic*, !%regex[.*.Unstable.*], !%regex[.*.MyTest.class#one.*|two.*], %regex[#fast.*|slow.*]"</code></pre>
84       * <br>
85       * The Parameterized JUnit runner {@code describes} test methods using an index in brackets, so the non-regex
86       * method pattern would become: {@code #testMethod[*]}.
87       * If using <code>@Parameters(name="{index}: fib({0})={1}")</code> and selecting the index e.g. 5 in pattern, the
88       * non-regex method pattern would become {@code #testMethod[5:*]}.
89       */
90      @Parameter(property = "test")
91      private String test;
92  
93      /**
94       * Option to print summary of test suites or just print the test cases that have errors.
95       */
96      @Parameter(property = "surefire.printSummary", defaultValue = "true")
97      private boolean printSummary;
98  
99      /**
100      * Selects the formatting for the test report to be generated. Can be set as "brief" or "plain".
101      * Only applies to the output format of the output files  (target/surefire-reports/testName.txt)
102      */
103     @Parameter(property = "surefire.reportFormat", defaultValue = "brief")
104     private String reportFormat;
105 
106     /**
107      * Option to generate a file test report or just output the test report to the console.
108      */
109     @Parameter(property = "surefire.useFile", defaultValue = "true")
110     private boolean useFile;
111 
112     /**
113      * Set this to "true" to cause a failure if none of the tests specified in -Dtest=... are run. Defaults to
114      * "true".
115      *
116      * @since 2.12
117      */
118     @Parameter(property = "surefire.failIfNoSpecifiedTests", defaultValue = "true")
119     private boolean failIfNoSpecifiedTests;
120 
121     /**
122      * Attach a debugger to the forked JVM. If set to "true", the process will suspend and wait for a debugger to attach
123      * on port 5005. If set to some other string, that string will be appended to the argLine, allowing you to configure
124      * arbitrary debuggability options (without overwriting the other options specified through the {@code argLine}
125      * parameter).
126      *
127      * @since 2.4
128      */
129     @Parameter(property = "maven.surefire.debug")
130     private String debugForkedProcess;
131 
132     /**
133      * Kill the forked test process after a certain number of seconds. If set to 0, wait forever for the process, never
134      * timing out.
135      *
136      * @since 2.4
137      */
138     @Parameter(property = "surefire.timeout")
139     private int forkedProcessTimeoutInSeconds;
140 
141     /**
142      * Forked process is normally terminated without any significant delay after given tests have completed.
143      * If the particular tests started non-daemon Thread(s), the process hangs instead of been properly terminated
144      * by {@code System.exit()}. Use this parameter in order to determine the timeout of terminating the process.
145      * <a href="http://maven.apache.org/surefire/maven-surefire-plugin/examples/shutdown.html">see the documentation:
146      * http://maven.apache.org/surefire/maven-surefire-plugin/examples/shutdown.html</a>
147      * Turns to default fallback value of 30 seconds if negative integer.
148      *
149      * @since 2.20
150      */
151     @Parameter(property = "surefire.exitTimeout", defaultValue = "30")
152     private int forkedProcessExitTimeoutInSeconds;
153 
154     /**
155      * Stop executing queued parallel JUnit tests after a certain number of seconds.
156      * <br>
157      * Example values: "3.5", "4"<br>
158      * <br>
159      * If set to 0, wait forever, never timing out.
160      * Makes sense with specified {@code parallel} different from "none".
161      *
162      * @since 2.16
163      */
164     @Parameter(property = "surefire.parallel.timeout")
165     private double parallelTestsTimeoutInSeconds;
166 
167     /**
168      * Stop executing queued parallel JUnit tests
169      * and {@code interrupt} currently running tests after a certain number of seconds.
170      * <br>
171      * Example values: "3.5", "4"<br>
172      * <br>
173      * If set to 0, wait forever, never timing out.
174      * Makes sense with specified {@code parallel} different from "none".
175      *
176      * @since 2.16
177      */
178     @Parameter(property = "surefire.parallel.forcedTimeout")
179     private double parallelTestsTimeoutForcedInSeconds;
180 
181     @SuppressWarnings("checkstyle:linelength")
182     /**
183      * A list of {@literal <include>} elements specifying the tests (by pattern) that should be included in testing.
184      * When not specified and when the {@code test} parameter is not specified, the default includes will be
185      * <pre><code>
186      * {@literal <includes>}
187      *     {@literal <include>}**{@literal /}Test*.java{@literal </include>}
188      *     {@literal <include>}**{@literal /}*Test.java{@literal </include>}
189      *     {@literal <include>}**{@literal /}*Tests.java{@literal </include>}
190      *     {@literal <include>}**{@literal /}*TestCase.java{@literal </include>}
191      * {@literal </includes>}
192      * </code></pre>
193      * Each include item may also contain a comma-separated sub-list of items, which will be treated as multiple
194      * {@literal <include>} entries.<br>
195      * Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG):
196      * <pre><code>
197      * {@literal <include>}%regex[.*[Cat|Dog].*], Basic????, !Unstable*{@literal </include>}
198      * {@literal <include>}%regex[.*[Cat|Dog].*], !%regex[pkg.*Slow.*.class], pkg{@literal /}**{@literal /}*Fast*.java{@literal </include>}
199      * </code></pre>
200      * <br>
201      * <br>
202      * <b>Notice that</b> these values are relative to the directory containing generated test classes of the project
203      * being tested. This directory is declared by the parameter {@code testClassesDirectory} which defaults
204      * to the POM property {@code ${project.build.testOutputDirectory}}, typically
205      * <code>{@literal src/test/java}</code> unless overridden.
206      */
207     @Parameter(property = "surefire.includes")
208     // TODO use regex for fully qualified class names in 3.0 and change the filtering abilities
209     private List<String> includes;
210 
211     /**
212      * A list of {@literal <exclude>} elements specifying the tests (by pattern) that should be excluded in testing.
213      * When not specified and when the {@code test} parameter is not specified, the default excludes will be <br>
214      * <pre><code>
215      * {@literal <excludes>}
216      *     {@literal <exclude>}**{@literal /}*$*{@literal </exclude>}
217      * {@literal </excludes>}
218      * </code></pre>
219      * (which excludes all inner classes).
220      * <br>
221      * Each exclude item may also contain a comma-separated sub-list of items, which will be treated as multiple
222      * {@literal <exclude>} entries.<br>
223      * Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG):
224      * <pre><code>
225      * {@literal <exclude>}%regex[pkg.*Slow.*.class], Unstable*{@literal </exclude>}
226      * </code></pre>
227      * <br>
228      * <b>Notice that</b> these values are relative to the directory containing generated test classes of the project
229      * being tested. This directory is declared by the parameter {@code testClassesDirectory} which defaults
230      * to the POM property <code>${project.build.testOutputDirectory}</code>, typically
231      * <code>{@literal src/test/java}</code> unless overridden.
232      */
233     @Parameter(property = "surefire.excludes")
234     // TODO use regex for fully qualified class names in 3.0 and change the filtering abilities
235     private List<String> excludes;
236 
237     /**
238      * Option to pass dependencies to the system's classloader instead of using an isolated class loader when forking.
239      * Prevents problems with JDKs which implement the service provider lookup mechanism by using the system's
240      * ClassLoader.
241      *
242      * @since 2.3
243      */
244     @Parameter(property = "surefire.useSystemClassLoader", defaultValue = "true")
245     private boolean useSystemClassLoader;
246 
247     /**
248      * By default, Surefire forks your tests using a manifest-only JAR; set this parameter to "false" to force it to
249      * launch your tests with a plain old Java classpath. (See the
250      * <a href="http://maven.apache.org/plugins/maven-surefire-plugin/examples/class-loading.html">
251      *     http://maven.apache.org/plugins/maven-surefire-plugin/examples/class-loading.html</a>
252      * for a more detailed explanation of manifest-only JARs and their benefits.)
253      * <br>
254      * Beware, setting this to "false" may cause your tests to fail on Windows if your classpath is too long.
255      *
256      * @since 2.4.3
257      */
258     @Parameter(property = "surefire.useManifestOnlyJar", defaultValue = "true")
259     private boolean useManifestOnlyJar;
260 
261     /**
262      * The character encoding scheme to be applied while generating test report
263      * files (see target/surefire-reports/yourTestName.txt).
264      * The report output files (*-out.txt) are encoded in UTF-8 if not set otherwise.
265      *
266      * @since 3.0.0-M1
267      */
268     @Parameter(property = "surefire.encoding", defaultValue = "${project.reporting.outputEncoding}")
269     private String encoding;
270 
271     /**
272      * (JUnit 4+ providers and JUnit 5+ providers since 3.0.0-M4)
273      * The number of times each failing test will be rerun. If set larger than 0, rerun failing tests immediately after
274      * they fail. If a failing test passes in any of those reruns, it will be marked as pass and reported as a "flake".
275      * However, all the failing attempts will be recorded.
276      */
277     @Parameter(property = "surefire.rerunFailingTestsCount", defaultValue = "0")
278     private int rerunFailingTestsCount;
279 
280     /**
281      * Set this to a value greater than 0 to fail the whole test set if the cumulative number of flakes reaches
282      * this threshold. Set to 0 to allow an unlimited number of flakes.
283      *
284      * @since 3.0.0-M6
285      */
286     @Parameter(property = "surefire.failOnFlakeCount", defaultValue = "0")
287     private int failOnFlakeCount;
288 
289     /**
290      * @deprecated not supported after 3.6.0, please use groups or Junit suite support
291      * (TestNG) List of &lt;suiteXmlFile&gt; elements specifying TestNG suite xml file locations. Note that
292      * {@code suiteXmlFiles} is incompatible with several other parameters of this plugin, like
293      * {@code includes} and {@code excludes}.<br>
294      * This parameter is ignored if the {@code test} parameter is specified (allowing you to run a single test
295      * instead of an entire suite).
296      *
297      * @since 2.2
298      */
299     @Deprecated
300     @Parameter(property = "surefire.suiteXmlFiles")
301     private File[] suiteXmlFiles;
302 
303     /**
304      * Defines the order the tests will be run in. Supported values are {@code alphabetical},
305      * {@code reversealphabetical}, {@code random}, {@code failedfirst}, {@code balanced} and {@code filesystem}.
306      * <br>
307      * <br>
308      * Failed first will run tests that failed on previous run first, as well as new tests for this run.
309      * <br>
310      * <br>
311      * Balanced is only relevant with parallel=classes, and will try to optimize the run-order of the tests reducing the
312      * overall execution time. Initially a statistics file is created and every next test run will reorder classes.
313      * <br>
314      * <br>
315      * Note that the statistics are stored in a file named <b>.surefire-XXXXXXXXX</b> beside <i>pom.xml</i> and
316      * should not be checked into version control. The "XXXXX" is the SHA1 checksum of the entire surefire
317      * configuration, so different configurations will have different statistics files, meaning if you change any
318      * configuration settings you will re-run once before new statistics data can be established.
319      *
320      * @since 2.7
321      */
322     @Parameter(property = "surefire.runOrder", defaultValue = "filesystem")
323     private String runOrder;
324 
325     /**
326      * Sets the random seed that will be used to order the tests if {@code surefire.runOrder} is set to {@code random}.
327      * <br>
328      * <br>
329      * If no seeds are set and {@code surefire.runOrder} is set to {@code random}, then the seed used will be
330      * outputted (search for "To reproduce ordering use flag -Dsurefire.runOrder.random.seed").
331      * <br>
332      * <br>
333      * To deterministically reproduce any random test order that was run before, simply set the seed to
334      * be the same value.
335      *
336      * @since 3.0.0-M6
337      */
338     @Parameter(property = "surefire.runOrder.random.seed")
339     private Long runOrderRandomSeed;
340 
341     /**
342      * Used to override the checksum in the name of the statistics file
343      * when {@code surefire.runOrder} is set to "balanced".
344      *
345      * @since 3.5.5
346      */
347     @Parameter(property = "surefire.runOrder.statisticsFile.checksum")
348     private String runOrderStatisticsFileChecksum;
349 
350     /**
351      * A file containing include patterns. Blank lines, or lines starting with # are ignored. If {@code includes} are
352      * also specified, these patterns are appended. Example with path, simple and regex includes:
353      * <pre><code>
354      * *{@literal /}test{@literal /}*
355      * **{@literal /}NotIncludedByDefault.java
356      * %regex[.*Test.*|.*Not.*]
357      * </code></pre>
358      * <br>
359      * Since 3.0.0-M6, method filtering support is provided in the inclusions file as well, example:
360      * <pre><code>
361      * pkg.SomeTest#testMethod
362      * </code></pre>
363      *
364      * @since 2.13
365      */
366     @Parameter(property = "surefire.includesFile")
367     private File includesFile;
368 
369     /**
370      * A file containing exclude patterns. Blank lines, or lines starting with # are ignored. If {@code excludes} are
371      * also specified, these patterns are appended. Example with path, simple and regex excludes:<br>
372      * <pre><code>
373      * *{@literal /}test{@literal /}*
374      * **{@literal /}DontRunTest.*
375      * %regex[.*Test.*|.*Not.*]
376      * </code></pre>
377      *
378      * Since 3.0.0-M6, method filtering support is provided in the exclusions file as well, example:
379      * <pre><code>
380      * pkg.SomeTest#testMethod
381      * </code></pre>
382      *
383      * @since 2.13
384      */
385     @Parameter(property = "surefire.excludesFile")
386     private File excludesFile;
387 
388     /**
389      * Set to error/failure count in order to skip remaining tests.
390      * Due to race conditions in parallel/forked execution this may not be fully guaranteed.<br>
391      * Enable with system property {@code -Dsurefire.skipAfterFailureCount=1} or any number greater than zero.
392      * Defaults to "0".<br>
393      * See the prerequisites and limitations in documentation:<br>
394      * <a href="http://maven.apache.org/plugins/maven-surefire-plugin/examples/skip-after-failure.html">
395      *     http://maven.apache.org/plugins/maven-surefire-plugin/examples/skip-after-failure.html</a>
396      *
397      * @since 2.19
398      */
399     @Parameter(property = "surefire.skipAfterFailureCount", defaultValue = "0")
400     private int skipAfterFailureCount;
401 
402     /**
403      * After the plugin process is shutdown by sending <i>SIGTERM signal (CTRL+C)</i>, <i>SHUTDOWN command</i> is
404      * received by every forked JVM.
405      * <br>
406      * The value is set to ({@code shutdown=exit}) by default (changed in version 3.0.0-M4).
407      * <br>
408      * The parameter can be configured with other two values {@code testset} and {@code kill}.
409      * <br>
410      * With({@code shutdown=testset}) the test set may still continue to run in forked JVM.
411      * <br>
412      * Using {@code exit} forked JVM executes {@code System.exit(1)} after the plugin process has received
413      * <i>SIGTERM signal</i>.
414      * <br>
415      * Using {@code kill} the JVM executes {@code Runtime.halt(1)} and kills itself.
416      *
417      * @since 2.19
418      */
419     @Parameter(property = "surefire.shutdown", defaultValue = "exit")
420     private String shutdown;
421 
422     /**
423      * When {@code true}, uses the modulepath when executing with JDK 9+ and <i>module-info.java</i> is
424      * present. When {@code false}, always uses the classpath.
425      * <br>
426      * Defaults to {@code true}.
427      *
428      * @since 3.0.0-M2
429      */
430     @Parameter(property = "surefire.useModulePath", defaultValue = "true")
431     private boolean useModulePath;
432 
433     /**
434      * This parameter configures the forked node. Currently, you can select the communication protocol, i.e. process
435      * pipes or TCP/IP sockets.
436      * The plugin uses process pipes by default which will be turned to TCP/IP in the version 3.0.0.
437      * Alternatively, you can implement your own factory and SPI.
438      * <br>
439      * See the documentation for more details:<br>
440      * <a href="https://maven.apache.org/plugins/maven-surefire-plugin/examples/process-communication.html">
441      *     https://maven.apache.org/plugins/maven-surefire-plugin/examples/process-communication.html</a>
442      *
443      * @since 3.0.0-M5
444      */
445     @Parameter(property = "surefire.forkNode")
446     private ForkNodeFactory forkNode;
447 
448     /**
449      * You can selectively exclude individual environment variables by enumerating their keys.
450      * <br>
451      * The environment is a system-dependent mapping from keys to values which is inherited from the Maven process
452      * to the forked Surefire processes. The keys must literally (case sensitive) match in order to exclude
453      * their environment variable.
454      * <br>
455      * Example to exclude three environment variables:
456      * <br>
457      * <i>mvn test -Dsurefire.excludedEnvironmentVariables=ACME1,ACME2,ACME3</i>
458      *
459      * @since 3.0.0-M4
460      */
461     @Parameter(property = "surefire.excludedEnvironmentVariables")
462     private String[] excludedEnvironmentVariables;
463 
464     /**
465      * Since 3.0.0-M4 the process checkers are disabled.
466      * You can enable them namely by setting {@code ping} and {@code native} or {@code all} in this parameter.
467      * <br>
468      * The checker is useful in situations when you kill the build on a CI system and you want the Surefire forked JVM
469      * to kill the tests asap and free all handlers on the file system been previously used by the JVM and by the tests.
470      *
471      * <br>
472      *
473      * The {@code ping} should be safely used together with ZGC or Shenandoah Garbage Collector.
474      * Due to the {@code ping} relies on timing of the PING (triggered every 30 seconds), slow GCs may pause
475      * the timers and pretend that the parent process of the forked JVM does not exist.
476      *
477      * <br>
478      *
479      * The {@code native} is very fast checker.
480      * It is useful mechanism on Unix based systems, Linux distributions and Alpine/BusyBox Linux.
481      * See the JIRA <a href="https://issues.apache.org/jira/browse/SUREFIRE-1631">SUREFIRE-1631</a> for Windows issues.
482      *
483      * <br>
484      *
485      * Another useful configuration parameter is {@code forkedProcessTimeoutInSeconds}.
486      * <br>
487      * See the Frequently Asked Questions page with more details:<br>
488      * <a href="http://maven.apache.org/surefire/maven-surefire-plugin/faq.html#kill-jvm">
489      *     http://maven.apache.org/surefire/maven-surefire-plugin/faq.html#kill-jvm</a>
490      * <br>
491      * <a href="http://maven.apache.org/surefire/maven-failsafe-plugin/faq.html#kill-jvm">
492      *     http://maven.apache.org/surefire/maven-failsafe-plugin/faq.html#kill-jvm</a>
493      *
494      * <br>
495      *
496      * Example of use:
497      * <br>
498      * <i>mvn test -Dsurefire.enableProcessChecker=all</i>
499      *
500      * @since 3.0.0-M4
501      */
502     @Parameter(property = "surefire.enableProcessChecker")
503     private String enableProcessChecker;
504 
505     /**
506      * Properties file being used as system properties passed to the provider.
507      *
508      * @see AbstractSurefireMojo#systemPropertyVariables {@code systemPropertyVariables} for how the effective provider properties are calculated
509      */
510     @Parameter(property = "surefire.systemPropertiesFile")
511     private File systemPropertiesFile;
512 
513     /**
514      * Provide the ID/s of an JUnit engine to be included in the test run.
515      *
516      * @since 3.0.0-M6
517      */
518     @Parameter(property = "surefire.includeJUnit5Engines")
519     private String[] includeJUnit5Engines;
520 
521     /**
522      * Provide the ID/s of an JUnit engine to be excluded in the test run.
523      *
524      * @since 3.0.0-M6
525      */
526     @Parameter(property = "surefire.excludeJUnit5Engines")
527     private String[] excludeJUnit5Engines;
528 
529     @Override
530     protected int getRerunFailingTestsCount() {
531         return rerunFailingTestsCount;
532     }
533 
534     @Override
535     public int getFailOnFlakeCount() {
536         return failOnFlakeCount;
537     }
538 
539     @Override
540     public void setFailOnFlakeCount(int failOnFlakeCount) {
541         this.failOnFlakeCount = failOnFlakeCount;
542     }
543 
544     @Override
545     protected void handleSummary(RunResult summary, Exception firstForkException)
546             throws MojoExecutionException, MojoFailureException {
547         reportExecution(this, summary, getConsoleLogger(), firstForkException);
548     }
549 
550     @Override
551     protected boolean isSkipExecution() {
552         return isSkip() || isSkipTests() || isSkipExec();
553     }
554 
555     @Override
556     protected String getPluginName() {
557         return "surefire";
558     }
559 
560     @Override
561     protected String[] getDefaultIncludes() {
562         return new String[] {"**/Test*.java", "**/*Test.java", "**/*Tests.java", "**/*TestCase.java"};
563     }
564 
565     @Override
566     protected String getReportSchemaLocation() {
567         return "https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd";
568     }
569 
570     public File getSystemPropertiesFile() {
571         return systemPropertiesFile;
572     }
573 
574     public void setSystemPropertiesFile(File systemPropertiesFile) {
575         this.systemPropertiesFile = systemPropertiesFile;
576     }
577 
578     // now for the implementation of the field accessors
579 
580     @Override
581     public boolean isSkipTests() {
582         return skipTests;
583     }
584 
585     @Override
586     public void setSkipTests(boolean skipTests) {
587         this.skipTests = skipTests;
588     }
589 
590     @Override
591     @Deprecated
592     public boolean isSkipExec() {
593         return skipExec;
594     }
595 
596     @Override
597     @Deprecated
598     public void setSkipExec(boolean skipExec) {
599         this.skipExec = skipExec;
600     }
601 
602     @Override
603     public boolean isSkip() {
604         return skip;
605     }
606 
607     @Override
608     public void setSkip(boolean skip) {
609         this.skip = skip;
610     }
611 
612     @Override
613     public boolean isTestFailureIgnore() {
614         return testFailureIgnore;
615     }
616 
617     @Override
618     public void setTestFailureIgnore(boolean testFailureIgnore) {
619         this.testFailureIgnore = testFailureIgnore;
620     }
621 
622     @Override
623     public File getBasedir() {
624         return basedir;
625     }
626 
627     @Override
628     public void setBasedir(File basedir) {
629         this.basedir = basedir;
630     }
631 
632     @Override
633     public File getTestClassesDirectory() {
634         return testClassesDirectory;
635     }
636 
637     @Override
638     public void setTestClassesDirectory(File testClassesDirectory) {
639         this.testClassesDirectory = testClassesDirectory;
640     }
641 
642     @Override
643     public File getMainBuildPath() {
644         return classesDirectory;
645     }
646 
647     @Override
648     public void setMainBuildPath(File mainBuildPath) {
649         classesDirectory = mainBuildPath;
650     }
651 
652     @Override
653     public File getReportsDirectory() {
654         return reportsDirectory;
655     }
656 
657     @Override
658     public void setReportsDirectory(File reportsDirectory) {
659         this.reportsDirectory = reportsDirectory;
660     }
661 
662     @Override
663     public String getTest() {
664         return test;
665     }
666 
667     @Override
668     public boolean isUseSystemClassLoader() {
669         return useSystemClassLoader;
670     }
671 
672     @Override
673     public void setUseSystemClassLoader(boolean useSystemClassLoader) {
674         this.useSystemClassLoader = useSystemClassLoader;
675     }
676 
677     @Override
678     public boolean isUseManifestOnlyJar() {
679         return useManifestOnlyJar;
680     }
681 
682     @Override
683     public void setUseManifestOnlyJar(boolean useManifestOnlyJar) {
684         this.useManifestOnlyJar = useManifestOnlyJar;
685     }
686 
687     @Override
688     public String getEncoding() {
689         return encoding;
690     }
691 
692     @Override
693     public void setEncoding(String encoding) {
694         this.encoding = encoding;
695     }
696 
697     @Override
698     public boolean getFailIfNoSpecifiedTests() {
699         return failIfNoSpecifiedTests;
700     }
701 
702     @Override
703     public void setFailIfNoSpecifiedTests(boolean failIfNoSpecifiedTests) {
704         this.failIfNoSpecifiedTests = failIfNoSpecifiedTests;
705     }
706 
707     @Override
708     public int getSkipAfterFailureCount() {
709         return skipAfterFailureCount;
710     }
711 
712     @Override
713     public String getShutdown() {
714         return shutdown;
715     }
716 
717     @Override
718     public boolean isPrintSummary() {
719         return printSummary;
720     }
721 
722     @Override
723     public void setPrintSummary(boolean printSummary) {
724         this.printSummary = printSummary;
725     }
726 
727     @Override
728     public String getReportFormat() {
729         return reportFormat;
730     }
731 
732     @Override
733     public void setReportFormat(String reportFormat) {
734         this.reportFormat = reportFormat;
735     }
736 
737     @Override
738     public boolean isUseFile() {
739         return useFile;
740     }
741 
742     @Override
743     public void setUseFile(boolean useFile) {
744         this.useFile = useFile;
745     }
746 
747     @Override
748     public String getDebugForkedProcess() {
749         return debugForkedProcess;
750     }
751 
752     @Override
753     public void setDebugForkedProcess(String debugForkedProcess) {
754         this.debugForkedProcess = debugForkedProcess;
755     }
756 
757     @Override
758     public int getForkedProcessTimeoutInSeconds() {
759         return forkedProcessTimeoutInSeconds;
760     }
761 
762     @Override
763     public void setForkedProcessTimeoutInSeconds(int forkedProcessTimeoutInSeconds) {
764         this.forkedProcessTimeoutInSeconds = forkedProcessTimeoutInSeconds;
765     }
766 
767     @Override
768     public int getForkedProcessExitTimeoutInSeconds() {
769         return forkedProcessExitTimeoutInSeconds;
770     }
771 
772     @Override
773     public void setForkedProcessExitTimeoutInSeconds(int forkedProcessExitTimeoutInSeconds) {
774         this.forkedProcessExitTimeoutInSeconds = forkedProcessExitTimeoutInSeconds;
775     }
776 
777     @Override
778     public double getParallelTestsTimeoutInSeconds() {
779         return parallelTestsTimeoutInSeconds;
780     }
781 
782     @Override
783     public void setParallelTestsTimeoutInSeconds(double parallelTestsTimeoutInSeconds) {
784         this.parallelTestsTimeoutInSeconds = parallelTestsTimeoutInSeconds;
785     }
786 
787     @Override
788     public double getParallelTestsTimeoutForcedInSeconds() {
789         return parallelTestsTimeoutForcedInSeconds;
790     }
791 
792     @Override
793     public void setParallelTestsTimeoutForcedInSeconds(double parallelTestsTimeoutForcedInSeconds) {
794         this.parallelTestsTimeoutForcedInSeconds = parallelTestsTimeoutForcedInSeconds;
795     }
796 
797     @Override
798     public void setTest(String test) {
799         this.test = test;
800     }
801 
802     @Override
803     public List<String> getIncludes() {
804         return includes;
805     }
806 
807     @Override
808     public void setIncludes(List<String> includes) {
809         this.includes = includes;
810     }
811 
812     @Override
813     public List<String> getExcludes() {
814         return excludes;
815     }
816 
817     @Override
818     public void setExcludes(List<String> excludes) {
819         this.excludes = excludes;
820     }
821 
822     @Override
823     public String getRunOrder() {
824         return runOrder;
825     }
826 
827     @Override
828     @SuppressWarnings("UnusedDeclaration")
829     public void setRunOrder(String runOrder) {
830         this.runOrder = runOrder;
831     }
832 
833     @Override
834     public Long getRunOrderRandomSeed() {
835         return runOrderRandomSeed;
836     }
837 
838     @Override
839     public void setRunOrderRandomSeed(Long runOrderRandomSeed) {
840         this.runOrderRandomSeed = runOrderRandomSeed;
841     }
842 
843     @Override
844     public String getRunOrderStatisticsFileChecksum() {
845         return runOrderStatisticsFileChecksum;
846     }
847 
848     @Override
849     public void setRunOrderStatisticsFileChecksum(String runOrderStatisticsFileChecksum) {
850         this.runOrderStatisticsFileChecksum = runOrderStatisticsFileChecksum;
851     }
852 
853     @Override
854     public File getIncludesFile() {
855         return includesFile;
856     }
857 
858     @Override
859     public File getExcludesFile() {
860         return excludesFile;
861     }
862 
863     @Override
864     protected boolean useModulePath() {
865         return useModulePath;
866     }
867 
868     @Override
869     protected void setUseModulePath(boolean useModulePath) {
870         this.useModulePath = useModulePath;
871     }
872 
873     @Override
874     protected final String[] getExcludedEnvironmentVariables() {
875         return excludedEnvironmentVariables == null ? new String[0] : excludedEnvironmentVariables;
876     }
877 
878     void setExcludedEnvironmentVariables(String[] excludedEnvironmentVariables) {
879         this.excludedEnvironmentVariables = excludedEnvironmentVariables;
880     }
881 
882     @Override
883     protected final String getEnableProcessChecker() {
884         return enableProcessChecker;
885     }
886 
887     @Override
888     protected final ForkNodeFactory getForkNode() {
889         return forkNode;
890     }
891 
892     @Override
893     protected void warnIfIllegalFailOnFlakeCount() throws MojoFailureException {
894         if (failOnFlakeCount < 0) {
895             throw new MojoFailureException("Parameter \"failOnFlakeCount\" should not be negative.");
896         }
897         if (failOnFlakeCount > 0 && rerunFailingTestsCount < 1) {
898             throw new MojoFailureException("\"failOnFlakeCount\" requires rerunFailingTestsCount to be at least 1.");
899         }
900     }
901 
902     @Override
903     protected void addPluginSpecificChecksumItems(ChecksumCalculator checksum) {
904         checksum.add(skipAfterFailureCount);
905     }
906 
907     public String[] getIncludeJUnit5Engines() {
908         return includeJUnit5Engines;
909     }
910 
911     @SuppressWarnings("UnusedDeclaration")
912     public void setIncludeJUnit5Engines(String[] includeJUnit5Engines) {
913         this.includeJUnit5Engines = includeJUnit5Engines;
914     }
915 
916     public String[] getExcludeJUnit5Engines() {
917         return excludeJUnit5Engines;
918     }
919 
920     @SuppressWarnings("UnusedDeclaration")
921     public void setExcludeJUnit5Engines(String[] excludeJUnit5Engines) {
922         this.excludeJUnit5Engines = excludeJUnit5Engines;
923     }
924 }