1 package org.apache.maven.surefire.testset;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23 import java.util.ArrayList;
24 import java.util.List;
25
26
27
28
29
30
31 public class TestRequest
32 {
33 private final List<File> suiteXmlFiles;
34
35 private final File testSourceDirectory;
36
37 private final TestListResolver requestedTests;
38
39 private final int rerunFailingTestsCount;
40
41 public TestRequest( List suiteXmlFiles, File testSourceDirectory, TestListResolver requestedTests )
42 {
43 this( createFiles( suiteXmlFiles ), testSourceDirectory, requestedTests, 0 );
44 }
45
46 public TestRequest( List suiteXmlFiles, File testSourceDirectory, TestListResolver requestedTests,
47 int rerunFailingTestsCount )
48 {
49 this.suiteXmlFiles = createFiles( suiteXmlFiles );
50 this.testSourceDirectory = testSourceDirectory;
51 this.requestedTests = requestedTests;
52 this.rerunFailingTestsCount = rerunFailingTestsCount;
53 }
54
55
56
57
58
59
60 public List<File> getSuiteXmlFiles()
61 {
62 return suiteXmlFiles;
63 }
64
65
66
67
68
69
70 public File getTestSourceDirectory()
71 {
72 return testSourceDirectory;
73 }
74
75
76
77
78 public TestListResolver getTestListResolver()
79 {
80 return requestedTests;
81 }
82
83
84
85
86
87
88 public int getRerunFailingTestsCount()
89 {
90 return rerunFailingTestsCount;
91 }
92
93 private static List<File> createFiles( List suiteXmlFiles )
94 {
95 if ( suiteXmlFiles != null )
96 {
97 List<File> files = new ArrayList<File>();
98 Object element;
99 for ( Object suiteXmlFile : suiteXmlFiles )
100 {
101 element = suiteXmlFile;
102 files.add( element instanceof String ? new File( (String) element ) : (File) element );
103 }
104 return files;
105 }
106 return null;
107 }
108
109 }