@Test(expected = IllegalStateException.class) public void invalidXmlFile() throws Exception { CoberturaReportParser.parseReport( TestUtils.getResource("org/sonar/plugins/lua/cobertura/coverage-invalid.xml"), SensorContextTester.create(new File(".")) ); }
public static void parseReport(File xmlFile, final SensorContext context) { try { StaxParser parser = new StaxParser(rootCursor -> { rootCursor.advance(); collectPackageMeasures(rootCursor.descendantElementCursor("package"), context); }); parser.parse(xmlFile); } catch (XMLStreamException e) { throw new IllegalStateException(e); } }
CoberturaReportParser { public static void parseReport(File xmlFile, final SensorContext context) { try { StaxParser parser = new StaxParser(rootCursor -> { rootCursor.advance(); collectPackageMeasures(rootCursor.descendantElementCursor("package"), context); }); parser.parse(xmlFile); } catch (XMLStreamException e) { throw new IllegalStateException(e); } } }
CoberturaReportParser { public static void parseReport(File xmlFile, final SensorContext context) { try { StaxParser parser = new StaxParser(rootCursor -> { rootCursor.advance(); collectPackageMeasures(rootCursor.descendantElementCursor("package"), context); }); parser.parse(xmlFile); } catch (XMLStreamException e) { throw new IllegalStateException(e); } } private  CoberturaReportParser(); }
CoberturaReportParser { public static void parseReport(File xmlFile, final SensorContext context) { try { StaxParser parser = new StaxParser(rootCursor -> { rootCursor.advance(); collectPackageMeasures(rootCursor.descendantElementCursor("package"), context); }); parser.parse(xmlFile); } catch (XMLStreamException e) { throw new IllegalStateException(e); } } private  CoberturaReportParser(); static void parseReport(File xmlFile, final SensorContext context); }
CoberturaReportParser { public static void parseReport(File xmlFile, final SensorContext context) { try { StaxParser parser = new StaxParser(rootCursor -> { rootCursor.advance(); collectPackageMeasures(rootCursor.descendantElementCursor("package"), context); }); parser.parse(xmlFile); } catch (XMLStreamException e) { throw new IllegalStateException(e); } } private  CoberturaReportParser(); static void parseReport(File xmlFile, final SensorContext context);  }