Package org.jacoco.core.analysis

Examples of org.jacoco.core.analysis.IPackageCoverage


  @Test
  public void testCounters() {
    Collection<IClassCoverage> classes = Collections.emptySet();
    Collection<ISourceFileCoverage> sourcefiles = Collections.emptySet();
    final IPackageCoverage p1 = new PackageCoverageImpl("p1", classes,
        sourcefiles) {
      {
        classCounter = CounterImpl.getInstance(1, 0);
        methodCounter = CounterImpl.getInstance(2, 0);
        branchCounter = CounterImpl.getInstance(3, 0);
        instructionCounter = CounterImpl.getInstance(4, 0);
        lineCounter = CounterImpl.getInstance(5, 0);
      }
    };
    final IPackageCoverage p2 = new PackageCoverageImpl("p1", classes,
        sourcefiles) {
      {
        classCounter = CounterImpl.getInstance(1, 0);
        methodCounter = CounterImpl.getInstance(2, 0);
        branchCounter = CounterImpl.getInstance(3, 0);
View Full Code Here


        Arrays.asList(sb, sc));

    Collection<IPackageCoverage> packages = bundle.getPackages();
    assertEquals(3, packages.size(), 0.0);

    IPackageCoverage p1 = findPackage("p1", packages);
    assertNotNull(p1);
    assertEquals(Collections.singletonList(ca), p1.getClasses());
    assertTrue(p1.getSourceFiles().isEmpty());

    IPackageCoverage p2 = findPackage("p2", packages);
    assertNotNull(p2);
    assertEquals(Collections.singletonList(cb), p2.getClasses());
    assertEquals(Collections.singletonList(sb), p2.getSourceFiles());

    IPackageCoverage p3 = findPackage("p3", packages);
    assertNotNull(p3);
    assertTrue(p3.getClasses().isEmpty());
    assertEquals(Collections.singletonList(sc), p3.getSourceFiles());
  }
View Full Code Here

  @Test
  public void testCounters() {
    Collection<IClassCoverage> classes = Collections.emptySet();
    Collection<ISourceFileCoverage> sourcefiles = Collections.emptySet();
    final IPackageCoverage p1 = new PackageCoverageImpl("p1", classes,
        sourcefiles) {
      {
        classCounter = CounterImpl.getInstance(1, 0);
        methodCounter = CounterImpl.getInstance(2, 0);
        branchCounter = CounterImpl.getInstance(3, 0);
        instructionCounter = CounterImpl.getInstance(4, 0);
        lineCounter = CounterImpl.getInstance(5, 0);
      }
    };
    final IPackageCoverage p2 = new PackageCoverageImpl("p1", classes,
        sourcefiles) {
      {
        classCounter = CounterImpl.getInstance(1, 0);
        methodCounter = CounterImpl.getInstance(2, 0);
        branchCounter = CounterImpl.getInstance(3, 0);
View Full Code Here

        Arrays.asList(sb, sc));

    Collection<IPackageCoverage> packages = bundle.getPackages();
    assertEquals(3, packages.size(), 0.0);

    IPackageCoverage p1 = findPackage("p1", packages);
    assertNotNull(p1);
    assertEquals(Collections.singletonList(ca), p1.getClasses());
    assertTrue(p1.getSourceFiles().isEmpty());

    IPackageCoverage p2 = findPackage("p2", packages);
    assertNotNull(p2);
    assertEquals(Collections.singletonList(cb), p2.getClasses());
    assertEquals(Collections.singletonList(sb), p2.getSourceFiles());

    IPackageCoverage p3 = findPackage("p3", packages);
    assertNotNull(p3);
    assertTrue(p3.getClasses().isEmpty());
    assertEquals(Collections.singletonList(sc), p3.getSourceFiles());
  }
View Full Code Here

        throw new AssertionError("Unexpected method call.");
      }
    };
    Collection<IClassCoverage> classes = Collections.emptyList();
    Collection<ISourceFileCoverage> sources = Collections.emptyList();
    final IPackageCoverage node = new PackageCoverageImpl("foo", classes,
        sources);
    page = new PackagePage(node, null, root, context);
  }
View Full Code Here

  @Test
  public void testCounters() {
    Collection<IClassCoverage> classes = Collections.emptySet();
    Collection<ISourceFileCoverage> sourcefiles = Collections.emptySet();
    final IPackageCoverage p1 = new PackageCoverageImpl("p1", classes,
        sourcefiles) {
      {
        classCounter = CounterImpl.getInstance(1, 0);
        methodCounter = CounterImpl.getInstance(2, 0);
        branchCounter = CounterImpl.getInstance(3, 0);
        instructionCounter = CounterImpl.getInstance(4, 0);
        lineCounter = CounterImpl.getInstance(5, 0);
      }
    };
    final IPackageCoverage p2 = new PackageCoverageImpl("p1", classes,
        sourcefiles) {
      {
        classCounter = CounterImpl.getInstance(1, 0);
        methodCounter = CounterImpl.getInstance(2, 0);
        branchCounter = CounterImpl.getInstance(3, 0);
View Full Code Here

        Arrays.asList(sb, sc));

    Collection<IPackageCoverage> packages = bundle.getPackages();
    assertEquals(3, packages.size(), 0.0);

    IPackageCoverage p1 = findPackage("p1", packages);
    assertNotNull(p1);
    assertEquals(Collections.singletonList(ca), p1.getClasses());
    assertTrue(p1.getSourceFiles().isEmpty());

    IPackageCoverage p2 = findPackage("p2", packages);
    assertNotNull(p2);
    assertEquals(Collections.singletonList(cb), p2.getClasses());
    assertEquals(Collections.singletonList(sb), p2.getSourceFiles());

    IPackageCoverage p3 = findPackage("p3", packages);
    assertNotNull(p3);
    assertTrue(p3.getClasses().isEmpty());
    assertEquals(Collections.singletonList(sc), p3.getSourceFiles());
  }
View Full Code Here

    final SourceFileCoverageImpl s = new SourceFileCoverageImpl(
        "FooClass.java", "org/jacoco/example");
    s.increment(c);

    IPackageCoverage p = new PackageCoverageImpl("org/jacoco/example",
        Collections.singleton((IClassCoverage) c),
        Collections.singleton((ISourceFileCoverage) s));
    return new BundleCoverageImpl("Test", Collections.singleton(p));
  }
View Full Code Here

TOP

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

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.