@@ -59,16 +59,6 @@ public TestRunner addCoverageScheme(String coverageScheme) {
5959 return this ;
6060 }
6161
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-
7262 public TestRunner includeObject (String obj ) {
7363 this .includeObjects .add (obj );
7464 return this ;
@@ -110,29 +100,21 @@ public void run(Connection conn) throws SomeTestsFailedException, SQLException {
110100 String colorConsoleStr = Boolean .toString (this .colorConsole );
111101 String failOnErrors = Boolean .toString (this .failOnErrors );
112102
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-
121103 OracleConnection oraConn = conn .unwrap (OracleConnection .class );
122104 CallableStatement callableStatement = null ;
123105 try {
124106 callableStatement = conn .prepareCall (
125107 "BEGIN " +
126108 "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 + "); " +
136118 "END;" );
137119
138120 int paramIdx = 0 ;
@@ -150,40 +132,22 @@ public void run(Connection conn) throws SomeTestsFailedException, SQLException {
150132 ++paramIdx , oraConn .createOracleArray (CustomTypes .UT_VARCHAR2_LIST , this .coverageSchemes .toArray ()));
151133 }
152134
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 );
173146 } 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 ()));
187151 }
188152
189153 if (this .includeObjects .isEmpty ()) {
0 commit comments