View Javadoc
1   package org.apache.maven.plugin.surefire;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *     http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.io.File;
23  import java.util.Arrays;
24  import java.util.Collections;
25  import java.util.List;
26  import org.apache.maven.plugin.MojoExecutionException;
27  import org.apache.maven.plugin.MojoFailureException;
28  import org.apache.maven.plugin.surefire.booterclient.ChecksumCalculator;
29  import org.apache.maven.plugins.annotations.LifecyclePhase;
30  import org.apache.maven.plugins.annotations.Mojo;
31  import org.apache.maven.plugins.annotations.Parameter;
32  import org.apache.maven.plugins.annotations.ResolutionScope;
33  import org.apache.maven.surefire.extensions.ForkNodeFactory;
34  import org.apache.maven.surefire.api.suite.RunResult;
35  
36  import static org.apache.maven.plugin.surefire.SurefireHelper.reportExecution;
37  
38  /**
39   * Run tests using Surefire.
40   *
41   * @author Jason van Zyl
42   */
43  @Mojo( name = "test", defaultPhase = LifecyclePhase.TEST, threadSafe = true,
44         requiresDependencyResolution = ResolutionScope.TEST )
45  public class SurefirePlugin
46      extends AbstractSurefireMojo
47      implements SurefireReportParameters
48  {
49  
50      /**
51       * The directory containing generated classes of the project being tested. This will be included after the test
52       * classes in the test classpath.
53       */
54      @Parameter( defaultValue = "${project.build.outputDirectory}" )
55      private File classesDirectory;
56  
57      /**
58       * Set this to "true" to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on
59       * occasion.
60       */
61      @Parameter( property = "maven.test.failure.ignore", defaultValue = "false" )
62      private boolean testFailureIgnore;
63  
64      /**
65       * Base directory where all reports are written to.
66       */
67      @Parameter( defaultValue = "${project.build.directory}/surefire-reports" )
68      private File reportsDirectory;
69  
70      @SuppressWarnings( "checkstyle:linelength" )
71      /**
72       * Specify this parameter to run individual tests by file name, overriding the parameter {@code includes} and
73       * {@code excludes}. Each pattern you specify here will be used to create an include pattern formatted like
74       * <code>**{@literal /}${test}.java</code>, so you can just type {@code -Dtest=MyTest} to run a single test called
75       * "foo/MyTest.java". The test patterns prefixed with a <em>!</em> will be excluded.
76       * <br>
77       * This parameter overrides the parameter {@code includes}, {@code excludes}, and the TestNG parameter
78       * {@code suiteXmlFiles}.
79       * <br>
80       * Since 2.7.3, you can execute a limited number of methods in the test by adding <i>#myMethod</i> or
81       * <i>#my*ethod</i>. For example, {@code -Dtest=MyTest#myMethod}. This is supported for junit 4.x and TestNg.<br>
82       * <br>
83       * Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG):
84       * <pre><code>"-Dtest=???Test, !Unstable*, pkg{@literal /}**{@literal /}Ci*leTest.java, *Test#test*One+testTwo?????, #fast*+slowTest"</code></pre>
85       * or e.g.
86       * <pre><code>"-Dtest=Basic*, !%regex[.*.Unstable.*], !%regex[.*.MyTest.class#one.*|two.*], %regex[#fast.*|slow.*]"</code></pre>
87       * <br>
88       * The Parameterized JUnit runner {@code describes} test methods using an index in brackets, so the non-regex
89       * method pattern would become: {@code #testMethod[*]}.
90       * If using <code>@Parameters(name="{index}: fib({0})={1}")</code> and selecting the index e.g. 5 in pattern, the
91       * non-regex method pattern would become {@code #testMethod[5:*]}.
92       */
93      @Parameter( property = "test" )
94      private String test;
95  
96      /**
97       * Option to print summary of test suites or just print the test cases that have errors.
98       */
99      @Parameter( property = "surefire.printSummary", defaultValue = "true" )
100     private boolean printSummary;
101 
102     /**
103      * Selects the formatting for the test report to be generated. Can be set as "brief" or "plain".
104      * Only applies to the output format of the output files  (target/surefire-reports/testName.txt)
105      */
106     @Parameter( property = "surefire.reportFormat", defaultValue = "brief" )
107     private String reportFormat;
108 
109     /**
110      * Option to generate a file test report or just output the test report to the console.
111      */
112     @Parameter( property = "surefire.useFile", defaultValue = "true" )
113     private boolean useFile;
114 
115     /**
116      * Set this to "true" to cause a failure if none of the tests specified in -Dtest=... are run. Defaults to
117      * "true".
118      *
119      * @since 2.12
120      */
121     @Parameter( property = "surefire.failIfNoSpecifiedTests", defaultValue = "true" )
122     private boolean failIfNoSpecifiedTests;
123 
124     /**
125      * Attach a debugger to the forked JVM. If set to "true", the process will suspend and wait for a debugger to attach
126      * on port 5005. If set to some other string, that string will be appended to the argLine, allowing you to configure
127      * arbitrary debuggability options (without overwriting the other options specified through the {@code argLine}
128      * parameter).
129      *
130      * @since 2.4
131      */
132     @Parameter( property = "maven.surefire.debug" )
133     private String debugForkedProcess;
134 
135     /**
136      * Kill the forked test process after a certain number of seconds. If set to 0, wait forever for the process, never
137      * timing out.
138      *
139      * @since 2.4
140      */
141     @Parameter( property = "surefire.timeout" )
142     private int forkedProcessTimeoutInSeconds;
143 
144     /**
145      * Forked process is normally terminated without any significant delay after given tests have completed.
146      * If the particular tests started non-daemon Thread(s), the process hangs instead of been properly terminated
147      * by {@code System.exit()}. Use this parameter in order to determine the timeout of terminating the process.
148      * <a href="http://maven.apache.org/surefire/maven-surefire-plugin/examples/shutdown.html">see the documentation:
149      * http://maven.apache.org/surefire/maven-surefire-plugin/examples/shutdown.html</a>
150      * Turns to default fallback value of 30 seconds if negative integer.
151      *
152      * @since 2.20
153      */
154     @Parameter( property = "surefire.exitTimeout", defaultValue = "30" )
155     private int forkedProcessExitTimeoutInSeconds;
156 
157     /**
158      * Stop executing queued parallel JUnit tests after a certain number of seconds.
159      * <br>
160      * Example values: "3.5", "4"<br>
161      * <br>
162      * If set to 0, wait forever, never timing out.
163      * Makes sense with specified {@code parallel} different from "none".
164      *
165      * @since 2.16
166      */
167     @Parameter( property = "surefire.parallel.timeout" )
168     private double parallelTestsTimeoutInSeconds;
169 
170     /**
171      * Stop executing queued parallel JUnit tests
172      * and {@code interrupt} currently running tests after a certain number of seconds.
173      * <br>
174      * Example values: "3.5", "4"<br>
175      * <br>
176      * If set to 0, wait forever, never timing out.
177      * Makes sense with specified {@code parallel} different from "none".
178      *
179      * @since 2.16
180      */
181     @Parameter( property = "surefire.parallel.forcedTimeout" )
182     private double parallelTestsTimeoutForcedInSeconds;
183 
184     @SuppressWarnings( "checkstyle:linelength" )
185     /**
186      * A list of {@literal <include>} elements specifying the tests (by pattern) that should be included in testing.
187      * When not specified and when the {@code test} parameter is not specified, the default includes will be
188      * <pre><code>
189      * {@literal <includes>}
190      *     {@literal <include>}**{@literal /}Test*.java{@literal </include>}
191      *     {@literal <include>}**{@literal /}*Test.java{@literal </include>}
192      *     {@literal <include>}**{@literal /}*Tests.java{@literal </include>}
193      *     {@literal <include>}**{@literal /}*TestCase.java{@literal </include>}
194      * {@literal </includes>}
195      * </code></pre>
196      * Each include item may also contain a comma-separated sub-list of items, which will be treated as multiple
197      * {@literal <include>} entries.<br>
198      * Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG):
199      * <pre><code>
200      * {@literal <include>}%regex[.*[Cat|Dog].*], Basic????, !Unstable*{@literal </include>}
201      * {@literal <include>}%regex[.*[Cat|Dog].*], !%regex[pkg.*Slow.*.class], pkg{@literal /}**{@literal /}*Fast*.java{@literal </include>}
202      * </code></pre>
203      * <br>
204      * This parameter is ignored if the TestNG {@code suiteXmlFiles} parameter is specified.<br>
205      * <br>
206      * <b>Notice that</b> these values are relative to the directory containing generated test classes of the project
207      * being tested. This directory is declared by the parameter {@code testClassesDirectory} which defaults
208      * to the POM property {@code ${project.build.testOutputDirectory}}, typically
209      * <code>{@literal src/test/java}</code> unless overridden.
210      */
211     @Parameter( property = "surefire.includes" )
212     // TODO use regex for fully qualified class names in 3.0 and change the filtering abilities
213     private List<String> includes;
214 
215     /**
216      * A list of {@literal <exclude>} elements specifying the tests (by pattern) that should be excluded in testing.
217      * When not specified and when the {@code test} parameter is not specified, the default excludes will be <br>
218      * <pre><code>
219      * {@literal <excludes>}
220      *     {@literal <exclude>}**{@literal /}*$*{@literal </exclude>}
221      * {@literal </excludes>}
222      * </code></pre>
223      * (which excludes all inner classes).
224      * <br>
225      * This parameter is ignored if the TestNG {@code suiteXmlFiles} parameter is specified.
226      * <br>
227      * Each exclude item may also contain a comma-separated sub-list of items, which will be treated as multiple
228      * {@literal <exclude>} entries.<br>
229      * Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG):
230      * <pre><code>
231      * {@literal <exclude>}%regex[pkg.*Slow.*.class], Unstable*{@literal </exclude>}
232      * </code></pre>
233      * <br>
234      * <b>Notice that</b> these values are relative to the directory containing generated test classes of the project
235      * being tested. This directory is declared by the parameter {@code testClassesDirectory} which defaults
236      * to the POM property <code>${project.build.testOutputDirectory}</code>, typically
237      * <code>{@literal src/test/java}</code> unless overridden.
238      */
239     @Parameter( property = "surefire.excludes" )
240     // TODO use regex for fully qualified class names in 3.0 and change the filtering abilities
241     private List<String> excludes;
242 
243     /**
244      * Option to pass dependencies to the system's classloader instead of using an isolated class loader when forking.
245      * Prevents problems with JDKs which implement the service provider lookup mechanism by using the system's
246      * ClassLoader.
247      *
248      * @since 2.3
249      */
250     @Parameter( property = "surefire.useSystemClassLoader", defaultValue = "true" )
251     private boolean useSystemClassLoader;
252 
253     /**
254      * By default, Surefire forks your tests using a manifest-only JAR; set this parameter to "false" to force it to
255      * launch your tests with a plain old Java classpath. (See the
256      * <a href="http://maven.apache.org/plugins/maven-surefire-plugin/examples/class-loading.html">
257      *     http://maven.apache.org/plugins/maven-surefire-plugin/examples/class-loading.html</a>
258      * for a more detailed explanation of manifest-only JARs and their benefits.)
259      * <br>
260      * Beware, setting this to "false" may cause your tests to fail on Windows if your classpath is too long.
261      *
262      * @since 2.4.3
263      */
264     @Parameter( property = "surefire.useManifestOnlyJar", defaultValue = "true" )
265     private boolean useManifestOnlyJar;
266 
267     /**
268      * The character encoding scheme to be applied while generating test report
269      * files (see target/surefire-reports/yourTestName.txt).
270      * The report output files (*-out.txt) are encoded in UTF-8 if not set otherwise.
271      *
272      * @since 3.0.0-M1
273      */
274     @Parameter( property = "surefire.encoding", defaultValue = "${project.reporting.outputEncoding}" )
275     private String encoding;
276 
277     /**
278      * (JUnit 4+ providers and JUnit 5+ providers since 3.0.0-M4)
279      * The number of times each failing test will be rerun. If set larger than 0, rerun failing tests immediately after
280      * they fail. If a failing test passes in any of those reruns, it will be marked as pass and reported as a "flake".
281      * However, all the failing attempts will be recorded.
282      */
283     @Parameter( property = "surefire.rerunFailingTestsCount", defaultValue = "0" )
284     private int rerunFailingTestsCount;
285 
286     /**
287      * Set this to a value greater than 0 to fail the whole test set if the cumulative number of flakes reaches
288      * this threshold. Set to 0 to allow an unlimited number of flakes.
289      *
290      * @since 3.0.0-M6
291      */
292     @Parameter( property = "surefire.failOnFlakeCount", defaultValue = "0" )
293     private int failOnFlakeCount;
294 
295     /**
296      * (TestNG) List of &lt;suiteXmlFile&gt; elements specifying TestNG suite xml file locations. Note that
297      * {@code suiteXmlFiles} is incompatible with several other parameters of this plugin, like
298      * {@code includes} and {@code excludes}.<br>
299      * This parameter is ignored if the {@code test} parameter is specified (allowing you to run a single test
300      * instead of an entire suite).
301      *
302      * @since 2.2
303      */
304     @Parameter( property = "surefire.suiteXmlFiles" )
305     private File[] suiteXmlFiles;
306 
307     /**
308      * Defines the order the tests will be run in. Supported values are {@code alphabetical},
309      * {@code reversealphabetical}, {@code random}, {@code hourly} (alphabetical on even hours, reverse alphabetical
310      * on odd hours), {@code failedfirst}, {@code balanced} and {@code filesystem}.
311      * <br>
312      * <br>
313      * Odd/Even for hourly is determined at the time the of scanning the classpath, meaning it could change during a
314      * multi-module build.
315      * <br>
316      * <br>
317      * Failed first will run tests that failed on previous run first, as well as new tests for this run.
318      * <br>
319      * <br>
320      * Balanced is only relevant with parallel=classes, and will try to optimize the run-order of the tests reducing the
321      * overall execution time. Initially a statistics file is created and every next test run will reorder classes.
322      * <br>
323      * <br>
324      * Note that the statistics are stored in a file named <b>.surefire-XXXXXXXXX</b> beside <i>pom.xml</i> and
325      * should not be checked into version control. The "XXXXX" is the SHA1 checksum of the entire surefire
326      * configuration, so different configurations will have different statistics files, meaning if you change any
327      * configuration settings you will re-run once before new statistics data can be established.
328      *
329      * @since 2.7
330      */
331     @Parameter( property = "surefire.runOrder", defaultValue = "filesystem" )
332     private String runOrder;
333 
334     /**
335      * Sets the random seed that will be used to order the tests if {@code surefire.runOrder} is set to {@code random}.
336      * <br>
337      * <br>
338      * If no seeds are set and {@code surefire.runOrder} is set to {@code random}, then the seed used will be
339      * outputted (search for "To reproduce ordering use flag -Dsurefire.runOrder.random.seed").
340      * <br>
341      * <br>
342      * To deterministically reproduce any random test order that was run before, simply set the seed to
343      * be the same value.
344      *
345      * @since 3.0.0-M6
346      */
347     @Parameter( property = "surefire.runOrder.random.seed" )
348     private Long runOrderRandomSeed;
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     @Parameter( property = "surefire.systemPropertiesFile" )
506     private File systemPropertiesFile;
507 
508     /**
509      * Provide the ID/s of an JUnit engine to be included in the test run.
510      *
511      * @since 3.0.0-M6
512      */
513     @Parameter( property = "surefire.includeJUnit5Engines" )
514     private String[] includeJUnit5Engines;
515 
516     /**
517      * Provide the ID/s of an JUnit engine to be excluded in the test run.
518      *
519      * @since 3.0.0-M6
520      */
521     @Parameter( property = "surefire.excludeJUnit5Engines" )
522     private String[] excludeJUnit5Engines;
523 
524     @Override
525     protected int getRerunFailingTestsCount()
526     {
527         return rerunFailingTestsCount;
528     }
529 
530     @Override
531     public int getFailOnFlakeCount()
532     {
533         return failOnFlakeCount;
534     }
535 
536     @Override
537     public void setFailOnFlakeCount( int failOnFlakeCount )
538     {
539         this.failOnFlakeCount = failOnFlakeCount;
540     }
541 
542     @Override
543     protected void handleSummary( RunResult summary, Exception firstForkException )
544         throws MojoExecutionException, MojoFailureException
545     {
546         reportExecution( this, summary, getConsoleLogger(), firstForkException );
547     }
548 
549     @Override
550     protected boolean isSkipExecution()
551     {
552         return isSkip() || isSkipTests() || isSkipExec();
553     }
554 
555     @Override
556     protected String getPluginName()
557     {
558         return "surefire";
559     }
560 
561     @Override
562     protected String[] getDefaultIncludes()
563     {
564         return new String[]{ "**/Test*.java", "**/*Test.java", "**/*Tests.java", "**/*TestCase.java" };
565     }
566 
567     @Override
568     protected String getReportSchemaLocation()
569     {
570         return "https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd";
571     }
572 
573 
574     public File getSystemPropertiesFile()
575     {
576         return systemPropertiesFile;
577     }
578 
579 
580     public void setSystemPropertiesFile( File systemPropertiesFile )
581     {
582         this.systemPropertiesFile = systemPropertiesFile;
583     }
584 
585 
586     // now for the implementation of the field accessors
587 
588     @Override
589     public boolean isSkipTests()
590     {
591         return skipTests;
592     }
593 
594     @Override
595     public void setSkipTests( boolean skipTests )
596     {
597         this.skipTests = skipTests;
598     }
599 
600     @Override
601     @Deprecated
602     public boolean isSkipExec()
603     {
604         return skipExec;
605     }
606 
607     @Override
608     @Deprecated
609     public void setSkipExec( boolean skipExec )
610     {
611         this.skipExec = skipExec;
612     }
613 
614     @Override
615     public boolean isSkip()
616     {
617         return skip;
618     }
619 
620     @Override
621     public void setSkip( boolean skip )
622     {
623         this.skip = skip;
624     }
625 
626     @Override
627     public boolean isTestFailureIgnore()
628     {
629         return testFailureIgnore;
630     }
631 
632     @Override
633     public void setTestFailureIgnore( boolean testFailureIgnore )
634     {
635         this.testFailureIgnore = testFailureIgnore;
636     }
637 
638     @Override
639     public File getBasedir()
640     {
641         return basedir;
642     }
643 
644     @Override
645     public void setBasedir( File basedir )
646     {
647         this.basedir = basedir;
648     }
649 
650     @Override
651     public File getTestClassesDirectory()
652     {
653         return testClassesDirectory;
654     }
655 
656     @Override
657     public void setTestClassesDirectory( File testClassesDirectory )
658     {
659         this.testClassesDirectory = testClassesDirectory;
660     }
661 
662     @Override
663     public File getMainBuildPath()
664     {
665         return classesDirectory;
666     }
667 
668     @Override
669     public void setMainBuildPath( File mainBuildPath )
670     {
671         classesDirectory = mainBuildPath;
672     }
673 
674     @Override
675     public File getReportsDirectory()
676     {
677         return reportsDirectory;
678     }
679 
680     @Override
681     public void setReportsDirectory( File reportsDirectory )
682     {
683         this.reportsDirectory = reportsDirectory;
684     }
685 
686     @Override
687     public String getTest()
688     {
689         return test;
690     }
691 
692     @Override
693     public boolean isUseSystemClassLoader()
694     {
695         return useSystemClassLoader;
696     }
697 
698     @Override
699     public void setUseSystemClassLoader( boolean useSystemClassLoader )
700     {
701         this.useSystemClassLoader = useSystemClassLoader;
702     }
703 
704     @Override
705     public boolean isUseManifestOnlyJar()
706     {
707         return useManifestOnlyJar;
708     }
709 
710     @Override
711     public void setUseManifestOnlyJar( boolean useManifestOnlyJar )
712     {
713         this.useManifestOnlyJar = useManifestOnlyJar;
714     }
715 
716     @Override
717     public String getEncoding()
718     {
719         return encoding;
720     }
721 
722     @Override
723     public void setEncoding( String encoding )
724     {
725         this.encoding = encoding;
726     }
727 
728     @Override
729     public boolean getFailIfNoSpecifiedTests()
730     {
731         return failIfNoSpecifiedTests;
732     }
733 
734     @Override
735     public void setFailIfNoSpecifiedTests( boolean failIfNoSpecifiedTests )
736     {
737         this.failIfNoSpecifiedTests = failIfNoSpecifiedTests;
738     }
739 
740     @Override
741     public int getSkipAfterFailureCount()
742     {
743         return skipAfterFailureCount;
744     }
745 
746     @Override
747     public String getShutdown()
748     {
749         return shutdown;
750     }
751 
752     @Override
753     public boolean isPrintSummary()
754     {
755         return printSummary;
756     }
757 
758     @Override
759     public void setPrintSummary( boolean printSummary )
760     {
761         this.printSummary = printSummary;
762     }
763 
764     @Override
765     public String getReportFormat()
766     {
767         return reportFormat;
768     }
769 
770     @Override
771     public void setReportFormat( String reportFormat )
772     {
773         this.reportFormat = reportFormat;
774     }
775 
776     @Override
777     public boolean isUseFile()
778     {
779         return useFile;
780     }
781 
782     @Override
783     public void setUseFile( boolean useFile )
784     {
785         this.useFile = useFile;
786     }
787 
788     @Override
789     public String getDebugForkedProcess()
790     {
791         return debugForkedProcess;
792     }
793 
794     @Override
795     public void setDebugForkedProcess( String debugForkedProcess )
796     {
797         this.debugForkedProcess = debugForkedProcess;
798     }
799 
800     @Override
801     public int getForkedProcessTimeoutInSeconds()
802     {
803         return forkedProcessTimeoutInSeconds;
804     }
805 
806     @Override
807     public void setForkedProcessTimeoutInSeconds( int forkedProcessTimeoutInSeconds )
808     {
809         this.forkedProcessTimeoutInSeconds = forkedProcessTimeoutInSeconds;
810     }
811 
812     @Override
813     public int getForkedProcessExitTimeoutInSeconds()
814     {
815         return forkedProcessExitTimeoutInSeconds;
816     }
817 
818     @Override
819     public void setForkedProcessExitTimeoutInSeconds( int forkedProcessExitTimeoutInSeconds )
820     {
821         this.forkedProcessExitTimeoutInSeconds = forkedProcessExitTimeoutInSeconds;
822     }
823 
824     @Override
825     public double getParallelTestsTimeoutInSeconds()
826     {
827         return parallelTestsTimeoutInSeconds;
828     }
829 
830     @Override
831     public void setParallelTestsTimeoutInSeconds( double parallelTestsTimeoutInSeconds )
832     {
833         this.parallelTestsTimeoutInSeconds = parallelTestsTimeoutInSeconds;
834     }
835 
836     @Override
837     public double getParallelTestsTimeoutForcedInSeconds()
838     {
839         return parallelTestsTimeoutForcedInSeconds;
840     }
841 
842     @Override
843     public void setParallelTestsTimeoutForcedInSeconds( double parallelTestsTimeoutForcedInSeconds )
844     {
845         this.parallelTestsTimeoutForcedInSeconds = parallelTestsTimeoutForcedInSeconds;
846     }
847 
848     @Override
849     public void setTest( String test )
850     {
851         this.test = test;
852     }
853 
854     @Override
855     public List<String> getIncludes()
856     {
857         return includes;
858     }
859 
860     @Override
861     public void setIncludes( List<String> includes )
862     {
863         this.includes = includes;
864     }
865 
866     @Override
867     public List<String> getExcludes()
868     {
869         return excludes;
870     }
871 
872     @Override
873     public void setExcludes( List<String> excludes )
874     {
875         this.excludes = excludes;
876     }
877 
878     @Override
879     public File[] getSuiteXmlFiles()
880     {
881         return suiteXmlFiles.clone();
882     }
883 
884     @Override
885     @SuppressWarnings( "UnusedDeclaration" )
886     public void setSuiteXmlFiles( File[] suiteXmlFiles )
887     {
888         this.suiteXmlFiles = suiteXmlFiles.clone();
889     }
890 
891     @Override
892     public String getRunOrder()
893     {
894         return runOrder;
895     }
896 
897     @Override
898     @SuppressWarnings( "UnusedDeclaration" )
899     public void setRunOrder( String runOrder )
900     {
901         this.runOrder = runOrder;
902     }
903 
904     @Override
905     public Long getRunOrderRandomSeed()
906     {
907         return runOrderRandomSeed;
908     }
909 
910     @Override
911     public void setRunOrderRandomSeed( Long runOrderRandomSeed )
912     {
913         this.runOrderRandomSeed = runOrderRandomSeed;
914     }
915 
916     @Override
917     public File getIncludesFile()
918     {
919         return includesFile;
920     }
921 
922     @Override
923     public File getExcludesFile()
924     {
925         return excludesFile;
926     }
927 
928     @Override
929     protected boolean useModulePath()
930     {
931         return useModulePath;
932     }
933 
934     @Override
935     protected void setUseModulePath( boolean useModulePath )
936     {
937         this.useModulePath = useModulePath;
938     }
939 
940     @Override
941     protected final List<File> suiteXmlFiles()
942     {
943         return hasSuiteXmlFiles() ? Arrays.asList( suiteXmlFiles ) : Collections.<File>emptyList();
944     }
945 
946     @Override
947     protected final boolean hasSuiteXmlFiles()
948     {
949         return suiteXmlFiles != null && suiteXmlFiles.length != 0;
950     }
951 
952     @Override
953     protected final String[] getExcludedEnvironmentVariables()
954     {
955         return excludedEnvironmentVariables == null ? new String[0] : excludedEnvironmentVariables;
956     }
957 
958     void setExcludedEnvironmentVariables( String[] excludedEnvironmentVariables )
959     {
960         this.excludedEnvironmentVariables = excludedEnvironmentVariables;
961     }
962 
963     @Override
964     protected final String getEnableProcessChecker()
965     {
966         return enableProcessChecker;
967     }
968 
969     @Override
970     protected final ForkNodeFactory getForkNode()
971     {
972         return forkNode;
973     }
974 
975     @Override
976     protected void warnIfIllegalFailOnFlakeCount() throws MojoFailureException
977     {
978         if ( failOnFlakeCount < 0 )
979         {
980             throw new MojoFailureException( "Parameter \"failOnFlakeCount\" should not be negative." );
981         }
982         if ( failOnFlakeCount > 0 && rerunFailingTestsCount < 1 )
983         {
984             throw new MojoFailureException( "\"failOnFlakeCount\" requires rerunFailingTestsCount to be at least 1." );
985         }
986     }
987 
988     @Override
989     protected void addPluginSpecificChecksumItems( ChecksumCalculator checksum )
990     {
991         checksum.add( skipAfterFailureCount );
992     }
993 
994     public String[] getIncludeJUnit5Engines()
995     {
996         return includeJUnit5Engines;
997     }
998 
999     @SuppressWarnings( "UnusedDeclaration" )
1000     public void setIncludeJUnit5Engines( String[] includeJUnit5Engines )
1001     {
1002         this.includeJUnit5Engines = includeJUnit5Engines;
1003     }
1004 
1005     public String[] getExcludeJUnit5Engines()
1006     {
1007         return excludeJUnit5Engines;
1008     }
1009 
1010     @SuppressWarnings( "UnusedDeclaration" )
1011     public void setExcludeJUnit5Engines( String[] excludeJUnit5Engines )
1012     {
1013         this.excludeJUnit5Engines = excludeJUnit5Engines;
1014     }
1015 }