Search in sources :

Example 1 with JSONReport

use of com.mulesoft.tools.migration.report.json.JSONReport in project mule-migration-assistant by mulesoft.

the class MigrationJob method generateReport.

private void generateReport(MigrationReport<ReportEntryModel> report, ApplicationModel applicationModel) throws Exception {
    List<ReportEntryModel> reportEntries = report.getReportEntries();
    for (ReportEntryModel entry : reportEntries) {
        try {
            entry.setElementLocation();
        } catch (Exception ex) {
            throw new MigrationJobException("Failed to generate report.", ex);
        }
    }
    HTMLReport htmlReport = new HTMLReport(report, reportPath.toFile(), this.getRunnerVersion());
    htmlReport.printReport();
    if (jsonReportEnabled) {
        applicationModel.getPomModel().ifPresent(p -> report.addConnectors(p));
        JSONReport jsonReport = new JSONReport(report, reportPath.toFile(), outputProject);
        jsonReport.printReport();
    }
}
Also used : ReportEntryModel(com.mulesoft.tools.migration.report.html.model.ReportEntryModel) JSONReport(com.mulesoft.tools.migration.report.json.JSONReport) MigrationJobException(com.mulesoft.tools.migration.engine.exception.MigrationJobException) MigrationJobException(com.mulesoft.tools.migration.engine.exception.MigrationJobException) MigrationTaskException(com.mulesoft.tools.migration.exception.MigrationTaskException) HTMLReport(com.mulesoft.tools.migration.report.html.HTMLReport)

Aggregations

MigrationJobException (com.mulesoft.tools.migration.engine.exception.MigrationJobException)1 MigrationTaskException (com.mulesoft.tools.migration.exception.MigrationTaskException)1 HTMLReport (com.mulesoft.tools.migration.report.html.HTMLReport)1 ReportEntryModel (com.mulesoft.tools.migration.report.html.model.ReportEntryModel)1 JSONReport (com.mulesoft.tools.migration.report.json.JSONReport)1