use of org.jacoco.core.internal.analysis.ClassCoverageImpl in project jacoco by jacoco.
the class CoverageBuilderTest method addClass.
private void addClass(long id, boolean nomatch, String name, String source, MethodCoverageImpl... methods) {
final ClassCoverageImpl coverage = new ClassCoverageImpl(name, id, nomatch);
coverage.setSourceFileName(source);
for (MethodCoverageImpl m : methods) {
coverage.addMethod(m);
}
coverageBuilder.visitCoverage(coverage);
}
use of org.jacoco.core.internal.analysis.ClassCoverageImpl 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));
}
use of org.jacoco.core.internal.analysis.ClassCoverageImpl in project jacoco by jacoco.
the class ClassRowWriterTest method TestRow.
@Test
public void TestRow() throws Exception {
IClassCoverage node = new ClassCoverageImpl("test/package/Foo", 123, false) {
{
instructionCounter = CounterImpl.getInstance(1, 11);
branchCounter = CounterImpl.getInstance(2, 22);
lineCounter = CounterImpl.getInstance(3, 33);
complexityCounter = CounterImpl.getInstance(4, 44);
methodCounter = CounterImpl.getInstance(5, 55);
classCounter = CounterImpl.getInstance(6, 66);
}
};
writer.writeRow("group", "test/package", node);
BufferedReader reader = getResultReader();
reader.readLine();
assertEquals("group,test/package,test/package/Foo,1,11,2,22,3,33,4,44,5,55", reader.readLine());
}
use of org.jacoco.core.internal.analysis.ClassCoverageImpl in project jacoco by jacoco.
the class ClassPageTest method setup.
@Before
@Override
public void setup() throws Exception {
super.setup();
node = new ClassCoverageImpl("org/jacoco/example/Foo", 123, false);
node.addMethod(new MethodCoverageImpl("a", "()V", null));
node.addMethod(new MethodCoverageImpl("b", "()V", null));
node.addMethod(new MethodCoverageImpl("c", "()V", null));
}
use of org.jacoco.core.internal.analysis.ClassCoverageImpl in project jacoco by jacoco.
the class ClassPageTest method testGetFileNameDefault.
@Test
public void testGetFileNameDefault() throws IOException {
IClassCoverage defaultNode = new ClassCoverageImpl("Foo", 123, false);
page = new ClassPage(defaultNode, null, null, rootFolder, context);
assertEquals("Foo.html", page.getFileName());
}
Aggregations