com.societegenerale.commons.plugin.rules.NoStandardStreamRuleTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of arch-unit-build-plugin-core Show documentation
Show all versions of arch-unit-build-plugin-core Show documentation
The core logic for Maven or Gradle ArchUnit plugin
The newest version!
package com.societegenerale.commons.plugin.rules;
import java.util.Collection;
import com.societegenerale.commons.plugin.service.ScopePathProvider;
import com.societegenerale.commons.plugin.utils.ArchUtils;
import com.tngtech.archunit.core.domain.JavaClass;
import com.tngtech.archunit.lang.ArchCondition;
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
import static com.tngtech.archunit.library.GeneralCodingRules.ACCESS_STANDARD_STREAMS;
public class NoStandardStreamRuleTest implements ArchRuleTest {
private static final ArchCondition notUseStandardStream = ACCESS_STANDARD_STREAMS;
@Override
public void execute(String packagePath, ScopePathProvider scopePathProvider, Collection excludedPaths) {
noClasses().should(notUseStandardStream)
.allowEmptyShould(true)
.check(ArchUtils.importAllClassesInPackage(scopePathProvider.getMainClassesPath(),packagePath, excludedPaths));
}
public static ArchCondition getNotUseStandardStream(){
return ACCESS_STANDARD_STREAMS;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy