Package org.jacoco.core.internal.analysis

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


        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

        "org/jacoco/example/FooClass", 1001, false, null,
        "java/lang/Object", new String[0]);
    c.setSourceFileName("FooClass.java");
    c.addMethod(m);

    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

  @Before
  @Override
  public void setup() throws Exception {
    super.setup();
    ISourceFileCoverage src1 = new SourceFileCoverageImpl("Src1.java",
        "org/jacoco/example");
    ISourceFileCoverage src2 = new SourceFileCoverageImpl("Src2.java",
        "org/jacoco/example");
    node = new PackageCoverageImpl("org/jacoco/example",
        Collections.<IClassCoverage> emptyList(), Arrays.asList(src1,
            src2));
    sourceLocator = new ISourceFileLocator() {
View Full Code Here

        "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(
        class1, class2), Arrays.asList(src1));

    page = new PackagePage(node, null, sourceLocator, rootFolder, context);
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

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

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

    assertNull(nodes.getClassCoverage("somewhere/NotExist"));
  }

  @Test
  public void testGetSourceFileCoverage() {
    final SourceFileCoverageImpl c = new SourceFileCoverageImpl("Example.java",
        "com/example");
    sourcefiles.add(c);

    final AnalyzedNodes nodes = new AnalyzedNodes(classes, sourcefiles);
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.