@@ -15,6 +15,7 @@ public class TestRunner {
15
15
16
16
private List <String > pathList = new ArrayList <>();
17
17
private List <Reporter > reporterList = new ArrayList <>();
18
+ private boolean colorConsole = false ;
18
19
private List <String > coverageSchemes = new ArrayList <>();
19
20
private List <String > sourceFiles = new ArrayList <>();
20
21
private List <String > testFiles = new ArrayList <>();
@@ -36,6 +37,11 @@ public TestRunner addReporter(Reporter reporter) {
36
37
return this ;
37
38
}
38
39
40
+ public TestRunner colorConsole (boolean colorConsole ) {
41
+ this .colorConsole = colorConsole ;
42
+ return this ;
43
+ }
44
+
39
45
public TestRunner addReporterList (List <Reporter > reporterList ) {
40
46
this .reporterList .addAll (reporterList );
41
47
return this ;
@@ -87,13 +93,16 @@ public void run(Connection conn) throws SQLException {
87
93
Array includeObjectsArray = oraConn .createARRAY (CustomTypes .UT_VARCHAR2_LIST , this .includeObjects .toArray ());
88
94
Array excludeObjectsArray = oraConn .createARRAY (CustomTypes .UT_VARCHAR2_LIST , this .excludeObjects .toArray ());
89
95
96
+ // Workaround because Oracle JDBC doesn't support passing boolean to stored procedures.
97
+ String colorConsoleStr = Boolean .toString (this .colorConsole );
98
+
90
99
CallableStatement callableStatement = null ;
91
100
try {
92
101
callableStatement = conn .prepareCall (
93
102
"BEGIN " +
94
103
"ut_runner.run(" +
95
- "a_paths => ?, a_reporters => ?, a_coverage_schemes => ?, " +
96
- "a_source_files => ?, a_test_files => ?, " +
104
+ "a_paths => ?, a_reporters => ?, a_color_console => " + colorConsoleStr + ", " +
105
+ "a_coverage_schemes => ?, a_source_files => ?, a_test_files => ?, " +
97
106
"a_include_objects => ?, a_exclude_objects => ?); " +
98
107
"END;" );
99
108
callableStatement .setArray (1 , pathArray );
0 commit comments