use of com.tngtech.archunit.lang.ArchRule in project sirius-components by eclipse-sirius.
the class AbstractCodingRulesTests method noClassesShouldUseGuava.
@Test
public void noClassesShouldUseGuava() {
// @formatter:off
ArchRule rule = ArchRuleDefinition.noClasses().that().resideInAPackage(this.getProjectRootPackage()).should().dependOnClassesThat().resideInAnyPackage(GUAVA_ANNOTATIONS, GUAVA_BASE, GUAVA_COLLECT, GUAVA_ESCAPE, GUAVA_EVENTBUS, GUAVA_HASH, GUAVA_HTML, GUAVA_IO, GUAVA_MATH, GUAVA_NET, GUAVA_PRIMITIVES, GUAVA_REFLECT, GUAVA_UTIL, GUAVA_XML, GUAVA_THIRDPARTY);
// @formatter:on
rule.check(this.getClasses());
}
use of com.tngtech.archunit.lang.ArchRule in project sirius-components by eclipse-sirius.
the class AbstractCodingRulesTests method noClassesShouldUseJavaLogging.
@Test
public void noClassesShouldUseJavaLogging() {
// @formatter:off
ArchRule rule = ArchRuleDefinition.noClasses().that().resideInAPackage(this.getProjectRootPackage()).should(GeneralCodingRules.USE_JAVA_UTIL_LOGGING);
// @formatter:on
rule.check(this.getClasses());
}
use of com.tngtech.archunit.lang.ArchRule in project sirius-components by eclipse-sirius.
the class AbstractCodingRulesTests method noClassesShouldUseSpringStringUtils.
@Test
public void noClassesShouldUseSpringStringUtils() {
// @formatter:off
ArchRule rule = ArchRuleDefinition.noClasses().that().resideInAPackage(this.getProjectRootPackage()).should().dependOnClassesThat().areAssignableTo(SPRING_STRINGUTILS);
// @formatter:on
rule.check(this.getClasses());
}
use of com.tngtech.archunit.lang.ArchRule in project sirius-components by eclipse-sirius.
the class AbstractImmutableTests method immutableClassesShouldHaveABuilderMethod.
@Test
public void immutableClassesShouldHaveABuilderMethod() {
// @formatter:off
ArchRule rule = ArchRuleDefinition.classes().that().resideInAPackage(this.getProjectRootPackage()).and().areAnnotatedWith(Immutable.class).should(this.haveABuilderMethod());
// @formatter:on
rule.check(this.getClasses());
}
use of com.tngtech.archunit.lang.ArchRule in project sirius-components by eclipse-sirius.
the class AbstractImmutableTests method immutableClassesShouldHaveANestedBuilder.
@Test
public void immutableClassesShouldHaveANestedBuilder() {
// @formatter:off
ArchRule rule = ArchRuleDefinition.classes().that().resideInAPackage(this.getProjectRootPackage()).and().areAnnotatedWith(Immutable.class).should(new HaveAValidBuilderCondition(this.getClasses()));
// @formatter:on
rule.check(this.getClasses());
}
Aggregations