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 String requestedTest;
38
39
40
41
42 private final String requestedTestMethod;
43
44 public TestRequest( List suiteXmlFiles, File testSourceDirectory, String requestedTest )
45 {
46 this( suiteXmlFiles, testSourceDirectory, requestedTest, null );
47 }
48
49
50
51
52 public TestRequest( List suiteXmlFiles, File testSourceDirectory, String requestedTest, String requestedTestMethod )
53 {
54 this.suiteXmlFiles = createFiles( suiteXmlFiles );
55 this.testSourceDirectory = testSourceDirectory;
56 this.requestedTest = requestedTest;
57 this.requestedTestMethod = requestedTestMethod;
58 }
59
60
61
62
63
64
65 public List<File> getSuiteXmlFiles()
66 {
67 return suiteXmlFiles;
68 }
69
70
71
72
73
74
75 public File getTestSourceDirectory()
76 {
77 return testSourceDirectory;
78 }
79
80
81
82
83
84
85 public String getRequestedTest()
86 {
87 return requestedTest;
88 }
89
90
91
92
93
94
95
96 public String getRequestedTestMethod()
97 {
98 return requestedTestMethod;
99 }
100
101 private static List<File> createFiles( List suiteXmlFiles )
102 {
103 if ( suiteXmlFiles != null )
104 {
105 List<File> files = new ArrayList<File>();
106 Object element;
107 for ( Object suiteXmlFile : suiteXmlFiles )
108 {
109 element = suiteXmlFile;
110 files.add( element instanceof String ? new File( (String) element ) : (File) element );
111 }
112 return files;
113 }
114 return null;
115 }
116
117 }