当前位置: 首页>>代码示例>>Java>>正文


Java CoverageCollector类代码示例

本文整理汇总了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());
    }
 
开发者ID:nidi3,项目名称:graphviz-java,代码行数:16,代码来源:CodeCoverage.java

示例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());
}
 
开发者ID:nidi3,项目名称:code-assert,代码行数:11,代码来源:CodeCoverage.java

示例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());
}
 
开发者ID:nidi3,项目名称:code-assert,代码行数:10,代码来源:CodeCoverage.java

示例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());
}
 
开发者ID:nidi3,项目名称:raml-tester,代码行数:14,代码来源:CodeCoverage.java


注:本文中的guru.nidi.codeassert.jacoco.CoverageCollector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。