ReportingService { public JasperPrint generateReport(boolean removeFrame) { context.setRemoveFrame(removeFrame); Map<String, Object> contextMap = new HashMap<>(); contextMap.put(ReportingContext.CONTEXT_NAME, context); contextMap.put("sessionId", sessionId); try { log.info("BEGIN: Compile report"); JasperReport jasperReport = JasperCompileManager.compileReport(new ReportInputStream(context.getResource(rootTemplateLocation), removeFrame)); log.info("END: Compile report"); log.info("BEGIN: Fill report"); JasperPrint result = JasperFillManager.fillReport(jasperReport, contextMap, new JRBeanArrayDataSource(new Object[1])); log.info("END: Fill report"); return result; } catch (JRException e) { log.error("Error during report rendering", e); throw new TechnicalException(e); } }  JasperPrint generateReport(boolean removeFrame); void renderReport(boolean removeFrame); void setContext(ReportingContext context); void setRootTemplateLocation(String rootTemplateLocation); void setReportType(ReportType reportType); void setOutputReportLocation(String outputReportLocation); boolean isDoGenerateXmlReport(); void setDoGenerateXmlReport(boolean doGenerateXmlReport); ReportingContext getContext(); String getRootTemplateLocation(); ReportType getReportType(); String getOutputReportLocation(); String getSessionId(); void setSessionId(String sessionId);  }
@Test(enabled = true) public void testReportingServiceXMLValidate() throws SAXException, IOException { Multimap<String, Verdict> details = ArrayListMultimap.create(); SessionVerdict sessionVerdict=new SessionVerdict(Decision.OK, details); ReportingContext reportingContext=new ReportingContext(); reportingContext.getParameters().put(OverallSessionComparisonReporter.JAGGER_VERDICT,sessionVerdict); reportingContext.getParameters().put(OverallSessionComparisonReporter.JAGGER_SESSION_BASELINE,"11"); reportingContext.getParameters().put(OverallSessionComparisonReporter.JAGGER_SESSION_CURRENT,"11"); XMLReporter maker= XMLReporter.create(reportingContext, "1"); maker.generateReport(); checkXML(); }
@Test(enabled = true) public void testReportingServiceXMLEmptyContext() throws IOException, SAXException { ReportingContext reportingContext=new ReportingContext(); XMLReporter maker= XMLReporter.create(reportingContext, "1"); maker.generateReport(); assertTrue(new File("result.xml").exists()); checkXML(); }