1 package org.apache.maven.surefire.booter;
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.List;
24 import java.util.Properties;
25 import org.apache.maven.surefire.report.ReporterConfiguration;
26 import org.apache.maven.surefire.testset.DirectoryScannerParameters;
27 import org.apache.maven.surefire.testset.RunOrderParameters;
28 import org.apache.maven.surefire.testset.TestArtifactInfo;
29 import org.apache.maven.surefire.testset.TestRequest;
30
31
32
33
34
35
36
37
38
39
40 public class ProviderConfiguration
41 {
42
43
44
45 public static final int TESTS_SUCCEEDED_EXIT_CODE = 0;
46
47 private final DirectoryScannerParameters dirScannerParams;
48
49 private final ReporterConfiguration reporterConfiguration;
50
51 private final TestArtifactInfo testArtifact;
52
53 private final TestRequest testSuiteDefinition;
54
55 private final RunOrderParameters runOrderParameters;
56
57 private final Properties providerProperties;
58
59 private final boolean failIfNoTests;
60
61 private final TypeEncodedValue forkTestSet;
62
63 private final boolean readTestsFromInStream;
64
65 @SuppressWarnings( "checkstyle:parameternumber" )
66 public ProviderConfiguration( DirectoryScannerParameters directoryScannerParameters,
67 RunOrderParameters runOrderParameters, boolean failIfNoTests,
68 ReporterConfiguration reporterConfiguration, TestArtifactInfo testArtifact,
69 TestRequest testSuiteDefinition, Properties providerProperties,
70 TypeEncodedValue typeEncodedTestSet, boolean readTestsFromInStream )
71 {
72 this.runOrderParameters = runOrderParameters;
73 this.providerProperties = providerProperties;
74 this.reporterConfiguration = reporterConfiguration;
75 this.testArtifact = testArtifact;
76 this.testSuiteDefinition = testSuiteDefinition;
77 this.dirScannerParams = directoryScannerParameters;
78 this.failIfNoTests = failIfNoTests;
79 this.forkTestSet = typeEncodedTestSet;
80 this.readTestsFromInStream = readTestsFromInStream;
81 }
82
83
84 public ReporterConfiguration getReporterConfiguration()
85 {
86 return reporterConfiguration;
87 }
88
89
90 public Boolean isFailIfNoTests()
91 {
92 return ( failIfNoTests ) ? Boolean.TRUE : Boolean.FALSE;
93 }
94
95 public File getBaseDir()
96 {
97 return dirScannerParams.getTestClassesDirectory();
98 }
99
100
101 public DirectoryScannerParameters getDirScannerParams()
102 {
103 return dirScannerParams;
104 }
105
106 public List getIncludes()
107 {
108 return dirScannerParams.getIncludes();
109 }
110
111 public List getExcludes()
112 {
113 return dirScannerParams.getExcludes();
114 }
115
116 public TestArtifactInfo getTestArtifact()
117 {
118 return testArtifact;
119 }
120
121 public TestRequest getTestSuiteDefinition()
122 {
123 return testSuiteDefinition;
124 }
125
126 public Properties getProviderProperties()
127 {
128 return providerProperties;
129 }
130
131 public TypeEncodedValue getTestForFork()
132 {
133 return forkTestSet;
134 }
135
136 public RunOrderParameters getRunOrderParameters()
137 {
138 return runOrderParameters;
139 }
140
141
142 public boolean isReadTestsFromInStream()
143 {
144 return readTestsFromInStream;
145 }
146 }