|
9 | 9 | import org.utplsql.api.compatibility.CompatibilityProxy; |
10 | 10 | import org.utplsql.api.exception.SomeTestsFailedException; |
11 | 11 | import org.utplsql.api.reporter.CoreReporters; |
12 | | -import org.utplsql.api.reporter.CoverageHTMLReporter; |
13 | 12 | import org.utplsql.api.reporter.Reporter; |
14 | 13 | import org.utplsql.api.reporter.ReporterFactory; |
15 | 14 | import org.utplsql.cli.exception.DatabaseConnectionFailed; |
| 15 | +import org.utplsql.cli.reporters.ReporterOptionsAware; |
16 | 16 |
|
17 | 17 | import java.io.File; |
18 | 18 | import java.io.FileNotFoundException; |
19 | 19 | import java.io.FileOutputStream; |
20 | 20 | import java.io.PrintStream; |
21 | | -import java.nio.file.Paths; |
22 | 21 | import java.sql.Connection; |
23 | 22 | import java.sql.SQLException; |
24 | 23 | import java.util.ArrayList; |
@@ -159,7 +158,7 @@ public int run() throws Exception { |
159 | 158 |
|
160 | 159 | // First of all do a compatibility check and fail-fast |
161 | 160 | compatibilityProxy = checkFrameworkCompatibility(conn); |
162 | | - reporterFactory = ReporterFactory.createDefault(compatibilityProxy); |
| 161 | + reporterFactory = ReporterFactoryProvider.createReporterFactory(compatibilityProxy); |
163 | 162 |
|
164 | 163 | reporterList = initReporters(conn, reporterOptionsList); |
165 | 164 |
|
@@ -226,14 +225,11 @@ private List<Reporter> initReporters( Connection conn, List<ReporterOptions> rep |
226 | 225 | for (ReporterOptions ro : reporterOptionsList) { |
227 | 226 | Reporter reporter = reporterFactory.createReporter(ro.getReporterName()); |
228 | 227 |
|
| 228 | + if ( reporter instanceof ReporterOptionsAware ) |
| 229 | + ((ReporterOptionsAware) reporter).setReporterOptions(ro); |
229 | 230 |
|
230 | 231 | reporter.init(conn, compatibilityProxy, reporterFactory); |
231 | 232 |
|
232 | | - // Quick-hack for CoverageHTML Reporter |
233 | | - if ( reporter instanceof CoverageHTMLReporter && ro.outputToFile() ) { |
234 | | - ((CoverageHTMLReporter)reporter).setAssetsPath(ro.getOutputFileName()+"_assets/"); |
235 | | - CoverageHTMLReporter.writeReportAssetsTo(Paths.get(ro.getOutputFileName()+"_assets/")); |
236 | | - } |
237 | 233 | ro.setReporterObj(reporter); |
238 | 234 | reporterList.add(reporter); |
239 | 235 | } |
|
0 commit comments