@Test public void testGenerateEarlReport() throws Exception { CtlEarlReporter ctlEarlReporter = new CtlEarlReporter(); ByteArrayOutputStream earlReport = new ByteArrayOutputStream(); InputStream reportStream = CtlEarlReporterTest.class.getResourceAsStream( "unittest/session/report_logs.xml" ); String testSuiteName = "OGC_Web Map Service (WMS)_1.3.0_1.23-SNAPSHOT"; Map<String, String> parames = new HashMap<>(); parames.put( "queryable", "queryable" ); parames.put( "low-updatesequence", "" ); parames.put( "capabilities-url", "http: parames.put( "high-updatesequence", "" ); parames.put( "updatesequence", "auto" ); parames.put( "basic", "basic" ); ctlEarlReporter.generateEarlReport( earlReport, reportStream, testSuiteName, parames ); assertThat( the( earlReport.toString() ), hasXPath( "/rdf:RDF", nsContext() ) ); assertThat( the( earlReport.toString() ), hasXPath( "count( assertThat( the( earlReport.toString() ), hasXPath( " assertThat( the( earlReport.toString() ), hasXPath( " }
public void generateEarlReport( File outputDirectory, File reportFile, String suiteName, Map params ) throws UnsupportedEncodingException { DocumentBuilderFactory docFactory = createDcumentBuilder(); Document document; try { document = docFactory.newDocumentBuilder().parse( reportFile ); } catch ( IOException | SAXException | ParserConfigurationException e ) { throw new RuntimeException( e ); } document.getDocumentElement().normalize(); Model earlReport = generateEarlReport( suiteName, params, document ); try { writeModel( earlReport, outputDirectory, true ); } catch ( IOException iox ) { throw new RuntimeException( "Failed to serialize EARL results", iox ); } }
CtlEarlReporter { public void generateEarlReport( File outputDirectory, File reportFile, String suiteName, Map params ) throws UnsupportedEncodingException { DocumentBuilderFactory docFactory = createDcumentBuilder(); Document document; try { document = docFactory.newDocumentBuilder().parse( reportFile ); } catch ( IOException | SAXException | ParserConfigurationException e ) { throw new RuntimeException( e ); } document.getDocumentElement().normalize(); Model earlReport = generateEarlReport( suiteName, params, document ); try { writeModel( earlReport, outputDirectory, true ); } catch ( IOException iox ) { throw new RuntimeException( "Failed to serialize EARL results", iox ); } } }
CtlEarlReporter { public void generateEarlReport( File outputDirectory, File reportFile, String suiteName, Map params ) throws UnsupportedEncodingException { DocumentBuilderFactory docFactory = createDcumentBuilder(); Document document; try { document = docFactory.newDocumentBuilder().parse( reportFile ); } catch ( IOException | SAXException | ParserConfigurationException e ) { throw new RuntimeException( e ); } document.getDocumentElement().normalize(); Model earlReport = generateEarlReport( suiteName, params, document ); try { writeModel( earlReport, outputDirectory, true ); } catch ( IOException iox ) { throw new RuntimeException( "Failed to serialize EARL results", iox ); } } CtlEarlReporter(); }
CtlEarlReporter { public void generateEarlReport( File outputDirectory, File reportFile, String suiteName, Map params ) throws UnsupportedEncodingException { DocumentBuilderFactory docFactory = createDcumentBuilder(); Document document; try { document = docFactory.newDocumentBuilder().parse( reportFile ); } catch ( IOException | SAXException | ParserConfigurationException e ) { throw new RuntimeException( e ); } document.getDocumentElement().normalize(); Model earlReport = generateEarlReport( suiteName, params, document ); try { writeModel( earlReport, outputDirectory, true ); } catch ( IOException iox ) { throw new RuntimeException( "Failed to serialize EARL results", iox ); } } CtlEarlReporter(); void generateEarlReport( File outputDirectory, File reportFile, String suiteName, Map params ); void generateEarlReport( OutputStream targetEarlReport, InputStream report, String suiteName, Map params ); }
CtlEarlReporter { public void generateEarlReport( File outputDirectory, File reportFile, String suiteName, Map params ) throws UnsupportedEncodingException { DocumentBuilderFactory docFactory = createDcumentBuilder(); Document document; try { document = docFactory.newDocumentBuilder().parse( reportFile ); } catch ( IOException | SAXException | ParserConfigurationException e ) { throw new RuntimeException( e ); } document.getDocumentElement().normalize(); Model earlReport = generateEarlReport( suiteName, params, document ); try { writeModel( earlReport, outputDirectory, true ); } catch ( IOException iox ) { throw new RuntimeException( "Failed to serialize EARL results", iox ); } } CtlEarlReporter(); void generateEarlReport( File outputDirectory, File reportFile, String suiteName, Map params ); void generateEarlReport( OutputStream targetEarlReport, InputStream report, String suiteName, Map params );  }