Package org.jacoco.core.internal.analysis

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


    assertEquals(1, classes.size());
  }

  @Test
  public void testCreateSourceFile() {
    final MethodCoverageImpl method1 = new MethodCoverageImpl("doit",
        "()V", null);
    method1.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 3);
    addClass(123L, "Sample", "Sample.java", method1);

    final MethodCoverageImpl method2 = new MethodCoverageImpl("doit",
        "()V", null);
    method2.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 6);
    addClass(234L, "Second", "Sample.java", method2);

    final Collection<ISourceFileCoverage> sourcefiles = coverageBuilder
        .getSourceFiles();
    assertEquals(1, sourcefiles.size());
View Full Code Here


    assertEquals(0, s.getClassCounter().getCoveredCount());
  }

  @Test
  public void testGetBundle() {
    final MethodCoverageImpl method1 = new MethodCoverageImpl("doit",
        "()V", null);
    method1.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 3);
    addClass(1, "org/jacoco/examples/Sample1", null, method1);

    final MethodCoverageImpl method2 = new MethodCoverageImpl("doit",
        "()V", null);
    method2.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 6);
    addClass(2, "org/jacoco/examples/Sample2", null, method2);

    final MethodCoverageImpl method3 = new MethodCoverageImpl("doit",
        "()V", null);
    method3.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 1);
    addClass(3, "Sample3", null, method3);

    BundleCoverageImpl bundle = coverageBuilder.getBundle("testbundle");
    assertEquals("testbundle", bundle.getName());
View Full Code Here

    coverageBuilder = new CoverageBuilder();
  }

  @Test
  public void testCreateClassMissed() {
    final MethodCoverageImpl method = new MethodCoverageImpl("doit", "()V",
        null);
    method.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 6);
    method.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 7);
    method.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 8);
    method.incrementMethodCounter();
    addClass(123L, "Sample", null, method);

    final Collection<IClassCoverage> classes = coverageBuilder.getClasses();
    assertEquals(1, classes.size());
    IClassCoverage c = classes.iterator().next();
View Full Code Here

  private final IPackageCoverage packageCoverage;

  private final BundleCoverageImpl bundleCoverage;

  public ReportStructureTestDriver() {
    final MethodCoverageImpl m = new MethodCoverageImpl("fooMethod", "()V",
        null);
    m.increment(CounterImpl.getInstance(3, 5), CounterImpl.COUNTER_0_0, 1);
    m.increment(CounterImpl.getInstance(3, 5),
        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, null, "java/lang/Object",
        new String[0]);
View Full Code Here

    final IReportVisitor packageHandler = handler
        .visitChild(new CoverageNodeImpl(ElementType.PACKAGE,
            "org.jacoco.example"));
    final IReportVisitor classHandler = packageHandler
        .visitChild(new SourceNodeImpl(ElementType.CLASS, "Foo"));
    MethodCoverageImpl node = new MethodCoverageImpl("doit", "()V", null);
    node.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 15);
    classHandler.visitChild(node).visitEnd(null);
    classHandler.visitEnd(null);
    packageHandler.visitEnd(null);
    final Document doc = getDocument();
    assertEquals("doit",
View Full Code Here

    addClass(345L, "Sample", null, method);
  }

  @Test
  public void testCreateSourceFile() {
    final MethodCoverageImpl method1 = new MethodCoverageImpl("doit",
        "()V", null);
    method1.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 3);
    addClass(123L, "Sample", "Sample.java", method1);

    final MethodCoverageImpl method2 = new MethodCoverageImpl("doit",
        "()V", null);
    method2.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 6);
    addClass(234L, "Second", "Sample.java", method2);

    final Collection<ISourceFileCoverage> sourcefiles = coverageBuilder
        .getSourceFiles();
    assertEquals(1, sourcefiles.size());
View Full Code Here

    assertEquals(0, s.getClassCounter().getCoveredCount());
  }

  @Test
  public void testGetBundle() {
    final MethodCoverageImpl method1 = new MethodCoverageImpl("doit",
        "()V", null);
    method1.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 3);
    addClass(1, "org/jacoco/examples/Sample1", null, method1);

    final MethodCoverageImpl method2 = new MethodCoverageImpl("doit",
        "()V", null);
    method2.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 6);
    addClass(2, "org/jacoco/examples/Sample2", null, method2);

    final MethodCoverageImpl method3 = new MethodCoverageImpl("doit",
        "()V", null);
    method3.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 1);
    addClass(3, "Sample3", null, method3);

    BundleCoverageImpl bundle = coverageBuilder.getBundle("testbundle");
    assertEquals("testbundle", bundle.getName());
View Full Code Here

  private final BundleCoverageImpl bundleCoverage;

  private final CoverageNodeImpl groupCoverage;

  public ReportStructureTestDriver() {
    methodCoverage = new MethodCoverageImpl("fooMethod", "()V", null);

    final ClassCoverageImpl classCoverageImpl = new ClassCoverageImpl(
        "org/jacoco/example/FooClass", 1001, null, "java/lang/Object",
        new String[0]);
    classCoverageImpl.setSourceFileName("FooClass.java");
View Full Code Here

    coverageBuilder = new CoverageBuilder();
  }

  @Test
  public void testCreateClassMissed() {
    final MethodCoverageImpl method = new MethodCoverageImpl("doit", "()V",
        null);
    method.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 6);
    method.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 7);
    method.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 8);
    addClass(123L, "Sample", null, method);

    final Collection<IClassCoverage> classes = coverageBuilder.getClasses();
    assertEquals(1, classes.size());
    IClassCoverage c = classes.iterator().next();
View Full Code Here

    assertEquals(0, m.getLineCounter().getCoveredCount());
  }

  @Test
  public void testCreateClassCovered() {
    final MethodCoverageImpl method = new MethodCoverageImpl("doit", "()V",
        null);
    method.increment(CounterImpl.COUNTER_0_1, CounterImpl.COUNTER_0_0, 6);
    method.increment(CounterImpl.COUNTER_0_1, CounterImpl.COUNTER_0_0, 7);
    method.increment(CounterImpl.COUNTER_0_1, CounterImpl.COUNTER_0_0, 8);
    addClass(123L, "Sample", null, method);

    final Collection<IClassCoverage> classes = coverageBuilder.getClasses();
    assertEquals(1, classes.size());
    IClassCoverage c = classes.iterator().next();
View Full Code Here

TOP

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

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.