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

        "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

        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

        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

        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

        "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,
        null, rootFolder, context);
    page.render();
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

        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

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.