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 public static final int TESTS_FAILED_EXIT_CODE = 255;
48
49 public static final int NO_TESTS_EXIT_CODE = 254;
50
51 private final DirectoryScannerParameters dirScannerParams;
52
53 private final ReporterConfiguration reporterConfiguration;
54
55 private final TestArtifactInfo testArtifact;
56
57 private final TestRequest testSuiteDefinition;
58
59 private final RunOrderParameters runOrderParameters;
60
61 private final Properties providerProperties;
62
63 private final boolean failIfNoTests;
64
65 private final TypeEncodedValue forkTestSet;
66
67 private final boolean readTestsFromInStream;
68
69 public ProviderConfiguration( DirectoryScannerParameters directoryScannerParameters,
70 RunOrderParameters runOrderParameters, boolean failIfNoTests,
71 ReporterConfiguration reporterConfiguration, TestArtifactInfo testArtifact,
72 TestRequest testSuiteDefinition, Properties providerProperties,
73 TypeEncodedValue typeEncodedTestSet, boolean readTestsFromInStream )
74 {
75 this.runOrderParameters = runOrderParameters;
76 this.providerProperties = providerProperties;
77 this.reporterConfiguration = reporterConfiguration;
78 this.testArtifact = testArtifact;
79 this.testSuiteDefinition = testSuiteDefinition;
80 this.dirScannerParams = directoryScannerParameters;
81 this.failIfNoTests = failIfNoTests;
82 this.forkTestSet = typeEncodedTestSet;
83 this.readTestsFromInStream = readTestsFromInStream;
84 }
85
86
87 public ReporterConfiguration getReporterConfiguration()
88 {
89 return reporterConfiguration;
90 }
91
92
93 public Boolean isFailIfNoTests()
94 {
95 return ( failIfNoTests ) ? Boolean.TRUE : Boolean.FALSE;
96 }
97
98 public File getBaseDir()
99 {
100 return dirScannerParams.getTestClassesDirectory();
101 }
102
103
104 public DirectoryScannerParameters getDirScannerParams()
105 {
106 return dirScannerParams;
107 }
108
109 public List getIncludes()
110 {
111 return dirScannerParams.getIncludes();
112 }
113
114 public List getExcludes()
115 {
116 return dirScannerParams.getExcludes();
117 }
118
119 public TestArtifactInfo getTestArtifact()
120 {
121 return testArtifact;
122 }
123
124 public TestRequest getTestSuiteDefinition()
125 {
126 return testSuiteDefinition;
127 }
128
129 public Properties getProviderProperties()
130 {
131 return providerProperties;
132 }
133
134 public TypeEncodedValue getTestForFork()
135 {
136 return forkTestSet;
137 }
138
139 public RunOrderParameters getRunOrderParameters()
140 {
141 return runOrderParameters;
142 }
143
144
145 public boolean isReadTestsFromInStream()
146 {
147 return readTestsFromInStream;
148 }
149 }