Package org.jacoco.core.analysis

Examples of org.jacoco.core.analysis.MethodCoverage


      return new XMLReportNodeHandler(element.element("package"), node);
    case CLASS:
      return new XMLReportNodeHandler(element.element("class"), node);
    case METHOD:
      final XMLElement methodChild = element.element("method");
      final MethodCoverage methodNode = (MethodCoverage) node;
      methodChild.attr("desc", methodNode.getDesc());
      final int line = methodNode.getLines().getFirstLine();
      if (line != -1) {
        methodChild.attr("line", line);
      }
      return new XMLReportNodeHandler(methodChild, node);
    case SOURCEFILE:
View Full Code Here


  }

  @Test
  public void testReportWithNoGroupsOrBundles() throws Exception {

    MethodCoverage methodCoverage = new MethodCoverage("foo", "V", "V");
    ClassCoverage classCoverage = new ClassCoverage("org/jacoco/test/Test",
        "Test.java", Arrays.asList(methodCoverage));
    PackageCoverage packageCoverage = new PackageCoverage(
        "org/jacoco/test", Arrays.asList(classCoverage), Collections
            .<SourceFileCoverage> emptyList());
View Full Code Here

   *             IO Error creating the element
   */
  public MethodNode(final ClassNode parent, final ICoverageNode methodNode)
      throws IOException {
    super(parent, "method", methodNode);
    final MethodCoverage methodCoverageNode = (MethodCoverage) methodNode;
    this.attr("desc", methodCoverageNode.getDesc());
    final String signature = methodCoverageNode.getSignature();
    if (signature != null) {
      this.attr("signature", signature);
    }
  }
View Full Code Here

  }

  @Test
  public void testReportWithNoGroupsOrBundles() throws Exception {

    MethodCoverage methodCoverage = new MethodCoverage("foo", "V", "V");
    ClassCoverage classCoverage = new ClassCoverage("org/jacoco/test/Test",
        null, "java/lang/Object", new String[0], "Test.java", Arrays
            .asList(methodCoverage));
    PackageCoverage packageCoverage = new PackageCoverage(
        "org/jacoco/test", Arrays.asList(classCoverage), Collections
View Full Code Here

    final IReportVisitor packageHandler = handler
        .visitChild(new CoverageNodeImpl(ElementType.PACKAGE,
            "org.jacoco.example", false));
    final IReportVisitor classHandler = packageHandler
        .visitChild(new CoverageNodeImpl(ElementType.CLASS, "Foo", true));
    MethodCoverage node = new MethodCoverage("doit", "()V", null);
    node.addBlock(5, new int[] { 15, 16, 17 }, false);
    classHandler.visitChild(node).visitEnd(null);
    classHandler.visitEnd(null);
    packageHandler.visitEnd(null);
    final Document doc = getDocument();
    assertEquals("doit",
View Full Code Here

TOP

Related Classes of org.jacoco.core.analysis.MethodCoverage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.