All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.societegenerale.commons.plugin.rules.NoStandardStreamRuleTest Maven / Gradle / Ivy

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