Search in sources :

Example 1 with BundleCoverageImpl

use of org.jacoco.core.internal.analysis.BundleCoverageImpl in project jacoco by jacoco.

the class BundleCheckerTest method createBundle.

private IBundleCoverage createBundle() {
    final MethodCoverageImpl m = new MethodCoverageImpl("fooMethod", "()V", null);
    m.increment(CounterImpl.getInstance(5, 5), CounterImpl.COUNTER_0_0, 1);
    m.incrementMethodCounter();
    final ClassCoverageImpl c = new ClassCoverageImpl("org/jacoco/example/FooClass", 1001, false);
    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));
}
Also used : IPackageCoverage(org.jacoco.core.analysis.IPackageCoverage) PackageCoverageImpl(org.jacoco.core.internal.analysis.PackageCoverageImpl) IClassCoverage(org.jacoco.core.analysis.IClassCoverage) ISourceFileCoverage(org.jacoco.core.analysis.ISourceFileCoverage) BundleCoverageImpl(org.jacoco.core.internal.analysis.BundleCoverageImpl) ClassCoverageImpl(org.jacoco.core.internal.analysis.ClassCoverageImpl) MethodCoverageImpl(org.jacoco.core.internal.analysis.MethodCoverageImpl) SourceFileCoverageImpl(org.jacoco.core.internal.analysis.SourceFileCoverageImpl)

Aggregations

IClassCoverage (org.jacoco.core.analysis.IClassCoverage)1 IPackageCoverage (org.jacoco.core.analysis.IPackageCoverage)1 ISourceFileCoverage (org.jacoco.core.analysis.ISourceFileCoverage)1 BundleCoverageImpl (org.jacoco.core.internal.analysis.BundleCoverageImpl)1 ClassCoverageImpl (org.jacoco.core.internal.analysis.ClassCoverageImpl)1 MethodCoverageImpl (org.jacoco.core.internal.analysis.MethodCoverageImpl)1 PackageCoverageImpl (org.jacoco.core.internal.analysis.PackageCoverageImpl)1 SourceFileCoverageImpl (org.jacoco.core.internal.analysis.SourceFileCoverageImpl)1