use of com.blackducksoftware.integration.hub.detect.util.filter.DetectOverrideableFilter in project hub-detect by blackducksoftware.
the class AllAndNoneExcludedIncludedFilterTest method testOverridableNormalExcludeList.
// Overridable
@Test
public void testOverridableNormalExcludeList() {
DetectFilter filter = new DetectOverrideableFilter("docker,rubygems", "");
assertFalse(filter.shouldInclude("docker"));
assertFalse(filter.shouldInclude("rubygems"));
assertTrue(filter.shouldInclude("gradle"));
}
use of com.blackducksoftware.integration.hub.detect.util.filter.DetectOverrideableFilter in project hub-detect by blackducksoftware.
the class AllAndNoneExcludedIncludedFilterTest method testOverridableAllExcluded.
@Test
public void testOverridableAllExcluded() {
DetectFilter filter = new DetectOverrideableFilter("ALL", "");
assertFalse(filter.shouldInclude("docker"));
assertFalse(filter.shouldInclude("rubygems"));
assertFalse(filter.shouldInclude("gradle"));
}
use of com.blackducksoftware.integration.hub.detect.util.filter.DetectOverrideableFilter in project hub-detect by blackducksoftware.
the class AllAndNoneExcludedIncludedFilterTest method testOverridableAllExcludedWithIgnoredIncludes.
@Test
public void testOverridableAllExcludedWithIgnoredIncludes() {
DetectFilter filter = new DetectOverrideableFilter("ALL", "docker,rubygems");
assertFalse(filter.shouldInclude("docker"));
assertFalse(filter.shouldInclude("rubygems"));
assertFalse(filter.shouldInclude("gradle"));
}
use of com.blackducksoftware.integration.hub.detect.util.filter.DetectOverrideableFilter in project hub-detect by blackducksoftware.
the class AllAndNoneExcludedIncludedFilterTest method testOverridableNormalIncludeList.
@Test
public void testOverridableNormalIncludeList() {
DetectFilter filter = new DetectOverrideableFilter("", "docker,rubygems");
assertTrue(filter.shouldInclude("docker"));
assertTrue(filter.shouldInclude("rubygems"));
assertFalse(filter.shouldInclude("gradle"));
}
use of com.blackducksoftware.integration.hub.detect.util.filter.DetectOverrideableFilter in project hub-detect by blackducksoftware.
the class DetectConfigurationFactory method createSearchOptions.
public SearchOptions createSearchOptions(final File directory) {
final List<String> excludedDirectories = Arrays.asList(detectConfiguration.getStringArrayProperty(DetectProperty.DETECT_DETECTOR_SEARCH_EXCLUSION, PropertyAuthority.None));
final List<String> excludedDirectoryPatterns = Arrays.asList(detectConfiguration.getStringArrayProperty(DetectProperty.DETECT_DETECTOR_SEARCH_EXCLUSION_PATTERNS, PropertyAuthority.None));
final boolean forceNestedSearch = detectConfiguration.getBooleanProperty(DetectProperty.DETECT_DETECTOR_SEARCH_CONTINUE, PropertyAuthority.None);
final int maxDepth = detectConfiguration.getIntegerProperty(DetectProperty.DETECT_DETECTOR_SEARCH_DEPTH, PropertyAuthority.None);
final String excluded = detectConfiguration.getProperty(DetectProperty.DETECT_EXCLUDED_DETECTOR_TYPES, PropertyAuthority.None).toUpperCase();
final String included = detectConfiguration.getProperty(DetectProperty.DETECT_INCLUDED_DETECTOR_TYPES, PropertyAuthority.None).toUpperCase();
final DetectOverrideableFilter bomToolFilter = new DetectOverrideableFilter(excluded, included);
return new SearchOptions(directory, excludedDirectories, excludedDirectoryPatterns, forceNestedSearch, maxDepth, bomToolFilter);
}
Aggregations