TestNgReportBuilder.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:bootstraped-multi-test-results-report 作者:
public TestNgReportBuilder(List<String> xmlReports, String targetBuildPath)
    throws JAXBException, XMLStreamException, FactoryConfigurationError, IOException {
    testOverviewPath = targetBuildPath + "/";
    classesSummaryPath = targetBuildPath + "/classes-summary/";
    processedTestNgReports = new ArrayList<>();

    JAXBContext cntx = JAXBContext.newInstance(TestngResultsModel.class);

    Unmarshaller unm = cntx.createUnmarshaller();

    for (String xml : xmlReports) {
        InputStream inputStream = new FileInputStream(xml);
        XMLStreamReader xmlStream = XMLInputFactory.newInstance().createXMLStreamReader(inputStream);
        TestngResultsModel ts = (TestngResultsModel) unm.unmarshal(xmlStream);
        ts.postProcess();
        processedTestNgReports.add(ts);
        inputStream.close();
        xmlStream.close();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号