View Javadoc
1   package org.apache.maven.plugin.failsafe;
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 org.apache.maven.artifact.Artifact;
23  import org.apache.maven.plugin.MojoExecutionException;
24  import org.apache.maven.plugin.MojoFailureException;
25  import org.apache.maven.plugin.surefire.AbstractSurefireMojo;
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.suite.RunResult;
32  
33  import java.io.File;
34  import java.io.IOException;
35  import java.nio.charset.Charset;
36  import java.util.Arrays;
37  import java.util.Collections;
38  import java.util.List;
39  import java.util.Locale;
40  import java.util.Map;
41  
42  import static org.apache.maven.plugin.failsafe.util.FailsafeSummaryXmlUtils.writeSummary;
43  
44  /**
45   * Run integration tests using Surefire.
46   *
47   * @author Jason van Zyl
48   * @author Stephen Connolly
49   */
50  @Mojo( name = "integration-test", requiresProject = true, requiresDependencyResolution = ResolutionScope.TEST,
51               defaultPhase = LifecyclePhase.INTEGRATION_TEST, threadSafe = true )
52  public class IntegrationTestMojo
53          extends AbstractSurefireMojo
54  {
55  
56      private static final String FAILSAFE_IN_PROGRESS_CONTEXT_KEY = "failsafe-in-progress";
57  
58      /**
59       * The path representing project <em>JAR</em> file, if exists; Otherwise the directory containing generated
60       * classes of the project being tested. This will be included after the test classes in the test classpath.
61       * Defaults to built artifact <em>JAR</em> file or <code>${project.build.outputDirectory}</code>.
62       */
63      @Parameter
64      private File classesDirectory;
65  
66      @Parameter( readonly = true, defaultValue = "${project.build.outputDirectory}" )
67      private File defaultClassesDirectory;
68  
69      /**
70       * Set this to "true" to skip running integration tests, but still compile them. Its use is NOT RECOMMENDED, but
71       * quite convenient on occasion.
72       *
73       * @since 2.4.3-alpha-2
74       */
75      @Parameter( property = "skipITs" )
76      private boolean skipITs;
77  
78      /**
79       * Base directory where all reports are written to.
80       */
81      @Parameter( defaultValue = "${project.build.directory}/failsafe-reports" )
82      private File reportsDirectory;
83  
84      @SuppressWarnings( "checkstyle:linelength" )
85      /**
86       * Specify this parameter to run individual tests by file name, overriding parameter {@code includes} and
87       * {@code excludes}. Each pattern you specify here will be used to create an include pattern formatted like
88       * <code>**{@literal /}${it.test}.java</code>, so you can just type {@code -Dit.test=MyIT} to run
89       * a single test file called "foo/MyIT.java". The test patterns prefixed with a <em>!</em> will be excluded.
90       * <br>
91       * This parameter overrides the parameter {@code includes} and {@code excludes}, and the TestNG parameter
92       * {@code suiteXmlFiles}.
93       * <br>
94       * Since 2.7.3 You can execute a limited number of methods in the test with adding <i>#myMethod</i> or
95       * <i>#my*ethod</i>. E.g. type {@code -Dit.test=MyIT#myMethod} <b>supported for junit 4.x and TestNg.</b>
96       * <br>
97       * Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG):
98       * <pre><code>"-Dit.test=???IT, !Unstable*, pkg{@literal /}**{@literal /}Ci*leIT.java, *IT#test*One+testTwo?????, #fast*+slowTest"</code></pre>
99       * or e.g.
100      * <br>
101      * <pre><code>"-Dit.test=Basic*, !%regex[.*.Unstable.*], !%regex[.*.MyIT.class#one.*|two.*], %regex[#fast.*|slow.*]"</code></pre>
102      * <br>
103      * The Parameterized JUnit runner {@code describes} test methods using an index in brackets, so the non-regex
104      * method pattern would become: {@code #testMethod[*]}. If using <code>@Parameters(name="{index}: fib({0})={1}")</code>
105      * and selecting the index e.g. 5 in pattern, the non-regex method pattern would become {@code #testMethod[5:*]}.
106      */
107     @Parameter( property = "it.test" )
108     private String test;
109 
110     /**
111      * The summary file to write integration test results to.
112      */
113     @Parameter( defaultValue = "${project.build.directory}/failsafe-reports/failsafe-summary.xml", required = true )
114     private File summaryFile;
115 
116     /**
117      * Option to print summary of test suites or just print the test cases that have errors.
118      */
119     @Parameter( property = "failsafe.printSummary", defaultValue = "true" )
120     private boolean printSummary;
121 
122     /**
123      * Selects the formatting for the test report to be generated. Can be set as "brief" or "plain".
124      * Only applies to the output format of the output files  (target/surefire-reports/testName.txt)
125      */
126     @Parameter( property = "failsafe.reportFormat", defaultValue = "brief" )
127     private String reportFormat;
128 
129     /**
130      * Option to generate a file test report or just output the test report to the console.
131      */
132     @Parameter( property = "failsafe.useFile", defaultValue = "true" )
133     private boolean useFile;
134 
135     /**
136      * Set this to "true" to cause a failure if none of the tests specified in -Dtest=... are run. Defaults to
137      * "true".
138      *
139      * @since 2.12
140      */
141     @Parameter( property = "it.failIfNoSpecifiedTests" )
142     private Boolean failIfNoSpecifiedTests;
143 
144     /**
145      * Attach a debugger to the forked JVM. If set to "true", the process will suspend and wait for a debugger to attach
146      * on port 5005. If set to some other string, that string will be appended to the argLine, allowing you to configure
147      * arbitrary debugging ability options (without overwriting the other options specified through the {@code argLine}
148      * parameter).
149      *
150      * @since 2.4
151      */
152     @Parameter( property = "maven.failsafe.debug" )
153     private String debugForkedProcess;
154 
155     /**
156      * Kill the forked test process after a certain number of seconds. If set to 0, wait forever for the process, never
157      * timing out.
158      *
159      * @since 2.4
160      */
161     @Parameter( property = "failsafe.timeout" )
162     private int forkedProcessTimeoutInSeconds;
163 
164     /**
165      * Forked process is normally terminated without any significant delay after given tests have completed.
166      * If the particular tests started non-daemon Thread(s), the process hangs instead of been properly terminated
167      * by {@code System.exit()}. Use this parameter in order to determine the timeout of terminating the process.
168      * <a href="http://maven.apache.org/surefire/maven-failsafe-plugin/examples/shutdown.html">see the documentation:
169      * http://maven.apache.org/surefire/maven-failsafe-plugin/examples/shutdown.html</a>;
170      *
171      * @since 2.20
172      */
173     @Parameter( property = "failsafe.exitTimeout", defaultValue = "30" )
174     private int forkedProcessExitTimeoutInSeconds;
175 
176     /**
177      * Stop executing queued parallel JUnit tests after a certain number of seconds.
178      * <br>
179      * Example values: "3.5", "4"<br>
180      * <br>
181      * If set to 0, wait forever, never timing out.
182      * Makes sense with specified {@code parallel} different from "none".
183      *
184      * @since 2.16
185      */
186     @Parameter( property = "failsafe.parallel.timeout" )
187     private double parallelTestsTimeoutInSeconds;
188 
189     /**
190      * Stop executing queued parallel JUnit tests
191      * and <i>interrupt</i> currently running tests after a certain number of seconds.
192      * <br>
193      * Example values: "3.5", "4"<br>
194      * <br>
195      * If set to 0, wait forever, never timing out.
196      * Makes sense with specified {@code parallel} different from "none".
197      *
198      * @since 2.16
199      */
200     @Parameter( property = "failsafe.parallel.forcedTimeout" )
201     private double parallelTestsTimeoutForcedInSeconds;
202 
203     @SuppressWarnings( "checkstyle:linelength" )
204     /**
205      * A list of {@literal <include>} elements specifying the test filter (by pattern) of tests which should be
206      * included in testing. If it is not specified and the {@code test} parameter is unspecified as well, the default
207      * includes is
208      * <pre><code>
209      * {@literal <includes>}
210      *     {@literal <include>}**{@literal /}IT*.java{@literal </include>}
211      *     {@literal <include>}**{@literal /}*IT.java{@literal </include>}
212      *     {@literal <include>}**{@literal /}*ITCase.java{@literal </include>}
213      * {@literal </includes>}
214      * </code></pre>
215      * <br>
216      * Each include item may also contain a comma-separated sublist of items, which will be treated as multiple
217      * {@literal <include>} entries.<br>
218      * Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG):
219      * <pre><code>
220      * {@literal <include>}%regex[.*[Cat|Dog].*], Basic????, !Unstable*{@literal </include>}
221      * {@literal <include>}%regex[.*[Cat|Dog].*], !%regex[pkg.*Slow.*.class], pkg{@literal /}**{@literal /}*Fast*.java{@literal </include>}
222      * </code></pre>
223      * <br>
224      * This parameter is ignored if the TestNG {@code suiteXmlFiles} parameter is specified.<br>
225      * <br>
226      * <b>Notice that</b> these values are relative to the directory containing generated test classes of the project
227      * being tested. This directory is declared by the parameter {@code testClassesDirectory} which defaults
228      * to the POM property <code>${project.build.testOutputDirectory}</code>, typically
229      * <code>{@literal src/test/java}</code> unless overridden.
230      */
231     @Parameter
232     private List<String> includes;
233 
234     /**
235      * Option to pass dependencies to the system's classloader instead of using an isolated class loader when forking.
236      * Prevents problems with JDKs which implement the service provider lookup mechanism by using the system's
237      * classloader.
238      *
239      * @since 2.3
240      */
241     @Parameter( property = "failsafe.useSystemClassLoader", defaultValue = "true" )
242     private boolean useSystemClassLoader;
243 
244     /**
245      * By default, Surefire forks your tests using a manifest-only JAR; set this parameter to "false" to force it to
246      * launch your tests with a plain old Java classpath. (See the
247      * <a href="http://maven.apache.org/plugins/maven-failsafe-plugin/examples/class-loading.html">
248      * http://maven.apache.org/plugins/maven-failsafe-plugin/examples/class-loading.html</a>;
249      * for a more detailed explanation of manifest-only JARs and their benefits.)
250      * <br>
251      * Beware, setting this to "false" may cause your tests to fail on Windows if your classpath is too long.
252      *
253      * @since 2.4.3
254      */
255     @Parameter( property = "failsafe.useManifestOnlyJar", defaultValue = "true" )
256     private boolean useManifestOnlyJar;
257 
258     /**
259      * The character encoding scheme to be applied while generating test report
260      * files (see target/surefire-reports/yourTestName.txt).
261      * The report output files (*-out.txt) are still encoded with JVM's encoding used in standard out/err pipes.
262      *
263      * @since 3.0.0-M1
264      */
265     @Parameter( property = "encoding", defaultValue = "${project.reporting.outputEncoding}" )
266     private String encoding;
267 
268     /**
269      * (JUnit 4+ providers)
270      * The number of times each failing test will be rerun. If set larger than 0, rerun failing tests immediately after
271      * they fail. If a failing test passes in any of those reruns, it will be marked as pass and reported as a "flake".
272      * However, all the failing attempts will be recorded.
273      */
274     @Parameter( property = "failsafe.rerunFailingTestsCount", defaultValue = "0" )
275     private int rerunFailingTestsCount;
276 
277     /**
278      * (TestNG) List of &lt;suiteXmlFile&gt; elements specifying TestNG suite xml file locations. Note that
279      * {@code suiteXmlFiles} is incompatible with several other parameters of this plugin, like
280      * {@code includes} and {@code excludes}.<br>
281      * This parameter is ignored if the {@code test} parameter is specified (allowing you to run a single test
282      * instead of an entire suite).
283      *
284      * @since 2.2
285      */
286     @Parameter( property = "failsafe.suiteXmlFiles" )
287     private File[] suiteXmlFiles;
288 
289     /**
290      * Defines the order the tests will be run in. Supported values are {@code alphabetical},
291      * {@code reversealphabetical}, {@code random}, {@code hourly} (alphabetical on even hours, reverse alphabetical
292      * on odd hours), {@code failedfirst}, {@code balanced} and {@code filesystem}.
293      * <br>
294      * <br>
295      * Odd/Even for hourly is determined at the time the of scanning the classpath, meaning it could change during a
296      * multi-module build.
297      * <br>
298      * <br>
299      * Failed first will run tests that failed on previous run first, as well as new tests for this run.
300      * <br>
301      * <br>
302      * Balanced is only relevant with parallel=classes, and will try to optimize the run-order of the tests reducing the
303      * overall execution time. Initially a statistics file is created and every next test run will reorder classes.
304      * <br>
305      * <br>
306      * Note that the statistics are stored in a file named <b>.surefire-XXXXXXXXX</b> beside <i>pom.xml</i> and
307      * should not be checked into version control. The "XXXXX" is the SHA1 checksum of the entire surefire
308      * configuration, so different configurations will have different statistics files, meaning if you change any
309      * configuration settings you will re-run once before new statistics data can be established.
310      *
311      * @since 2.7
312      */
313     @Parameter( property = "failsafe.runOrder", defaultValue = "filesystem" )
314     private String runOrder;
315 
316     /**
317      * A file containing include patterns, each in a next line. Blank lines, or lines starting with # are ignored.
318      * If {@code includes} are also specified, these patterns are appended. Example with path, simple and regex
319      * includes:
320      * <pre><code>
321      * *{@literal /}it{@literal /}*
322      * **{@literal /}NotIncludedByDefault.java
323      * %regex[.*IT.*|.*Not.*]
324      * </code></pre>
325      */
326     @Parameter( property = "failsafe.includesFile" )
327     private File includesFile;
328 
329     /**
330      * A file containing exclude patterns, each in a next line. Blank lines, or lines starting with # are ignored.
331      * If {@code excludes} are also specified, these patterns are appended.
332      * Example with path, simple and regex excludes:
333      * <pre><code>
334      * *{@literal /}it{@literal /}*
335      * **{@literal /}DontRunIT.*
336      * %regex[.*IT.*|.*Not.*]
337      * </code></pre>
338      */
339     @Parameter( property = "failsafe.excludesFile" )
340     private File excludesFile;
341 
342     /**
343      * Set to error/failure count in order to skip remaining tests.
344      * Due to race conditions in parallel/forked execution this may not be fully guaranteed.<br>
345      * Enable with system property {@code -Dfailsafe.skipAfterFailureCount=1} or any number greater than zero.
346      * Defaults to "0".<br>
347      * See the prerequisites and limitations in documentation:<br>
348      * <a href="http://maven.apache.org/plugins/maven-failsafe-plugin/examples/skip-after-failure.html">
349      * http://maven.apache.org/plugins/maven-failsafe-plugin/examples/skip-after-failure.html</a>;
350      *
351      * @since 2.19
352      */
353     @Parameter( property = "failsafe.skipAfterFailureCount", defaultValue = "0" )
354     private int skipAfterFailureCount;
355 
356     /**
357      * After the plugin process is shutdown by sending <i>SIGTERM signal (CTRL+C)</i>, <i>SHUTDOWN command</i> is
358      * received by every forked JVM.
359      * <br>
360      * By default ({@code shutdown=testset}) forked JVM would not continue with new test which means that
361      * the current test may still continue to run.
362      * <br>
363      * The parameter can be configured with other two values {@code exit} and {@code kill}.
364      * <br>
365      * Using {@code exit} forked JVM executes {@code System.exit(1)} after the plugin process has received
366      * <i>SIGTERM signal</i>.
367      * <br>
368      * Using {@code kill} the JVM executes {@code Runtime.halt(1)} and kills itself.
369      *
370      * @since 2.19
371      */
372     @Parameter( property = "failsafe.shutdown", defaultValue = "testset" )
373     private String shutdown;
374 
375     @Override
376     protected int getRerunFailingTestsCount()
377     {
378         return rerunFailingTestsCount;
379     }
380 
381     @Override
382     @SuppressWarnings( "unchecked" )
383     protected void handleSummary( RunResult summary, Exception firstForkException )
384             throws MojoExecutionException, MojoFailureException
385     {
386         File summaryFile = getSummaryFile();
387         if ( !summaryFile.getParentFile().isDirectory() )
388         {
389             //noinspection ResultOfMethodCallIgnored
390             summaryFile.getParentFile().mkdirs();
391         }
392 
393         try
394         {
395             Object token = getPluginContext().get( FAILSAFE_IN_PROGRESS_CONTEXT_KEY );
396             writeSummary( summary, summaryFile, token != null );
397         }
398         catch ( Exception e )
399         {
400             throw new MojoExecutionException( e.getMessage(), e );
401         }
402 
403         getPluginContext().put( FAILSAFE_IN_PROGRESS_CONTEXT_KEY, FAILSAFE_IN_PROGRESS_CONTEXT_KEY );
404     }
405 
406     private boolean isJarArtifact( File artifactFile )
407     {
408         return artifactFile != null && artifactFile.isFile() && artifactFile.getName().toLowerCase().endsWith( ".jar" );
409     }
410 
411     private static File toAbsoluteCanonical( File f )
412     {
413         try
414         {
415             return f == null ? null : f.getAbsoluteFile().getCanonicalFile();
416         }
417         catch ( IOException e )
418         {
419             throw new IllegalStateException( e.getLocalizedMessage(), e );
420         }
421     }
422 
423     @Override
424     @SuppressWarnings( "deprecation" )
425     protected boolean isSkipExecution()
426     {
427         return isSkip() || isSkipTests() || isSkipITs() || isSkipExec();
428     }
429 
430     @Override
431     protected String getPluginName()
432     {
433         return "failsafe";
434     }
435 
436     @Override
437     protected String[] getDefaultIncludes()
438     {
439         return new String[]{ "**/IT*.java", "**/*IT.java", "**/*ITCase.java" };
440     }
441 
442     @Override
443     protected String getReportSchemaLocation()
444     {
445         return "https://maven.apache.org/surefire/maven-failsafe-plugin/xsd/failsafe-test-report.xsd";
446     }
447 
448     @Override
449     protected Artifact getMojoArtifact()
450     {
451         final Map<String, Artifact> pluginArtifactMap = getPluginArtifactMap();
452         return pluginArtifactMap.get( "org.apache.maven.plugins:maven-failsafe-plugin" );
453     }
454 
455     @Override
456     public boolean isSkipTests()
457     {
458         return skipTests;
459     }
460 
461     @Override
462     public void setSkipTests( boolean skipTests )
463     {
464         this.skipTests = skipTests;
465     }
466 
467     public boolean isSkipITs()
468     {
469         return skipITs;
470     }
471 
472     public void setSkipITs( boolean skipITs )
473     {
474         this.skipITs = skipITs;
475     }
476 
477     @Override
478     @SuppressWarnings( "deprecation" )
479     @Deprecated
480     public boolean isSkipExec()
481     {
482         return skipExec;
483     }
484 
485     @Override
486     @SuppressWarnings( "deprecation" )
487     @Deprecated
488     public void setSkipExec( boolean skipExec )
489     {
490         this.skipExec = skipExec;
491     }
492 
493     @Override
494     public boolean isSkip()
495     {
496         return skip;
497     }
498 
499     @Override
500     public void setSkip( boolean skip )
501     {
502         this.skip = skip;
503     }
504 
505     @Override
506     public File getBasedir()
507     {
508         return basedir;
509     }
510 
511     @Override
512     public void setBasedir( File basedir )
513     {
514         this.basedir = basedir;
515     }
516 
517     @Override
518     public File getTestClassesDirectory()
519     {
520         return testClassesDirectory;
521     }
522 
523     @Override
524     public void setTestClassesDirectory( File testClassesDirectory )
525     {
526         this.testClassesDirectory = testClassesDirectory;
527     }
528 
529     /**
530      * @return Output directory, or artifact file if artifact type is "jar". If not forking the JVM, parameter
531      * {@link #useSystemClassLoader} is ignored and the {@link org.apache.maven.surefire.booter.IsolatedClassLoader} is
532      * used instead. See the resolution of {@link #getClassLoaderConfiguration() ClassLoaderConfiguration}.
533      */
534     @Override
535     public File getClassesDirectory()
536     {
537         File artifact = getProject().getArtifact().getFile();
538         boolean isDefaultClsDir = classesDirectory == null;
539         return isDefaultClsDir ? ( isJarArtifact( artifact ) ? artifact : defaultClassesDirectory ) : classesDirectory;
540     }
541 
542     @Override
543     public void setClassesDirectory( File classesDirectory )
544     {
545         this.classesDirectory = toAbsoluteCanonical( classesDirectory );
546     }
547 
548     public void setDefaultClassesDirectory( File defaultClassesDirectory )
549     {
550         this.defaultClassesDirectory = toAbsoluteCanonical( defaultClassesDirectory );
551     }
552 
553     @Override
554     public File getReportsDirectory()
555     {
556         return reportsDirectory;
557     }
558 
559     @Override
560     public void setReportsDirectory( File reportsDirectory )
561     {
562         this.reportsDirectory = reportsDirectory;
563     }
564 
565     @Override
566     public String getTest()
567     {
568         return test;
569     }
570 
571     @Override
572     public void setTest( String test )
573     {
574         this.test = test;
575     }
576 
577     public File getSummaryFile()
578     {
579         return summaryFile;
580     }
581 
582     public void setSummaryFile( File summaryFile )
583     {
584         this.summaryFile = summaryFile;
585     }
586 
587     @Override
588     public boolean isPrintSummary()
589     {
590         return printSummary;
591     }
592 
593     @Override
594     public void setPrintSummary( boolean printSummary )
595     {
596         this.printSummary = printSummary;
597     }
598 
599     @Override
600     public String getReportFormat()
601     {
602         return reportFormat;
603     }
604 
605     @Override
606     public void setReportFormat( String reportFormat )
607     {
608         this.reportFormat = reportFormat;
609     }
610 
611     @Override
612     public boolean isUseFile()
613     {
614         return useFile;
615     }
616 
617     @Override
618     public void setUseFile( boolean useFile )
619     {
620         this.useFile = useFile;
621     }
622 
623     @Override
624     public String getDebugForkedProcess()
625     {
626         return debugForkedProcess;
627     }
628 
629     @Override
630     public void setDebugForkedProcess( String debugForkedProcess )
631     {
632         this.debugForkedProcess = debugForkedProcess;
633     }
634 
635     @Override
636     public int getForkedProcessTimeoutInSeconds()
637     {
638         return forkedProcessTimeoutInSeconds;
639     }
640 
641     @Override
642     public void setForkedProcessTimeoutInSeconds( int forkedProcessTimeoutInSeconds )
643     {
644         this.forkedProcessTimeoutInSeconds = forkedProcessTimeoutInSeconds;
645     }
646 
647     @Override
648     public int getForkedProcessExitTimeoutInSeconds()
649     {
650         return forkedProcessExitTimeoutInSeconds;
651     }
652 
653     @Override
654     public void setForkedProcessExitTimeoutInSeconds( int forkedProcessExitTimeoutInSeconds )
655     {
656         this.forkedProcessExitTimeoutInSeconds = forkedProcessExitTimeoutInSeconds;
657     }
658 
659     @Override
660     public double getParallelTestsTimeoutInSeconds()
661     {
662         return parallelTestsTimeoutInSeconds;
663     }
664 
665     @Override
666     public void setParallelTestsTimeoutInSeconds( double parallelTestsTimeoutInSeconds )
667     {
668         this.parallelTestsTimeoutInSeconds = parallelTestsTimeoutInSeconds;
669     }
670 
671     @Override
672     public double getParallelTestsTimeoutForcedInSeconds()
673     {
674         return parallelTestsTimeoutForcedInSeconds;
675     }
676 
677     @Override
678     public void setParallelTestsTimeoutForcedInSeconds( double parallelTestsTimeoutForcedInSeconds )
679     {
680         this.parallelTestsTimeoutForcedInSeconds = parallelTestsTimeoutForcedInSeconds;
681     }
682 
683     @Override
684     public boolean isUseSystemClassLoader()
685     {
686         return useSystemClassLoader;
687     }
688 
689     @Override
690     public void setUseSystemClassLoader( boolean useSystemClassLoader )
691     {
692         this.useSystemClassLoader = useSystemClassLoader;
693     }
694 
695     @Override
696     public boolean isUseManifestOnlyJar()
697     {
698         return useManifestOnlyJar;
699     }
700 
701     @Override
702     public void setUseManifestOnlyJar( boolean useManifestOnlyJar )
703     {
704         this.useManifestOnlyJar = useManifestOnlyJar;
705     }
706 
707     @Override
708     public String getEncoding()
709     {
710         return encoding;
711     }
712 
713     @Override
714     public void setEncoding( String encoding )
715     {
716         this.encoding = encoding;
717     }
718 
719     // the following will be refactored out once the common code is all in one place
720 
721     public boolean isTestFailureIgnore()
722     {
723         return true; // ignore
724     }
725 
726     public void setTestFailureIgnore( boolean testFailureIgnore )
727     {
728         // ignore
729     }
730 
731     @Override
732     protected void addPluginSpecificChecksumItems( ChecksumCalculator checksum )
733     {
734         checksum.add( skipITs );
735         checksum.add( summaryFile );
736     }
737 
738     @Override
739     public Boolean getFailIfNoSpecifiedTests()
740     {
741         return failIfNoSpecifiedTests;
742     }
743 
744     @Override
745     public void setFailIfNoSpecifiedTests( boolean failIfNoSpecifiedTests )
746     {
747         this.failIfNoSpecifiedTests = failIfNoSpecifiedTests;
748     }
749 
750     @Override
751     public int getSkipAfterFailureCount()
752     {
753         return skipAfterFailureCount;
754     }
755 
756     @Override
757     public String getShutdown()
758     {
759         return shutdown;
760     }
761 
762     @Override
763     public List<String> getIncludes()
764     {
765         return includes;
766     }
767 
768     @Override
769     public void setIncludes( List<String> includes )
770     {
771         this.includes = includes;
772     }
773 
774     @Override
775     public File[] getSuiteXmlFiles()
776     {
777         return suiteXmlFiles.clone();
778     }
779 
780     @Override
781     @SuppressWarnings( "UnusedDeclaration" )
782     public void setSuiteXmlFiles( File[] suiteXmlFiles )
783     {
784         this.suiteXmlFiles = suiteXmlFiles.clone();
785     }
786 
787     @Override
788     public String getRunOrder()
789     {
790         return runOrder;
791     }
792 
793     @Override
794     @SuppressWarnings( "UnusedDeclaration" )
795     public void setRunOrder( String runOrder )
796     {
797         this.runOrder = runOrder;
798     }
799 
800     @Override
801     public File getIncludesFile()
802     {
803         return includesFile;
804     }
805 
806     @Override
807     public File getExcludesFile()
808     {
809         return excludesFile;
810     }
811 
812     @Override
813     protected final List<File> suiteXmlFiles()
814     {
815         return hasSuiteXmlFiles() ? Arrays.asList( suiteXmlFiles ) : Collections.<File>emptyList();
816     }
817 
818     @Override
819     protected final boolean hasSuiteXmlFiles()
820     {
821         return suiteXmlFiles != null && suiteXmlFiles.length != 0;
822     }
823 
824     static Charset toCharset( String encoding )
825     {
826         return Charset.forName( Charset.isSupported( encoding ) ? encoding : encoding.toUpperCase( Locale.ROOT ) );
827     }
828 }