Package org.jacoco.core.internal.analysis

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


        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);
    sourceFileCoverage = sourceFileCoverageImpl;

    packageCoverage = new PackageCoverageImpl("org/jacoco/example",
        Collections.singleton(classCoverage),
        Collections.singleton(sourceFileCoverage));
View Full Code Here


        throw new IllegalStateException(
            "Can't add different class with same name: " + name);
      }
      final String source = coverage.getSourceFileName();
      if (source != null) {
        final SourceFileCoverageImpl sourceFile = getSourceFile(source,
            coverage.getPackageName());
        sourceFile.increment(coverage);
      }
    }
  }
View Full Code Here

  }

  private SourceFileCoverageImpl getSourceFile(final String filename,
      final String packagename) {
    final String key = packagename + '/' + filename;
    SourceFileCoverageImpl sourcefile = (SourceFileCoverageImpl) sourcefiles
        .get(key);
    if (sourcefile == null) {
      sourcefile = new SourceFileCoverageImpl(filename, packagename);
      sourcefiles.put(key, sourcefile);
    }
    return sourcefile;
  }
View Full Code Here

        throw new IllegalStateException(
            "Duplicate class name in same group: " + name);
      }
      final String source = coverage.getSourceFileName();
      if (source != null) {
        final SourceFileCoverageImpl sourceFile = getSourceFile(source,
            coverage.getPackageName());
        sourceFile.increment(coverage);
      }
    }
  }
View Full Code Here

  }

  private SourceFileCoverageImpl getSourceFile(final String filename,
      final String packagename) {
    final String key = packagename + '/' + filename;
    SourceFileCoverageImpl sourcefile = (SourceFileCoverageImpl) sourcefiles
        .get(key);
    if (sourcefile == null) {
      sourcefile = new SourceFileCoverageImpl(filename, packagename);
      sourcefiles.put(key, sourcefile);
    }
    return sourcefile;
  }
View Full Code Here

        new String[0]);
    classCoverageImpl.setSourceFileName("FooClass.java");
    classCoverageImpl.addMethod(methodCoverage);
    classCoverage = classCoverageImpl;

    sourceFileCoverage = new SourceFileCoverageImpl("FooClass.java",
        "org/jacoco/example");
    packageCoverage = new PackageCoverageImpl("org/jacoco/example",
        Collections.singleton(classCoverage),
        Collections.singleton(sourceFileCoverage));
    bundleCoverage = new BundleCoverageImpl("bundle",
View Full Code Here

    output.assertAllClosed();
  }

  @Test(expected = AssertionError.class)
  public void testVisitChildNegative() {
    final SourceFileCoverageImpl node = new SourceFileCoverageImpl(
        "SourceFilePageTest.java", "org/jacoco/report/html");
    final SourceFilePage page = new SourceFilePage(node, null, root,
        context);
    page.visitChild(new CoverageNodeImpl(ElementType.CLASS, "Foo"));
  }
View Full Code Here

    page.visitChild(new CoverageNodeImpl(ElementType.CLASS, "Foo"));
  }

  @Test
  public void testContents() throws Exception {
    final SourceFileCoverageImpl node = new SourceFileCoverageImpl(
        "SourceFilePageTest.java", "org/jacoco/report/internal/html");
    final SourceFilePage page = new SourceFilePage(node, null, root,
        context);
    page.visitEnd(locator);
View Full Code Here

        support.findStr(result, "/html/body/pre/span[1]/@id"));
  }

  @Test
  public void testNoSource() throws IOException {
    final SourceFileCoverageImpl node = new SourceFileCoverageImpl(
        "DoesNotExist.java", "org/jacoco/report/html");
    final SourceFilePage page = new SourceFilePage(node, null, root,
        context);
    page.visitEnd(locator);
View Full Code Here

        "UTF-8");
  }

  @Test
  public void testContents() throws Exception {
    final SourceFileCoverageImpl node = new SourceFileCoverageImpl(
        "SourceFilePageTest.java", "org/jacoco/report/internal/html");
    final SourceFilePage page = new SourceFilePage(node, sourceReader, 4,
        null, rootFolder, context);
    page.render();
View Full Code Here

TOP

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

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.