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


Java DependencyRuler类代码示例

本文整理汇总了Java中guru.nidi.codeassert.dependency.DependencyRuler的典型用法代码示例。如果您正苦于以下问题:Java DependencyRuler类的具体用法?Java DependencyRuler怎么用?Java DependencyRuler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DependencyRuler类属于guru.nidi.codeassert.dependency包,在下文中一共展示了DependencyRuler类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: clientDoesNotRelyOnComposing

import guru.nidi.codeassert.dependency.DependencyRuler; //导入依赖的package包/类
@Test
public void clientDoesNotRelyOnComposing() {
    class ComRewedigitalExamplesMsintegrationComposer extends DependencyRuler {
        DependencyRule client, composing, parser, proxy, routing, util;

        @Override
        public void defineRules() {
            base().mayUse(base().allSub());
            client.mayUse(util).mustNotUse(composing);
            parser.mayUse(util).mustNotUse(composing);
            composing.mayUse(client, parser, util).mustNotUse(proxy, routing);
            proxy.mayUse(composing, routing, util).mustNotUse(client);
        }
    }

    DependencyRules rules = DependencyRules.denyAll()
        .withRelativeRules(new ComRewedigitalExamplesMsintegrationComposer())
        .withExternals("java.*", "org.*", "net.*", "com.spotify.*", "com.google.*",
            "com.damnhandy.*", "okio");

    DependencyResult result = new DependencyAnalyzer(config).rules(rules).analyze();

    assertThat(result, matchesRulesExactly());

}
 
开发者ID:rewe-digital,项目名称:integration-patterns,代码行数:26,代码来源:DependenciesTest.java

示例2: dependencies

import guru.nidi.codeassert.dependency.DependencyRuler; //导入依赖的package包/类
@Test
    public void dependencies() {
        class GuruNidiRamltester extends DependencyRuler {
            DependencyRule $self, core, httpcomponents, restassured, restassured3, junit, validator, model, servlet, spring, jaxrs, util;

            public void defineRules() {
                $self.mayUse(model, core, servlet, httpcomponents, restassured, restassured3, spring, jaxrs, validator, junit, util);
                core.mayUse(model, util);
                util.mayUse(model);
                servlet.mayUse(model, util, core);
                httpcomponents.mayUse(model, util, core);
                restassured.mayUse(model, core);
                restassured3.mayUse(model, core);
                junit.mayUse(util, core);
                validator.mayUse(util, core);
                spring.mayUse(model, util, core, servlet);
                jaxrs.mayUse(model, util, core);
            }
        }
//TODO dependencies to externals (spring, httpcomponents etc.)
        final DependencyRules rules = DependencyRules.denyAll()
                .withExternals("java*", "org*", "com*", "io*", "guru.nidi.loader*")
                .withRelativeRules(new GuruNidiRamltester());
        assertThat(modelResult(), packagesMatchExactly(rules));
    }
 
开发者ID:nidi3,项目名称:raml-tester,代码行数:26,代码来源:CodeAnalysisTest.java

示例3: dependencies

import guru.nidi.codeassert.dependency.DependencyRuler; //导入依赖的package包/类
@Test
public void dependencies() {
    class GuruNidiRamlproxy extends DependencyRuler {
        DependencyRule report, cli, jetty, core, data;

        @Override
        public void defineRules() {
            cli.mayUse(core, report, base());
            base().mayUse(core, report, jetty);
            jetty.mayUse(core, report);
            core.mayUse(report, data);
            report.mayUse(data);
        }
    }

    final DependencyRules rules = DependencyRules.denyAll()
            .withExternals("java*", "org*", "com*", "guru.nidi.ramltester*")
            .withRelativeRules(new GuruNidiRamlproxy());
    assertThat(modelResult(), packagesMatchExactly(rules));
}
 
开发者ID:nidi3,项目名称:raml-tester-proxy,代码行数:21,代码来源:CodeTest.java


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