当前位置: 首页>>代码示例>>Java>>正文


Java XmlReportWriter类代码示例

本文整理汇总了Java中com.buschmais.jqassistant.core.report.impl.XmlReportWriter的典型用法代码示例。如果您正苦于以下问题:Java XmlReportWriter类的具体用法?Java XmlReportWriter怎么用?Java XmlReportWriter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


XmlReportWriter类属于com.buschmais.jqassistant.core.report.impl包,在下文中一共展示了XmlReportWriter类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createXmlReport

import com.buschmais.jqassistant.core.report.impl.XmlReportWriter; //导入依赖的package包/类
/**
 * Creates a test report.
 *
 * @return The test report.
 * @throws ReportException
 *             If the test fails.
 */
public static String createXmlReport() throws ReportException {
    StringWriter writer = new StringWriter();
    XmlReportWriter xmlReportWriter = new XmlReportWriter(writer);
    xmlReportWriter.begin();
    Concept concept = Concept.Builder.newConcept().id("my:concept").description("My concept description").severity(Severity.MAJOR)
            .executable(new CypherExecutable("match...")).verification(ROW_COUNT_VERIFICATION)
            .report(Report.Builder.newInstance().primaryColumn("c2").get()).get();
    Map<String, Severity> concepts = new HashMap<>();
    concepts.put("my:concept", Severity.INFO);
    Group group = Group.Builder.newGroup().id("default").description("My group").conceptIds(concepts).get();
    xmlReportWriter.beginGroup(group);
    xmlReportWriter.beginConcept(concept);
    List<Map<String, Object>> rows = new ArrayList<>();
    rows.add(createRow());
    Result<Concept> result = new Result<>(concept, Result.Status.SUCCESS, Severity.CRITICAL, Arrays.asList(C1, C2), rows);
    xmlReportWriter.setResult(result);
    xmlReportWriter.endConcept();
    xmlReportWriter.endGroup();
    xmlReportWriter.end();
    return writer.toString();
}
 
开发者ID:buschmais,项目名称:jqa-core-framework,代码行数:29,代码来源:XmlReportTestHelper.java

示例2: createXmlWithUmlauts

import com.buschmais.jqassistant.core.report.impl.XmlReportWriter; //导入依赖的package包/类
public static String createXmlWithUmlauts(String description) throws ReportException {
    StringWriter writer = new StringWriter();
    XmlReportWriter xmlReportWriter = new XmlReportWriter(writer);
    xmlReportWriter.begin();
    Concept concept = Concept.Builder.newConcept().id("mein:Konzept").description(description).severity(Severity.MAJOR)
            .executable(new CypherExecutable("match...")).verification(ROW_COUNT_VERIFICATION)
            .report(Report.Builder.newInstance().primaryColumn("c2").get()).get();
    Map<String, Severity> concepts = new HashMap<>();
    concepts.put("mein:Konzept", Severity.INFO);
    Group group = Group.Builder.newGroup().id("default").description("Meine Gruppe").conceptIds(concepts).get();
    xmlReportWriter.beginGroup(group);
    xmlReportWriter.beginConcept(concept);
    List<Map<String, Object>> rows = new ArrayList<>();
    rows.add(createRow());
    Result<Concept> result = new Result<>(concept, Result.Status.SUCCESS, Severity.CRITICAL, Arrays.asList(C1, C2), rows);
    xmlReportWriter.setResult(result);
    xmlReportWriter.endConcept();
    xmlReportWriter.endGroup();
    xmlReportWriter.end();
    return writer.toString();
}
 
开发者ID:buschmais,项目名称:jqa-core-framework,代码行数:22,代码来源:XmlReportTestHelper.java

示例3: createXmlReportWithConstraints

import com.buschmais.jqassistant.core.report.impl.XmlReportWriter; //导入依赖的package包/类
/**
 * Creates a test report with {@link Constraint}.
 *
 * @return The test report.
 * @throws ReportException
 *             If the test fails.
 */
public static String createXmlReportWithConstraints() throws ReportException {
    StringWriter writer = new StringWriter();
    XmlReportWriter xmlReportWriter = new XmlReportWriter(writer);
    xmlReportWriter.begin();

    Constraint constraint = Constraint.Builder.newConstraint().id("my:Constraint").description("My constraint description").severity(Severity.BLOCKER)
            .executable(new CypherExecutable("match...")).verification(ROW_COUNT_VERIFICATION).report(Report.Builder.newInstance().get()).get();
    Map<String, Severity> constraints = new HashMap<>();
    constraints.put("my:Constraint", Severity.INFO);
    Group group = Group.Builder.newGroup().id("default").description("My group").constraintIds(constraints).get();
    xmlReportWriter.beginGroup(group);
    xmlReportWriter.beginConstraint(constraint);
    List<Map<String, Object>> rows = new ArrayList<>();
    rows.add(createRow());
    Result<Constraint> result = new Result<>(constraint, Result.Status.FAILURE, Severity.CRITICAL, Arrays.asList(C1, C2), rows);
    xmlReportWriter.setResult(result);
    xmlReportWriter.endConstraint();
    xmlReportWriter.endGroup();
    xmlReportWriter.end();
    return writer.toString();
}
 
开发者ID:buschmais,项目名称:jqa-core-framework,代码行数:29,代码来源:XmlReportTestHelper.java


注:本文中的com.buschmais.jqassistant.core.report.impl.XmlReportWriter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。