@@ -15,6 +15,7 @@ public class TestRunner {
1515
1616 private List <String > pathList = new ArrayList <>();
1717 private List <Reporter > reporterList = new ArrayList <>();
18+ private boolean colorConsole = false ;
1819 private List <String > coverageSchemes = new ArrayList <>();
1920 private List <String > sourceFiles = new ArrayList <>();
2021 private List <String > testFiles = new ArrayList <>();
@@ -36,6 +37,11 @@ public TestRunner addReporter(Reporter reporter) {
3637 return this ;
3738 }
3839
40+ public TestRunner colorConsole (boolean colorConsole ) {
41+ this .colorConsole = colorConsole ;
42+ return this ;
43+ }
44+
3945 public TestRunner addReporterList (List <Reporter > reporterList ) {
4046 this .reporterList .addAll (reporterList );
4147 return this ;
@@ -87,13 +93,16 @@ public void run(Connection conn) throws SQLException {
8793 Array includeObjectsArray = oraConn .createARRAY (CustomTypes .UT_VARCHAR2_LIST , this .includeObjects .toArray ());
8894 Array excludeObjectsArray = oraConn .createARRAY (CustomTypes .UT_VARCHAR2_LIST , this .excludeObjects .toArray ());
8995
96+ // Workaround because Oracle JDBC doesn't support passing boolean to stored procedures.
97+ String colorConsoleStr = Boolean .toString (this .colorConsole );
98+
9099 CallableStatement callableStatement = null ;
91100 try {
92101 callableStatement = conn .prepareCall (
93102 "BEGIN " +
94103 "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 => ?, " +
97106 "a_include_objects => ?, a_exclude_objects => ?); " +
98107 "END;" );
99108 callableStatement .setArray (1 , pathArray );
0 commit comments