1 | |
package org.apache.maven.plugin.failsafe; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
import static org.codehaus.plexus.util.IOUtil.*; |
23 | |
|
24 | |
import java.io.BufferedInputStream; |
25 | |
import java.io.BufferedOutputStream; |
26 | |
import java.io.BufferedReader; |
27 | |
import java.io.File; |
28 | |
import java.io.FileInputStream; |
29 | |
import java.io.FileOutputStream; |
30 | |
import java.io.IOException; |
31 | |
import java.io.InputStreamReader; |
32 | |
import java.io.OutputStreamWriter; |
33 | |
import java.io.Writer; |
34 | |
import java.util.ArrayList; |
35 | |
import java.util.HashMap; |
36 | |
import java.util.List; |
37 | |
import java.util.Map; |
38 | |
import java.util.Properties; |
39 | |
|
40 | |
import org.apache.maven.artifact.Artifact; |
41 | |
import org.apache.maven.artifact.factory.ArtifactFactory; |
42 | |
import org.apache.maven.artifact.metadata.ArtifactMetadataSource; |
43 | |
import org.apache.maven.artifact.repository.ArtifactRepository; |
44 | |
import org.apache.maven.artifact.resolver.ArtifactResolver; |
45 | |
import org.apache.maven.execution.MavenSession; |
46 | |
import org.apache.maven.plugin.MojoExecution; |
47 | |
import org.apache.maven.plugin.MojoExecutionException; |
48 | |
import org.apache.maven.plugin.MojoFailureException; |
49 | |
import org.apache.maven.plugin.descriptor.PluginDescriptor; |
50 | |
import org.apache.maven.plugin.surefire.AbstractSurefireMojo; |
51 | |
import org.apache.maven.plugin.surefire.Summary; |
52 | |
import org.apache.maven.plugin.surefire.booterclient.ChecksumCalculator; |
53 | |
import org.apache.maven.project.MavenProject; |
54 | |
import org.apache.maven.surefire.booter.ProviderConfiguration; |
55 | |
import org.apache.maven.surefire.failsafe.model.FailsafeSummary; |
56 | |
import org.apache.maven.surefire.failsafe.model.io.xpp3.FailsafeSummaryXpp3Reader; |
57 | |
import org.apache.maven.surefire.failsafe.model.io.xpp3.FailsafeSummaryXpp3Writer; |
58 | |
import org.apache.maven.surefire.suite.RunResult; |
59 | |
import org.apache.maven.toolchain.ToolchainManager; |
60 | |
import org.codehaus.plexus.util.ReaderFactory; |
61 | |
import org.codehaus.plexus.util.StringUtils; |
62 | |
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; |
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | 0 | public class IntegrationTestMojo |
77 | |
extends AbstractSurefireMojo |
78 | |
{ |
79 | |
|
80 | |
private static final String FAILSAFE_IN_PROGRESS_CONTEXT_KEY = "failsafe-in-progress"; |
81 | |
|
82 | |
|
83 | |
|
84 | |
|
85 | |
|
86 | |
|
87 | |
|
88 | |
|
89 | |
|
90 | |
private PluginDescriptor pluginDescriptor; |
91 | |
|
92 | |
|
93 | |
|
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | |
private boolean skipTests; |
100 | |
|
101 | |
|
102 | |
|
103 | |
|
104 | |
|
105 | |
|
106 | |
|
107 | |
|
108 | |
private boolean skipITs; |
109 | |
|
110 | |
|
111 | |
|
112 | |
|
113 | |
|
114 | |
|
115 | |
|
116 | |
|
117 | |
private boolean skipExec; |
118 | |
|
119 | |
|
120 | |
|
121 | |
|
122 | |
|
123 | |
|
124 | |
|
125 | |
|
126 | |
private boolean skip; |
127 | |
|
128 | |
|
129 | |
|
130 | |
|
131 | |
|
132 | |
|
133 | |
|
134 | |
private File basedir; |
135 | |
|
136 | |
|
137 | |
|
138 | |
|
139 | |
|
140 | |
|
141 | |
|
142 | |
private File testClassesDirectory; |
143 | |
|
144 | |
|
145 | |
|
146 | |
|
147 | |
|
148 | |
|
149 | |
|
150 | |
private File classesDirectory; |
151 | |
|
152 | |
|
153 | |
|
154 | |
|
155 | |
|
156 | |
|
157 | |
|
158 | |
private MavenProject project; |
159 | |
|
160 | |
|
161 | |
|
162 | |
|
163 | |
|
164 | |
|
165 | |
|
166 | |
|
167 | |
private List<String> classpathDependencyExcludes; |
168 | |
|
169 | |
|
170 | |
|
171 | |
|
172 | |
|
173 | |
|
174 | |
|
175 | |
|
176 | |
|
177 | |
|
178 | |
|
179 | |
|
180 | |
|
181 | |
|
182 | |
|
183 | |
|
184 | |
private String classpathDependencyScopeExclude; |
185 | |
|
186 | |
|
187 | |
|
188 | |
|
189 | |
|
190 | |
|
191 | |
|
192 | |
private List<String> additionalClasspathElements; |
193 | |
|
194 | |
|
195 | |
|
196 | |
|
197 | |
|
198 | |
|
199 | |
private File reportsDirectory; |
200 | |
|
201 | |
|
202 | |
|
203 | |
|
204 | |
|
205 | |
|
206 | |
|
207 | |
|
208 | |
private File testSourceDirectory; |
209 | |
|
210 | |
|
211 | |
|
212 | |
|
213 | |
|
214 | |
|
215 | |
|
216 | |
|
217 | |
|
218 | |
|
219 | |
|
220 | |
|
221 | |
|
222 | |
|
223 | |
private String test; |
224 | |
|
225 | |
|
226 | |
|
227 | |
|
228 | |
|
229 | |
|
230 | |
|
231 | |
|
232 | |
|
233 | |
|
234 | |
|
235 | |
|
236 | |
|
237 | |
|
238 | |
|
239 | |
|
240 | |
|
241 | |
|
242 | |
private List<String> includes; |
243 | |
|
244 | |
|
245 | |
|
246 | |
|
247 | |
|
248 | |
|
249 | |
|
250 | |
|
251 | |
|
252 | |
|
253 | |
|
254 | |
|
255 | |
|
256 | |
|
257 | |
|
258 | |
private List<String> excludes; |
259 | |
|
260 | |
|
261 | |
|
262 | |
|
263 | |
|
264 | |
|
265 | |
|
266 | |
|
267 | |
|
268 | |
private ArtifactRepository localRepository; |
269 | |
|
270 | |
|
271 | |
|
272 | |
|
273 | |
|
274 | |
|
275 | |
|
276 | |
private Properties systemProperties; |
277 | |
|
278 | |
|
279 | |
|
280 | |
|
281 | |
|
282 | |
|
283 | |
|
284 | |
private Map<String,String> systemPropertyVariables; |
285 | |
|
286 | |
|
287 | |
|
288 | |
|
289 | |
|
290 | |
|
291 | |
|
292 | |
private File systemPropertiesFile; |
293 | |
|
294 | |
|
295 | |
|
296 | |
|
297 | |
|
298 | |
|
299 | |
|
300 | |
|
301 | |
private Properties properties; |
302 | |
|
303 | |
|
304 | |
|
305 | |
|
306 | |
|
307 | |
|
308 | |
|
309 | |
|
310 | |
private Map<String,Artifact> pluginArtifactMap; |
311 | |
|
312 | |
|
313 | |
|
314 | |
|
315 | |
|
316 | |
|
317 | |
|
318 | |
|
319 | |
private Map<String,Artifact> projectArtifactMap; |
320 | |
|
321 | |
|
322 | |
|
323 | |
|
324 | |
|
325 | |
|
326 | |
|
327 | |
private File summaryFile; |
328 | |
|
329 | |
|
330 | |
|
331 | |
|
332 | |
|
333 | |
|
334 | |
private boolean printSummary; |
335 | |
|
336 | |
|
337 | |
|
338 | |
|
339 | |
|
340 | |
|
341 | |
private String reportFormat; |
342 | |
|
343 | |
|
344 | |
|
345 | |
|
346 | |
|
347 | |
|
348 | |
|
349 | |
|
350 | |
|
351 | |
private String reportNameSuffix; |
352 | |
|
353 | |
|
354 | |
|
355 | |
|
356 | |
|
357 | |
|
358 | |
private boolean useFile; |
359 | |
|
360 | |
|
361 | |
|
362 | |
|
363 | |
|
364 | |
|
365 | |
|
366 | |
|
367 | |
private boolean redirectTestOutputToFile; |
368 | |
|
369 | |
|
370 | |
|
371 | |
|
372 | |
|
373 | |
|
374 | |
|
375 | |
private Boolean failIfNoTests; |
376 | |
|
377 | |
|
378 | |
|
379 | |
|
380 | |
|
381 | |
|
382 | |
|
383 | |
|
384 | |
private Boolean failIfNoSpecifiedTests; |
385 | |
|
386 | |
|
387 | |
|
388 | |
|
389 | |
|
390 | |
|
391 | |
|
392 | |
|
393 | |
private String forkMode; |
394 | |
|
395 | |
|
396 | |
|
397 | |
|
398 | |
|
399 | |
|
400 | |
|
401 | |
|
402 | |
|
403 | |
private String jvm; |
404 | |
|
405 | |
|
406 | |
|
407 | |
|
408 | |
|
409 | |
|
410 | |
|
411 | |
private String argLine; |
412 | |
|
413 | |
|
414 | |
|
415 | |
|
416 | |
|
417 | |
|
418 | |
|
419 | |
|
420 | |
|
421 | |
|
422 | |
private String debugForkedProcess; |
423 | |
|
424 | |
|
425 | |
|
426 | |
|
427 | |
|
428 | |
|
429 | |
|
430 | |
|
431 | |
private int forkedProcessTimeoutInSeconds; |
432 | |
|
433 | |
|
434 | |
|
435 | |
|
436 | |
|
437 | |
|
438 | |
|
439 | 0 | private Map<String,String> environmentVariables = new HashMap<String,String>(); |
440 | |
|
441 | |
|
442 | |
|
443 | |
|
444 | |
|
445 | |
|
446 | |
|
447 | |
private File workingDirectory; |
448 | |
|
449 | |
|
450 | |
|
451 | |
|
452 | |
|
453 | |
|
454 | |
|
455 | |
|
456 | |
|
457 | |
|
458 | |
private boolean childDelegation; |
459 | |
|
460 | |
|
461 | |
|
462 | |
|
463 | |
|
464 | |
|
465 | |
|
466 | |
|
467 | |
|
468 | |
private String groups; |
469 | |
|
470 | |
|
471 | |
|
472 | |
|
473 | |
|
474 | |
|
475 | |
|
476 | |
|
477 | |
|
478 | |
private String excludedGroups; |
479 | |
|
480 | |
|
481 | |
|
482 | |
|
483 | |
|
484 | |
|
485 | |
|
486 | |
|
487 | |
|
488 | |
|
489 | |
|
490 | |
private File[] suiteXmlFiles; |
491 | |
|
492 | |
|
493 | |
|
494 | |
|
495 | |
|
496 | |
|
497 | |
|
498 | |
private String junitArtifactName; |
499 | |
|
500 | |
|
501 | |
|
502 | |
|
503 | |
|
504 | |
|
505 | |
|
506 | |
private String testNGArtifactName; |
507 | |
|
508 | |
|
509 | |
|
510 | |
|
511 | |
|
512 | |
|
513 | |
|
514 | |
|
515 | |
|
516 | |
private int threadCount; |
517 | |
|
518 | |
|
519 | |
|
520 | |
|
521 | |
|
522 | |
|
523 | |
|
524 | |
private boolean perCoreThreadCount; |
525 | |
|
526 | |
|
527 | |
|
528 | |
|
529 | |
|
530 | |
|
531 | |
|
532 | |
|
533 | |
|
534 | |
private boolean useUnlimitedThreads; |
535 | |
|
536 | |
|
537 | |
|
538 | |
|
539 | |
|
540 | |
|
541 | |
|
542 | |
|
543 | |
|
544 | |
|
545 | |
|
546 | |
|
547 | |
|
548 | |
private String parallel; |
549 | |
|
550 | |
|
551 | |
|
552 | |
|
553 | |
|
554 | |
|
555 | |
|
556 | |
private boolean trimStackTrace; |
557 | |
|
558 | |
|
559 | |
|
560 | |
|
561 | |
|
562 | |
|
563 | |
private ArtifactResolver artifactResolver; |
564 | |
|
565 | |
|
566 | |
|
567 | |
|
568 | |
|
569 | |
|
570 | |
private ArtifactFactory artifactFactory; |
571 | |
|
572 | |
|
573 | |
|
574 | |
|
575 | |
|
576 | |
|
577 | |
|
578 | |
private List remoteRepositories; |
579 | |
|
580 | |
|
581 | |
|
582 | |
|
583 | |
|
584 | |
|
585 | |
private ArtifactMetadataSource metadataSource; |
586 | |
|
587 | |
private Properties originalSystemProperties; |
588 | |
|
589 | |
|
590 | |
|
591 | |
|
592 | 0 | private Properties internalSystemProperties = new Properties(); |
593 | |
|
594 | |
|
595 | |
|
596 | |
|
597 | |
|
598 | |
|
599 | |
|
600 | |
private boolean disableXmlReport; |
601 | |
|
602 | |
|
603 | |
|
604 | |
|
605 | |
|
606 | |
|
607 | |
|
608 | |
|
609 | |
|
610 | |
private boolean useSystemClassLoader; |
611 | |
|
612 | |
|
613 | |
|
614 | |
|
615 | |
|
616 | |
|
617 | |
|
618 | |
|
619 | |
|
620 | |
|
621 | |
|
622 | |
|
623 | |
private boolean useManifestOnlyJar; |
624 | |
|
625 | |
|
626 | |
|
627 | |
|
628 | |
|
629 | |
|
630 | |
|
631 | |
|
632 | |
private boolean enableAssertions; |
633 | |
|
634 | |
|
635 | |
|
636 | |
|
637 | |
|
638 | |
|
639 | |
|
640 | |
|
641 | |
private MavenSession session; |
642 | |
|
643 | |
|
644 | |
|
645 | |
|
646 | |
|
647 | |
|
648 | |
|
649 | |
private String objectFactory; |
650 | |
|
651 | |
|
652 | |
|
653 | |
|
654 | |
|
655 | |
|
656 | |
private String encoding; |
657 | |
|
658 | |
|
659 | |
|
660 | |
|
661 | |
|
662 | |
private Boolean parallelMavenExecution; |
663 | |
|
664 | |
|
665 | |
|
666 | |
|
667 | |
|
668 | |
|
669 | |
|
670 | |
|
671 | |
|
672 | |
|
673 | |
|
674 | |
|
675 | |
|
676 | |
|
677 | |
|
678 | |
|
679 | |
|
680 | |
|
681 | |
|
682 | |
|
683 | |
|
684 | |
|
685 | |
private String runOrder; |
686 | |
|
687 | |
|
688 | |
|
689 | |
|
690 | |
private ToolchainManager toolchainManager; |
691 | |
|
692 | |
protected void handleSummary( Summary summary ) |
693 | |
throws MojoExecutionException, MojoFailureException |
694 | |
{ |
695 | 0 | FailsafeSummary failsafeSummary = createFailsafeSummaryFromSummary( summary ); |
696 | 0 | writeSummary( failsafeSummary ); |
697 | 0 | } |
698 | |
|
699 | |
private FailsafeSummary createFailsafeSummaryFromSummary( Summary summary ) |
700 | |
{ |
701 | 0 | FailsafeSummary failsafeSummary = new FailsafeSummary(); |
702 | 0 | if ( summary.isErrorFree() ) |
703 | |
{ |
704 | 0 | RunResult result = summary.getResultOfLastSuccessfulRun(); |
705 | 0 | if ( result != null ) |
706 | |
{ |
707 | 0 | failsafeSummary.setResult( result.getForkedProcessCode() ); |
708 | |
} |
709 | 0 | } |
710 | |
else |
711 | |
{ |
712 | 0 | failsafeSummary.setResult( ProviderConfiguration.TESTS_FAILED_EXIT_CODE ); |
713 | |
|
714 | 0 | failsafeSummary.setException( summary.getFirstException().getMessage() ); |
715 | |
} |
716 | 0 | return failsafeSummary; |
717 | |
} |
718 | |
|
719 | |
@SuppressWarnings( "unchecked" ) |
720 | |
private void writeSummary( FailsafeSummary summary ) |
721 | |
throws MojoExecutionException |
722 | |
{ |
723 | 0 | File summaryFile = getSummaryFile(); |
724 | 0 | if ( !summaryFile.getParentFile().isDirectory() ) |
725 | |
{ |
726 | 0 | summaryFile.getParentFile().mkdirs(); |
727 | |
} |
728 | |
|
729 | 0 | FileOutputStream fout = null; |
730 | 0 | FileInputStream fin = null; |
731 | |
try |
732 | |
{ |
733 | 0 | FailsafeSummary mergedSummary = summary; |
734 | 0 | Object token = getPluginContext().get( FAILSAFE_IN_PROGRESS_CONTEXT_KEY ); |
735 | 0 | if ( summaryFile.exists() && token != null ) |
736 | |
{ |
737 | 0 | fin = new FileInputStream( summaryFile ); |
738 | |
|
739 | 0 | mergedSummary = |
740 | |
new FailsafeSummaryXpp3Reader().read( new InputStreamReader( new BufferedInputStream( fin ), |
741 | |
getEncodingOrDefault() ) ); |
742 | |
|
743 | 0 | mergedSummary.merge( summary ); |
744 | |
} |
745 | |
|
746 | 0 | fout = new FileOutputStream( summaryFile ); |
747 | 0 | BufferedOutputStream bufferedOutputStream = new BufferedOutputStream( fout ); |
748 | 0 | Writer writer = new OutputStreamWriter( bufferedOutputStream, getEncodingOrDefault() ); |
749 | 0 | FailsafeSummaryXpp3Writer xpp3Writer = new FailsafeSummaryXpp3Writer(); |
750 | 0 | xpp3Writer.write( writer, mergedSummary ); |
751 | 0 | writer.close(); |
752 | 0 | bufferedOutputStream.close(); |
753 | |
} |
754 | 0 | catch ( IOException e ) |
755 | |
{ |
756 | 0 | throw new MojoExecutionException( e.getMessage(), e ); |
757 | |
} |
758 | 0 | catch ( XmlPullParserException e ) |
759 | |
{ |
760 | 0 | throw new MojoExecutionException( e.getMessage(), e ); |
761 | |
} |
762 | |
finally |
763 | |
{ |
764 | 0 | close( fin ); |
765 | 0 | close( fout ); |
766 | 0 | } |
767 | |
|
768 | 0 | getPluginContext().put( FAILSAFE_IN_PROGRESS_CONTEXT_KEY, FAILSAFE_IN_PROGRESS_CONTEXT_KEY ); |
769 | 0 | } |
770 | |
|
771 | |
private String getEncodingOrDefault() |
772 | |
{ |
773 | 0 | if ( StringUtils.isEmpty( encoding ) ) |
774 | |
{ |
775 | 0 | getLog().warn( "File encoding has not been set, using platform encoding " + ReaderFactory.FILE_ENCODING + |
776 | |
", i.e. build is platform dependent!" ); |
777 | 0 | return ReaderFactory.FILE_ENCODING; |
778 | |
} |
779 | |
else |
780 | |
{ |
781 | 0 | return encoding; |
782 | |
} |
783 | |
} |
784 | |
|
785 | |
protected boolean isSkipExecution() |
786 | |
{ |
787 | 0 | return isSkip() || isSkipTests() || isSkipITs() || isSkipExec(); |
788 | |
} |
789 | |
|
790 | |
protected String getPluginName() |
791 | |
{ |
792 | 0 | return "failsafe"; |
793 | |
} |
794 | |
|
795 | |
protected String[] getDefaultIncludes() |
796 | |
{ |
797 | 0 | return new String[]{ "**/IT*.java", "**/*IT.java", "**/*ITCase.java" }; |
798 | |
} |
799 | |
|
800 | |
public boolean isSkipTests() |
801 | |
{ |
802 | 0 | return skipTests; |
803 | |
} |
804 | |
|
805 | |
public void setSkipTests( boolean skipTests ) |
806 | |
{ |
807 | 0 | this.skipTests = skipTests; |
808 | 0 | } |
809 | |
|
810 | |
public boolean isSkipITs() |
811 | |
{ |
812 | 0 | return skipITs; |
813 | |
} |
814 | |
|
815 | |
public void setSkipITs( boolean skipITs ) |
816 | |
{ |
817 | 0 | this.skipITs = skipITs; |
818 | 0 | } |
819 | |
|
820 | |
public boolean isSkipExec() |
821 | |
{ |
822 | 0 | return skipExec; |
823 | |
} |
824 | |
|
825 | |
public void setSkipExec( boolean skipExec ) |
826 | |
{ |
827 | 0 | this.skipExec = skipExec; |
828 | 0 | } |
829 | |
|
830 | |
public boolean isSkip() |
831 | |
{ |
832 | 0 | return skip; |
833 | |
} |
834 | |
|
835 | |
public void setSkip( boolean skip ) |
836 | |
{ |
837 | 0 | this.skip = skip; |
838 | 0 | } |
839 | |
|
840 | |
public File getBasedir() |
841 | |
{ |
842 | 0 | return basedir; |
843 | |
} |
844 | |
|
845 | |
public void setBasedir( File basedir ) |
846 | |
{ |
847 | 0 | this.basedir = basedir; |
848 | 0 | } |
849 | |
|
850 | |
public File getTestClassesDirectory() |
851 | |
{ |
852 | 0 | return testClassesDirectory; |
853 | |
} |
854 | |
|
855 | |
public void setTestClassesDirectory( File testClassesDirectory ) |
856 | |
{ |
857 | 0 | this.testClassesDirectory = testClassesDirectory; |
858 | 0 | } |
859 | |
|
860 | |
public File getClassesDirectory() |
861 | |
{ |
862 | 0 | return classesDirectory; |
863 | |
} |
864 | |
|
865 | |
public void setClassesDirectory( File classesDirectory ) |
866 | |
{ |
867 | 0 | this.classesDirectory = classesDirectory; |
868 | 0 | } |
869 | |
|
870 | |
public MavenProject getProject() |
871 | |
{ |
872 | 0 | return project; |
873 | |
} |
874 | |
|
875 | |
public void setProject( MavenProject project ) |
876 | |
{ |
877 | 0 | this.project = project; |
878 | 0 | } |
879 | |
|
880 | |
public List getClasspathDependencyExcludes() |
881 | |
{ |
882 | 0 | return classpathDependencyExcludes; |
883 | |
} |
884 | |
|
885 | |
public void setClasspathDependencyExcludes( List classpathDependencyExcludes ) |
886 | |
{ |
887 | 0 | this.classpathDependencyExcludes = classpathDependencyExcludes; |
888 | 0 | } |
889 | |
|
890 | |
public String getClasspathDependencyScopeExclude() |
891 | |
{ |
892 | 0 | return classpathDependencyScopeExclude; |
893 | |
} |
894 | |
|
895 | |
public void setClasspathDependencyScopeExclude( String classpathDependencyScopeExclude ) |
896 | |
{ |
897 | 0 | this.classpathDependencyScopeExclude = classpathDependencyScopeExclude; |
898 | 0 | } |
899 | |
|
900 | |
public List getAdditionalClasspathElements() |
901 | |
{ |
902 | 0 | return additionalClasspathElements; |
903 | |
} |
904 | |
|
905 | |
public void setAdditionalClasspathElements( List additionalClasspathElements ) |
906 | |
{ |
907 | 0 | this.additionalClasspathElements = additionalClasspathElements; |
908 | 0 | } |
909 | |
|
910 | |
public File getReportsDirectory() |
911 | |
{ |
912 | 0 | return reportsDirectory; |
913 | |
} |
914 | |
|
915 | |
public void setReportsDirectory( File reportsDirectory ) |
916 | |
{ |
917 | 0 | this.reportsDirectory = reportsDirectory; |
918 | 0 | } |
919 | |
|
920 | |
public File getTestSourceDirectory() |
921 | |
{ |
922 | 0 | return testSourceDirectory; |
923 | |
} |
924 | |
|
925 | |
public void setTestSourceDirectory( File testSourceDirectory ) |
926 | |
{ |
927 | 0 | this.testSourceDirectory = testSourceDirectory; |
928 | 0 | } |
929 | |
|
930 | |
public String getTest() |
931 | |
{ |
932 | 0 | if ( StringUtils.isBlank( test ) ) |
933 | |
{ |
934 | 0 | return null; |
935 | |
} |
936 | 0 | int index = test.indexOf( '#' ); |
937 | 0 | if ( index >= 0 ) |
938 | |
{ |
939 | 0 | return test.substring( 0, index ); |
940 | |
} |
941 | 0 | return test; |
942 | |
} |
943 | |
|
944 | |
public void setTest( String test ) |
945 | |
{ |
946 | 0 | this.test = test; |
947 | 0 | } |
948 | |
|
949 | |
|
950 | |
|
951 | |
|
952 | |
public String getTestMethod() |
953 | |
{ |
954 | 0 | if ( StringUtils.isBlank( test ) ) |
955 | |
{ |
956 | 0 | return null; |
957 | |
} |
958 | 0 | int index = this.test.indexOf( '#' ); |
959 | 0 | if ( index >= 0 ) |
960 | |
{ |
961 | 0 | return this.test.substring( index + 1, this.test.length() ); |
962 | |
} |
963 | 0 | return null; |
964 | |
} |
965 | |
|
966 | |
public List<String> getIncludes() |
967 | |
{ |
968 | 0 | return includes; |
969 | |
} |
970 | |
|
971 | |
public void setIncludes( List<String> includes ) |
972 | |
{ |
973 | 0 | this.includes = includes; |
974 | 0 | } |
975 | |
|
976 | |
public List<String> getExcludes() |
977 | |
{ |
978 | 0 | return excludes; |
979 | |
} |
980 | |
|
981 | |
public void setExcludes( List<String> excludes ) |
982 | |
{ |
983 | 0 | this.excludes = excludes; |
984 | 0 | } |
985 | |
|
986 | |
public ArtifactRepository getLocalRepository() |
987 | |
{ |
988 | 0 | return localRepository; |
989 | |
} |
990 | |
|
991 | |
public void setLocalRepository( ArtifactRepository localRepository ) |
992 | |
{ |
993 | 0 | this.localRepository = localRepository; |
994 | 0 | } |
995 | |
|
996 | |
public Properties getSystemProperties() |
997 | |
{ |
998 | 0 | return systemProperties; |
999 | |
} |
1000 | |
|
1001 | |
public void setSystemProperties( Properties systemProperties ) |
1002 | |
{ |
1003 | 0 | this.systemProperties = systemProperties; |
1004 | 0 | } |
1005 | |
|
1006 | |
public Map<String,String> getSystemPropertyVariables() |
1007 | |
{ |
1008 | 0 | return systemPropertyVariables; |
1009 | |
} |
1010 | |
|
1011 | |
public void setSystemPropertyVariables( Map<String,String> systemPropertyVariables ) |
1012 | |
{ |
1013 | 0 | this.systemPropertyVariables = systemPropertyVariables; |
1014 | 0 | } |
1015 | |
|
1016 | |
public File getSystemPropertiesFile() |
1017 | |
{ |
1018 | 0 | return systemPropertiesFile; |
1019 | |
} |
1020 | |
|
1021 | |
public void setSystemPropertiesFile( File systemPropertiesFile ) |
1022 | |
{ |
1023 | 0 | this.systemPropertiesFile = systemPropertiesFile; |
1024 | 0 | } |
1025 | |
|
1026 | |
public Properties getProperties() |
1027 | |
{ |
1028 | 0 | return properties; |
1029 | |
} |
1030 | |
|
1031 | |
public void setProperties( Properties properties ) |
1032 | |
{ |
1033 | 0 | this.properties = properties; |
1034 | 0 | } |
1035 | |
|
1036 | |
public Map<String,Artifact> getPluginArtifactMap() |
1037 | |
{ |
1038 | 0 | return pluginArtifactMap; |
1039 | |
} |
1040 | |
|
1041 | |
public void setPluginArtifactMap( Map<String,Artifact> pluginArtifactMap ) |
1042 | |
{ |
1043 | 0 | this.pluginArtifactMap = pluginArtifactMap; |
1044 | 0 | } |
1045 | |
|
1046 | |
public Map getProjectArtifactMap() |
1047 | |
{ |
1048 | 0 | return projectArtifactMap; |
1049 | |
} |
1050 | |
|
1051 | |
public void setProjectArtifactMap( Map projectArtifactMap ) |
1052 | |
{ |
1053 | 0 | this.projectArtifactMap = projectArtifactMap; |
1054 | 0 | } |
1055 | |
|
1056 | |
public File getSummaryFile() |
1057 | |
{ |
1058 | 0 | return summaryFile; |
1059 | |
} |
1060 | |
|
1061 | |
public void setSummaryFile( File summaryFile ) |
1062 | |
{ |
1063 | 0 | this.summaryFile = summaryFile; |
1064 | 0 | } |
1065 | |
|
1066 | |
public boolean isPrintSummary() |
1067 | |
{ |
1068 | 0 | return printSummary; |
1069 | |
} |
1070 | |
|
1071 | |
public void setPrintSummary( boolean printSummary ) |
1072 | |
{ |
1073 | 0 | this.printSummary = printSummary; |
1074 | 0 | } |
1075 | |
|
1076 | |
public String getReportFormat() |
1077 | |
{ |
1078 | 0 | return reportFormat; |
1079 | |
} |
1080 | |
|
1081 | |
public void setReportFormat( String reportFormat ) |
1082 | |
{ |
1083 | 0 | this.reportFormat = reportFormat; |
1084 | 0 | } |
1085 | |
|
1086 | |
public String getReportNameSuffix() |
1087 | |
{ |
1088 | 0 | return reportNameSuffix; |
1089 | |
} |
1090 | |
|
1091 | |
public void setReportNameSuffix( String reportNameSuffix ) |
1092 | |
{ |
1093 | 0 | this.reportNameSuffix = reportNameSuffix; |
1094 | 0 | } |
1095 | |
|
1096 | |
public boolean isUseFile() |
1097 | |
{ |
1098 | 0 | return useFile; |
1099 | |
} |
1100 | |
|
1101 | |
public void setUseFile( boolean useFile ) |
1102 | |
{ |
1103 | 0 | this.useFile = useFile; |
1104 | 0 | } |
1105 | |
|
1106 | |
public boolean isRedirectTestOutputToFile() |
1107 | |
{ |
1108 | 0 | return redirectTestOutputToFile; |
1109 | |
} |
1110 | |
|
1111 | |
public void setRedirectTestOutputToFile( boolean redirectTestOutputToFile ) |
1112 | |
{ |
1113 | 0 | this.redirectTestOutputToFile = redirectTestOutputToFile; |
1114 | 0 | } |
1115 | |
|
1116 | |
public Boolean getFailIfNoTests() |
1117 | |
{ |
1118 | 0 | return failIfNoTests; |
1119 | |
} |
1120 | |
|
1121 | |
public void setFailIfNoTests( Boolean failIfNoTests ) |
1122 | |
{ |
1123 | 0 | this.failIfNoTests = failIfNoTests; |
1124 | 0 | } |
1125 | |
|
1126 | |
public String getForkMode() |
1127 | |
{ |
1128 | 0 | return forkMode; |
1129 | |
} |
1130 | |
|
1131 | |
public void setForkMode( String forkMode ) |
1132 | |
{ |
1133 | 0 | this.forkMode = forkMode; |
1134 | 0 | } |
1135 | |
|
1136 | |
public String getJvm() |
1137 | |
{ |
1138 | 0 | return jvm; |
1139 | |
} |
1140 | |
|
1141 | |
public void setJvm( String jvm ) |
1142 | |
{ |
1143 | 0 | this.jvm = jvm; |
1144 | 0 | } |
1145 | |
|
1146 | |
public String getArgLine() |
1147 | |
{ |
1148 | 0 | return argLine; |
1149 | |
} |
1150 | |
|
1151 | |
public void setArgLine( String argLine ) |
1152 | |
{ |
1153 | 0 | this.argLine = argLine; |
1154 | 0 | } |
1155 | |
|
1156 | |
public String getDebugForkedProcess() |
1157 | |
{ |
1158 | 0 | return debugForkedProcess; |
1159 | |
} |
1160 | |
|
1161 | |
public void setDebugForkedProcess( String debugForkedProcess ) |
1162 | |
{ |
1163 | 0 | this.debugForkedProcess = debugForkedProcess; |
1164 | 0 | } |
1165 | |
|
1166 | |
public int getForkedProcessTimeoutInSeconds() |
1167 | |
{ |
1168 | 0 | return forkedProcessTimeoutInSeconds; |
1169 | |
} |
1170 | |
|
1171 | |
public void setForkedProcessTimeoutInSeconds( int forkedProcessTimeoutInSeconds ) |
1172 | |
{ |
1173 | 0 | this.forkedProcessTimeoutInSeconds = forkedProcessTimeoutInSeconds; |
1174 | 0 | } |
1175 | |
|
1176 | |
public Map<String,String> getEnvironmentVariables() |
1177 | |
{ |
1178 | 0 | return environmentVariables; |
1179 | |
} |
1180 | |
|
1181 | |
public void setEnvironmentVariables( Map<String,String> environmentVariables ) |
1182 | |
{ |
1183 | 0 | this.environmentVariables = environmentVariables; |
1184 | 0 | } |
1185 | |
|
1186 | |
public File getWorkingDirectory() |
1187 | |
{ |
1188 | 0 | return workingDirectory; |
1189 | |
} |
1190 | |
|
1191 | |
public void setWorkingDirectory( File workingDirectory ) |
1192 | |
{ |
1193 | 0 | this.workingDirectory = workingDirectory; |
1194 | 0 | } |
1195 | |
|
1196 | |
public boolean isChildDelegation() |
1197 | |
{ |
1198 | 0 | return childDelegation; |
1199 | |
} |
1200 | |
|
1201 | |
public void setChildDelegation( boolean childDelegation ) |
1202 | |
{ |
1203 | 0 | this.childDelegation = childDelegation; |
1204 | 0 | } |
1205 | |
|
1206 | |
public String getGroups() |
1207 | |
{ |
1208 | 0 | return groups; |
1209 | |
} |
1210 | |
|
1211 | |
public void setGroups( String groups ) |
1212 | |
{ |
1213 | 0 | this.groups = groups; |
1214 | 0 | } |
1215 | |
|
1216 | |
public String getExcludedGroups() |
1217 | |
{ |
1218 | 0 | return excludedGroups; |
1219 | |
} |
1220 | |
|
1221 | |
public void setExcludedGroups( String excludedGroups ) |
1222 | |
{ |
1223 | 0 | this.excludedGroups = excludedGroups; |
1224 | 0 | } |
1225 | |
|
1226 | |
public File[] getSuiteXmlFiles() |
1227 | |
{ |
1228 | 0 | return suiteXmlFiles; |
1229 | |
} |
1230 | |
|
1231 | |
public void setSuiteXmlFiles( File[] suiteXmlFiles ) |
1232 | |
{ |
1233 | 0 | this.suiteXmlFiles = suiteXmlFiles; |
1234 | 0 | } |
1235 | |
|
1236 | |
public String getJunitArtifactName() |
1237 | |
{ |
1238 | 0 | return junitArtifactName; |
1239 | |
} |
1240 | |
|
1241 | |
public void setJunitArtifactName( String junitArtifactName ) |
1242 | |
{ |
1243 | 0 | this.junitArtifactName = junitArtifactName; |
1244 | 0 | } |
1245 | |
|
1246 | |
public String getTestNGArtifactName() |
1247 | |
{ |
1248 | 0 | return testNGArtifactName; |
1249 | |
} |
1250 | |
|
1251 | |
public void setTestNGArtifactName( String testNGArtifactName ) |
1252 | |
{ |
1253 | 0 | this.testNGArtifactName = testNGArtifactName; |
1254 | 0 | } |
1255 | |
|
1256 | |
public int getThreadCount() |
1257 | |
{ |
1258 | 0 | return threadCount; |
1259 | |
} |
1260 | |
|
1261 | |
public void setThreadCount( int threadCount ) |
1262 | |
{ |
1263 | 0 | this.threadCount = threadCount; |
1264 | 0 | } |
1265 | |
|
1266 | |
public boolean getPerCoreThreadCount() |
1267 | |
{ |
1268 | 0 | return perCoreThreadCount; |
1269 | |
} |
1270 | |
|
1271 | |
public void setPerCoreThreadCount( boolean perCoreThreadCount ) |
1272 | |
{ |
1273 | 0 | this.perCoreThreadCount = perCoreThreadCount; |
1274 | 0 | } |
1275 | |
|
1276 | |
public boolean getUseUnlimitedThreads() |
1277 | |
{ |
1278 | 0 | return useUnlimitedThreads; |
1279 | |
} |
1280 | |
|
1281 | |
public void setUseUnlimitedThreads( boolean useUnlimitedThreads ) |
1282 | |
{ |
1283 | 0 | this.useUnlimitedThreads = useUnlimitedThreads; |
1284 | 0 | } |
1285 | |
|
1286 | |
public String getParallel() |
1287 | |
{ |
1288 | 0 | return parallel; |
1289 | |
} |
1290 | |
|
1291 | |
public void setParallel( String parallel ) |
1292 | |
{ |
1293 | 0 | this.parallel = parallel; |
1294 | 0 | } |
1295 | |
|
1296 | |
public boolean isTrimStackTrace() |
1297 | |
{ |
1298 | 0 | return trimStackTrace; |
1299 | |
} |
1300 | |
|
1301 | |
public void setTrimStackTrace( boolean trimStackTrace ) |
1302 | |
{ |
1303 | 0 | this.trimStackTrace = trimStackTrace; |
1304 | 0 | } |
1305 | |
|
1306 | |
public ArtifactResolver getArtifactResolver() |
1307 | |
{ |
1308 | 0 | return artifactResolver; |
1309 | |
} |
1310 | |
|
1311 | |
public void setArtifactResolver( ArtifactResolver artifactResolver ) |
1312 | |
{ |
1313 | 0 | this.artifactResolver = artifactResolver; |
1314 | 0 | } |
1315 | |
|
1316 | |
public ArtifactFactory getArtifactFactory() |
1317 | |
{ |
1318 | 0 | return artifactFactory; |
1319 | |
} |
1320 | |
|
1321 | |
public void setArtifactFactory( ArtifactFactory artifactFactory ) |
1322 | |
{ |
1323 | 0 | this.artifactFactory = artifactFactory; |
1324 | 0 | } |
1325 | |
|
1326 | |
public List getRemoteRepositories() |
1327 | |
{ |
1328 | 0 | return remoteRepositories; |
1329 | |
} |
1330 | |
|
1331 | |
public void setRemoteRepositories( List remoteRepositories ) |
1332 | |
{ |
1333 | 0 | this.remoteRepositories = remoteRepositories; |
1334 | 0 | } |
1335 | |
|
1336 | |
public ArtifactMetadataSource getMetadataSource() |
1337 | |
{ |
1338 | 0 | return metadataSource; |
1339 | |
} |
1340 | |
|
1341 | |
public void setMetadataSource( ArtifactMetadataSource metadataSource ) |
1342 | |
{ |
1343 | 0 | this.metadataSource = metadataSource; |
1344 | 0 | } |
1345 | |
|
1346 | |
public Properties getOriginalSystemProperties() |
1347 | |
{ |
1348 | 0 | return originalSystemProperties; |
1349 | |
} |
1350 | |
|
1351 | |
public void setOriginalSystemProperties( Properties originalSystemProperties ) |
1352 | |
{ |
1353 | 0 | this.originalSystemProperties = originalSystemProperties; |
1354 | 0 | } |
1355 | |
|
1356 | |
public Properties getInternalSystemProperties() |
1357 | |
{ |
1358 | 0 | return internalSystemProperties; |
1359 | |
} |
1360 | |
|
1361 | |
public void setInternalSystemProperties( Properties internalSystemProperties ) |
1362 | |
{ |
1363 | 0 | this.internalSystemProperties = internalSystemProperties; |
1364 | 0 | } |
1365 | |
|
1366 | |
public boolean isDisableXmlReport() |
1367 | |
{ |
1368 | 0 | return disableXmlReport; |
1369 | |
} |
1370 | |
|
1371 | |
public void setDisableXmlReport( boolean disableXmlReport ) |
1372 | |
{ |
1373 | 0 | this.disableXmlReport = disableXmlReport; |
1374 | 0 | } |
1375 | |
|
1376 | |
public boolean isUseSystemClassLoader() |
1377 | |
{ |
1378 | 0 | return useSystemClassLoader; |
1379 | |
} |
1380 | |
|
1381 | |
public void setUseSystemClassLoader( boolean useSystemClassLoader ) |
1382 | |
{ |
1383 | 0 | this.useSystemClassLoader = useSystemClassLoader; |
1384 | 0 | } |
1385 | |
|
1386 | |
public boolean isUseManifestOnlyJar() |
1387 | |
{ |
1388 | 0 | return useManifestOnlyJar; |
1389 | |
} |
1390 | |
|
1391 | |
public void setUseManifestOnlyJar( boolean useManifestOnlyJar ) |
1392 | |
{ |
1393 | 0 | this.useManifestOnlyJar = useManifestOnlyJar; |
1394 | 0 | } |
1395 | |
|
1396 | |
public boolean isEnableAssertions() |
1397 | |
{ |
1398 | 0 | return enableAssertions; |
1399 | |
} |
1400 | |
|
1401 | |
public void setEnableAssertions( boolean enableAssertions ) |
1402 | |
{ |
1403 | 0 | this.enableAssertions = enableAssertions; |
1404 | 0 | } |
1405 | |
|
1406 | |
public MavenSession getSession() |
1407 | |
{ |
1408 | 0 | return session; |
1409 | |
} |
1410 | |
|
1411 | |
public void setSession( MavenSession session ) |
1412 | |
{ |
1413 | 0 | this.session = session; |
1414 | 0 | } |
1415 | |
|
1416 | |
public String getObjectFactory() |
1417 | |
{ |
1418 | 0 | return objectFactory; |
1419 | |
} |
1420 | |
|
1421 | |
public void setObjectFactory( String objectFactory ) |
1422 | |
{ |
1423 | 0 | this.objectFactory = objectFactory; |
1424 | 0 | } |
1425 | |
|
1426 | |
public ToolchainManager getToolchainManager() |
1427 | |
{ |
1428 | 0 | return toolchainManager; |
1429 | |
} |
1430 | |
|
1431 | |
public void setToolchainManager( ToolchainManager toolchainManager ) |
1432 | |
{ |
1433 | 0 | this.toolchainManager = toolchainManager; |
1434 | 0 | } |
1435 | |
|
1436 | |
|
1437 | |
|
1438 | |
public boolean isTestFailureIgnore() |
1439 | |
{ |
1440 | 0 | return true; |
1441 | |
} |
1442 | |
|
1443 | |
public void setTestFailureIgnore( boolean testFailureIgnore ) |
1444 | |
{ |
1445 | |
|
1446 | 0 | } |
1447 | |
|
1448 | |
public boolean isMavenParallel() |
1449 | |
{ |
1450 | 0 | return parallelMavenExecution != null && parallelMavenExecution; |
1451 | |
} |
1452 | |
|
1453 | |
public String getRunOrder() |
1454 | |
{ |
1455 | 0 | return runOrder; |
1456 | |
} |
1457 | |
|
1458 | |
public void setRunOrder( String runOrder ) |
1459 | |
{ |
1460 | 0 | this.runOrder = runOrder; |
1461 | 0 | } |
1462 | |
|
1463 | |
protected void addPluginSpecificChecksumItems( ChecksumCalculator checksum ) |
1464 | |
{ |
1465 | 0 | checksum.add( skipITs ); |
1466 | 0 | checksum.add( summaryFile ); |
1467 | 0 | } |
1468 | |
|
1469 | |
public Boolean getFailIfNoSpecifiedTests() |
1470 | |
{ |
1471 | 0 | return failIfNoSpecifiedTests; |
1472 | |
} |
1473 | |
|
1474 | |
public void setFailIfNoSpecifiedTests( Boolean failIfNoSpecifiedTests ) |
1475 | |
{ |
1476 | 0 | this.failIfNoSpecifiedTests = failIfNoSpecifiedTests; |
1477 | 0 | } |
1478 | |
|
1479 | |
public PluginDescriptor getPluginDescriptor() |
1480 | |
{ |
1481 | 0 | return pluginDescriptor; |
1482 | |
} |
1483 | |
|
1484 | |
} |