@@ -59,16 +59,6 @@ public TestRunner addCoverageScheme(String coverageScheme) {
59
59
return this ;
60
60
}
61
61
62
- public TestRunner withSourceFiles (List <String > sourceFiles ) {
63
- if (sourceFiles != null ) this .sourceFiles .addAll (sourceFiles );
64
- return this ;
65
- }
66
-
67
- public TestRunner withTestFiles (List <String > testFiles ) {
68
- if (testFiles != null ) this .testFiles .addAll (testFiles );
69
- return this ;
70
- }
71
-
72
62
public TestRunner includeObject (String obj ) {
73
63
this .includeObjects .add (obj );
74
64
return this ;
@@ -110,29 +100,21 @@ public void run(Connection conn) throws SomeTestsFailedException, SQLException {
110
100
String colorConsoleStr = Boolean .toString (this .colorConsole );
111
101
String failOnErrors = Boolean .toString (this .failOnErrors );
112
102
113
- String sourceFilesParam = "a_source_files" ;
114
- String testFilesParam = "a_test_files" ;
115
-
116
- if (this .sourceMappingOptions != null || this .testMappingOptions != null ) {
117
- sourceFilesParam = "a_source_file_mappings" ;
118
- testFilesParam = "a_test_file_mappings" ;
119
- }
120
-
121
103
OracleConnection oraConn = conn .unwrap (OracleConnection .class );
122
104
CallableStatement callableStatement = null ;
123
105
try {
124
106
callableStatement = conn .prepareCall (
125
107
"BEGIN " +
126
108
"ut_runner.run(" +
127
- "a_paths => ?, " +
128
- "a_reporters => ?, " +
129
- "a_color_console => " + colorConsoleStr + ", " +
130
- "a_coverage_schemes => ?, " +
131
- sourceFilesParam + " => ?, " +
132
- testFilesParam + " => ?, " +
133
- "a_include_objects => ?, " +
134
- "a_exclude_objects => ?, " +
135
- "a_fail_on_errors => " + failOnErrors + "); " +
109
+ "a_paths => ?, " +
110
+ "a_reporters => ?, " +
111
+ "a_color_console => " + colorConsoleStr + ", " +
112
+ "a_coverage_schemes => ?, " +
113
+ "a_source_file_mappings => ?, " +
114
+ "a_test_file_mappings => ?, " +
115
+ "a_include_objects => ?, " +
116
+ "a_exclude_objects => ?, " +
117
+ "a_fail_on_errors => " + failOnErrors + "); " +
136
118
"END;" );
137
119
138
120
int paramIdx = 0 ;
@@ -150,40 +132,22 @@ public void run(Connection conn) throws SomeTestsFailedException, SQLException {
150
132
++paramIdx , oraConn .createOracleArray (CustomTypes .UT_VARCHAR2_LIST , this .coverageSchemes .toArray ()));
151
133
}
152
134
153
- if (this .sourceMappingOptions != null || this .testMappingOptions != null ) {
154
- if (this .sourceMappingOptions != null ) {
155
- List <FileMapping > sourceMappings = FileMapper .buildFileMappingList (
156
- conn , this .sourceFiles , this .sourceMappingOptions );
157
-
158
- callableStatement .setArray (
159
- ++paramIdx , oraConn .createOracleArray (CustomTypes .UT_FILE_MAPPINGS , sourceMappings .toArray ()));
160
- } else {
161
- callableStatement .setNull (++paramIdx , Types .ARRAY , CustomTypes .UT_FILE_MAPPINGS );
162
- }
163
-
164
- if (this .testMappingOptions != null ) {
165
- List <FileMapping > sourceMappings = FileMapper .buildFileMappingList (
166
- conn , this .testFiles , this .testMappingOptions );
167
-
168
- callableStatement .setArray (
169
- ++paramIdx , oraConn .createOracleArray (CustomTypes .UT_FILE_MAPPINGS , sourceMappings .toArray ()));
170
- } else {
171
- callableStatement .setNull (++paramIdx , Types .ARRAY , CustomTypes .UT_FILE_MAPPINGS );
172
- }
135
+ if (this .sourceMappingOptions == null ) {
136
+ callableStatement .setNull (++paramIdx , Types .ARRAY , CustomTypes .UT_FILE_MAPPINGS );
137
+ } else {
138
+ List <FileMapping > sourceMappings = FileMapper .buildFileMappingList (conn , this .sourceMappingOptions );
139
+
140
+ callableStatement .setArray (
141
+ ++paramIdx , oraConn .createOracleArray (CustomTypes .UT_FILE_MAPPINGS , sourceMappings .toArray ()));
142
+ }
143
+
144
+ if (this .testMappingOptions == null ) {
145
+ callableStatement .setNull (++paramIdx , Types .ARRAY , CustomTypes .UT_FILE_MAPPINGS );
173
146
} else {
174
- if (this .sourceFiles .isEmpty ()) {
175
- callableStatement .setNull (++paramIdx , Types .ARRAY , CustomTypes .UT_VARCHAR2_LIST );
176
- } else {
177
- callableStatement .setArray (
178
- ++paramIdx , oraConn .createOracleArray (CustomTypes .UT_VARCHAR2_LIST , this .sourceFiles .toArray ()));
179
- }
180
-
181
- if (this .testFiles .isEmpty ()) {
182
- callableStatement .setNull (++paramIdx , Types .ARRAY , CustomTypes .UT_VARCHAR2_LIST );
183
- } else {
184
- callableStatement .setArray (
185
- ++paramIdx , oraConn .createOracleArray (CustomTypes .UT_VARCHAR2_LIST , this .testFiles .toArray ()));
186
- }
147
+ List <FileMapping > sourceMappings = FileMapper .buildFileMappingList (conn , this .testMappingOptions );
148
+
149
+ callableStatement .setArray (
150
+ ++paramIdx , oraConn .createOracleArray (CustomTypes .UT_FILE_MAPPINGS , sourceMappings .toArray ()));
187
151
}
188
152
189
153
if (this .includeObjects .isEmpty ()) {
0 commit comments