Package org.jacoco.core.internal.analysis

Examples of org.jacoco.core.internal.analysis.ClassCoverageImpl


    return result;
  }

  private void addClass(long id, boolean nomatch, String name, String source,
      MethodCoverageImpl... methods) {
    final ClassCoverageImpl coverage = new ClassCoverageImpl(name, id,
        nomatch, null, "java/lang/Object", new String[0]);
    coverage.setSourceFileName(source);
    for (MethodCoverageImpl m : methods) {
      coverage.addMethod(m);
    }
    coverageBuilder.visitCoverage(coverage);
  }
View Full Code Here


  @Before
  @Override
  public void setup() throws Exception {
    super.setup();
    node = new ClassCoverageImpl("org/jacoco/example/Foo", 123, false,
        null, "java/lang/Object", null);
    node.addMethod(new MethodCoverageImpl("a", "()V", null));
    node.addMethod(new MethodCoverageImpl("b", "()V", null));
    node.addMethod(new MethodCoverageImpl("c", "()V", null));
  }
View Full Code Here

    assertEquals("Foo.html", page.getFileName());
  }

  @Test
  public void testGetFileNameDefault() throws IOException {
    IClassCoverage defaultNode = new ClassCoverageImpl("Foo", 123, false,
        null, "java/lang/Object", null);
    page = new ClassPage(defaultNode, null, null, rootFolder, context);
    assertEquals("Foo.html", page.getFileName());
  }
View Full Code Here

    };
  }

  @Test
  public void testContentsWithSource() throws Exception {
    IClassCoverage class1 = new ClassCoverageImpl(
        "org/jacoco/example/Foo1", 0x1000, false, null,
        "java/lang/Object", null);
    IClassCoverage class2 = new ClassCoverageImpl(
        "org/jacoco/example/Foo2", 0x2000, false, null,
        "java/lang/Object", null);
    ISourceFileCoverage src1 = new SourceFileCoverageImpl("Src1.java",
        "org/jacoco/example");
    node = new PackageCoverageImpl("org/jacoco/example", Arrays.asList(
View Full Code Here

    output.assertFile("index.source.html");
  }

  @Test
  public void testContentsNoSource() throws Exception {
    IClassCoverage class1 = new ClassCoverageImpl(
        "org/jacoco/example/Foo1", 0x1000, false, null,
        "java/lang/Object", null);
    IClassCoverage class2 = new ClassCoverageImpl(
        "org/jacoco/example/Foo2", 0x2000, false, null,
        "java/lang/Object", null);
    node = new PackageCoverageImpl("org/jacoco/example", Arrays.asList(
        class1, class2), Collections.<ISourceFileCoverage> emptyList());
View Full Code Here

        CounterImpl.getInstance(1, 2), 2);
    m.increment(CounterImpl.getInstance(4, 5), CounterImpl.COUNTER_0_0, 3);
    m.incrementMethodCounter();
    methodCoverage = m;

    final ClassCoverageImpl classCoverageImpl = new ClassCoverageImpl(
        "org/jacoco/example/FooClass", 1001, false, null,
        "java/lang/Object", new String[0]);
    classCoverageImpl.setSourceFileName("FooClass.java");
    classCoverageImpl.addMethod(methodCoverage);
    classCoverage = classCoverageImpl;

    final SourceFileCoverageImpl sourceFileCoverageImpl = new SourceFileCoverageImpl(
        "FooClass.java", "org/jacoco/example");
    sourceFileCoverageImpl.increment(classCoverage);
View Full Code Here

    sourcefiles = new ArrayList<ISourceFileCoverage>();
  }

  @Test
  public void testGetClassCoverage() {
    final ClassCoverageImpl c = new ClassCoverageImpl("package/MyClass", 0,
        false, null, "java/lang/Object", new String[0]);
    classes.add(c);

    final AnalyzedNodes nodes = new AnalyzedNodes(classes, sourcefiles);
View Full Code Here

TOP

Related Classes of org.jacoco.core.internal.analysis.ClassCoverageImpl

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.