Package org.jacoco.core.internal.analysis

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


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

  @Test
  public void testDuplicateClassNameIdentical() {
    MethodCoverageImpl method = new MethodCoverageImpl("doit", "()V", null);
    method.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 3);
    addClass(123L, false, "Sample", null, method);

    // Add class with same id:
    method = new MethodCoverageImpl("doit", "()V", null);
    method.increment(CounterImpl.COUNTER_1_0, CounterImpl.COUNTER_0_0, 3);
    addClass(123L, false, "Sample", null, method);

    // Second add must be ignored:
    final Collection<IClassCoverage> classes = coverageBuilder.getClasses();
    assertEquals(1, classes.size());
View Full Code Here


    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, false, "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, false, "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, false, "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, false, "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, false, "Sample3", null, method3);

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

  @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

  private MethodCoverageImpl node;

  @Before
  public void setup() {
    node = new MethodCoverageImpl("test", "()V", null);
  }
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, false, null,
        "java/lang/Object", new String[0]);
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.