本文整理汇总了Java中guru.nidi.codeassert.jacoco.CoverageCollector类的典型用法代码示例。如果您正苦于以下问题:Java CoverageCollector类的具体用法?Java CoverageCollector怎么用?Java CoverageCollector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CoverageCollector类属于guru.nidi.codeassert.jacoco包,在下文中一共展示了CoverageCollector类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: coverage
import guru.nidi.codeassert.jacoco.CoverageCollector; //导入依赖的package包/类
@Test
public void coverage() {
//TODO 75,75,75 should be the goal
final JacocoAnalyzer analyzer = new JacocoAnalyzer(new CoverageCollector(BRANCH, LINE, METHOD)
.just(For.global().setMinima(0, 0, 0)) //TODO remove
// .just(For.global().setMinima(60, 75, 75))
.just(For.allPackages().setMinima(75, 75, 75))
.just(For.thePackage("*.attribute").setMinima(70, 75, 75))
.just(For.thePackage("*.engine").setMinima(30, 70, 70))
.just(For.thePackage("*.model").setMinima(60, 75, 75))
.just(For.thePackage("*.service").setMinima(40, 65, 75))
.just(For.thePackage("com.kitfox.svg*").setMinima(0, 0, 0)) //TODO remove
);
assertThat("Enough code coverage", analyzer.analyze(), hasEnoughCoverage());
}
示例2: coverage
import guru.nidi.codeassert.jacoco.CoverageCollector; //导入依赖的package包/类
@Test
public void coverage() {
// Coverage of branches must be at least 70%, lines 80% and methods 90%
// This is checked globally and for all packages except for entities.
JacocoAnalyzer analyzer = new JacocoAnalyzer(new CoverageCollector(BRANCH, LINE, METHOD)
.just(For.global().setMinima(70, 80, 90))
.just(For.allPackages().setMinima(70, 80, 90))
.just(For.thePackage("org.proj.entity.*").setNoMinima()));
assertThat(analyzer.analyze(), hasEnoughCoverage());
}
示例3: coverage
import guru.nidi.codeassert.jacoco.CoverageCollector; //导入依赖的package包/类
@Test
void coverage() {
JacocoAnalyzer analyzer = new JacocoAnalyzer(new CoverageCollector(BRANCH, LINE, METHOD)
.just(For.global().setMinima(80, 80, 80))
.just(For.allPackages().setMinima(75, 80, 80))
.just(For.thePackage("*junit").setMinima(70, 70, 60))
);
assertThat(analyzer.analyze(), hasEnoughCoverage());
}
示例4: coverage
import guru.nidi.codeassert.jacoco.CoverageCollector; //导入依赖的package包/类
@Test
public void coverage() {
//TODO 75,75,75 should be the goal
final JacocoAnalyzer analyzer = new JacocoAnalyzer(new CoverageCollector(BRANCH, LINE, METHOD)
.just(For.global().setMinima(75, 75, 75))
.just(For.allPackages().setMinima(75, 75, 75))
.just(For.packge("*.httpcomponents").setMinima(50, 60, 60))
.just(For.packge("*.jaxrs").setMinima(50, 60, 50))
.just(For.packge("*.servlet").setMinima(70, 60, 75))
.just(For.packge("*.validator").setMinima(70, 75, 75))
);
assertThat(analyzer.analyze(), hasEnoughCoverage());
}