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.TestArtifactInfo;
28 import org.apache.maven.surefire.testset.TestRequest;
29
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 Properties providerProperties;
60
61 private final boolean failIfNoTests;
62
63 private final TypeEncodedValue forkTestSet;
64
65 public ProviderConfiguration( DirectoryScannerParameters directoryScannerParameters, boolean failIfNoTests,
66 ReporterConfiguration reporterConfiguration, TestArtifactInfo testArtifact,
67 TestRequest testSuiteDefinition, Properties providerProperties,
68 TypeEncodedValue typeEncodedTestSet )
69 {
70 this.providerProperties = providerProperties;
71 this.reporterConfiguration = reporterConfiguration;
72 this.testArtifact = testArtifact;
73 this.testSuiteDefinition = testSuiteDefinition;
74 this.dirScannerParams = directoryScannerParameters;
75 this.failIfNoTests = failIfNoTests;
76 this.forkTestSet = typeEncodedTestSet;
77 }
78
79
80 public ReporterConfiguration getReporterConfiguration()
81 {
82 return reporterConfiguration;
83 }
84
85
86 public Boolean isFailIfNoTests()
87 {
88 return ( failIfNoTests ) ? Boolean.TRUE : Boolean.FALSE;
89 }
90
91 public File getBaseDir()
92 {
93 return dirScannerParams.getTestClassesDirectory();
94 }
95
96
97 public DirectoryScannerParameters getDirScannerParams()
98 {
99 return dirScannerParams;
100 }
101
102 public List getIncludes()
103 {
104 return dirScannerParams.getIncludes();
105 }
106
107 public List getExcludes()
108 {
109 return dirScannerParams.getExcludes();
110 }
111
112 public TestArtifactInfo getTestArtifact()
113 {
114 return testArtifact;
115 }
116
117 public TestRequest getTestSuiteDefinition()
118 {
119 return testSuiteDefinition;
120 }
121
122 public Properties getProviderProperties()
123 {
124 return providerProperties;
125 }
126
127 public TypeEncodedValue getTestForFork()
128 {
129 return forkTestSet;
130 }
131
132
133 }