private void validateMigrationIssuesReport(GraphContext context) { TestMigrationIssuesReportUtil util = new TestMigrationIssuesReportUtil(); ApplicationReportService reportService = new ApplicationReportService(context); Iterable<ApplicationReportModel> reportModels = reportService.findAllByProperty( ReportModel.TEMPLATE_PATH, "/reports/templates/migration-issues.ftl"); ApplicationReportModel reportModel = null; for (ApplicationReportModel possibleModel : reportModels) { if (possibleModel.getProjectModel() != null) { reportModel = possibleModel; break; } } if (reportModel == null) throw new RuntimeException("Failed to find migration issues report!"); Path reportPath = Paths.get(new ReportService(context).getReportDirectory(), reportModel.getReportFilename()); util.loadPage(reportPath); Assert.assertTrue( util.checkIssue("Classification ActivationConfigProperty", 2, 8, "Unknown", 16)); Assert.assertTrue(util.checkIssue("Title for Hint from XML", 1, 0, "Info", 0)); Assert.assertTrue(util.checkIssue("Web Servlet", 1, 0, "Info", 0)); }
private void createReportIndex(GraphContext context, ProjectModel projectModel) { ApplicationReportService service = new ApplicationReportService(context); ApplicationReportModel applicationReportModel = service.create(); applicationReportModel.setReportPriority(100); applicationReportModel.setDisplayInApplicationReportIndex(true); applicationReportModel.setReportName(REPORT_INDEX); applicationReportModel.setReportIconClass("glyphicon glyphicon-th-list"); applicationReportModel.setMainApplicationReport(true); applicationReportModel.setTemplatePath(TEMPLATE); applicationReportModel.setTemplateType(TemplateType.FREEMARKER); applicationReportModel.setProjectModel(projectModel); applicationReportModel.setDescription( "This report provides summary information about findings from the migration analysis, as well as links to additional reports with detailed information."); // Set the filename for the report ReportService reportService = new ReportService(context); reportService.setUniqueFilename( applicationReportModel, "report_index_" + projectModel.getName(), "html"); }