Search in sources :

Example 6 with BlackDuckSignatureScannerOptions

use of com.synopsys.integration.detect.tool.signaturescanner.BlackDuckSignatureScannerOptions in project synopsys-detect by blackducksoftware.

the class ProductDeciderTest method shouldNotRunBlackduckRapidModeAndBDIO2Disabled.

@Test
public void shouldNotRunBlackduckRapidModeAndBDIO2Disabled() {
    BlackDuckConnectionDetails blackDuckConnectionDetails = blackDuckConnectionDetails(false, VALID_URL);
    BlackDuckSignatureScannerOptions blackDuckSignatureScannerOptions = blackDuckSignatureScannerOptions(null, null);
    BlackDuckDecision productDecision = new ProductDecider().decideBlackDuck(blackDuckConnectionDetails, blackDuckSignatureScannerOptions, BlackduckScanMode.RAPID, createBdioOptions(false, true));
    Assertions.assertFalse(productDecision.shouldRun());
}
Also used : ProductDecider(com.synopsys.integration.detect.lifecycle.boot.decision.ProductDecider) BlackDuckSignatureScannerOptions(com.synopsys.integration.detect.tool.signaturescanner.BlackDuckSignatureScannerOptions) BlackDuckConnectionDetails(com.synopsys.integration.detect.configuration.connection.BlackDuckConnectionDetails) BlackDuckDecision(com.synopsys.integration.detect.lifecycle.boot.decision.BlackDuckDecision) Test(org.junit.jupiter.api.Test)

Example 7 with BlackDuckSignatureScannerOptions

use of com.synopsys.integration.detect.tool.signaturescanner.BlackDuckSignatureScannerOptions in project synopsys-detect by blackducksoftware.

the class ProductDeciderTest method shouldRunBlackduckIntelligentModeAndBDIO2Enabled.

@Test
public void shouldRunBlackduckIntelligentModeAndBDIO2Enabled() {
    BlackDuckConnectionDetails blackDuckConnectionDetails = blackDuckConnectionDetails(false, VALID_URL);
    BlackDuckSignatureScannerOptions blackDuckSignatureScannerOptions = blackDuckSignatureScannerOptions(null, null);
    BlackDuckDecision productDecision = new ProductDecider().decideBlackDuck(blackDuckConnectionDetails, blackDuckSignatureScannerOptions, BlackduckScanMode.INTELLIGENT, createBdioOptions(true, false));
    Assertions.assertTrue(productDecision.shouldRun());
}
Also used : ProductDecider(com.synopsys.integration.detect.lifecycle.boot.decision.ProductDecider) BlackDuckSignatureScannerOptions(com.synopsys.integration.detect.tool.signaturescanner.BlackDuckSignatureScannerOptions) BlackDuckConnectionDetails(com.synopsys.integration.detect.configuration.connection.BlackDuckConnectionDetails) BlackDuckDecision(com.synopsys.integration.detect.lifecycle.boot.decision.BlackDuckDecision) Test(org.junit.jupiter.api.Test)

Example 8 with BlackDuckSignatureScannerOptions

use of com.synopsys.integration.detect.tool.signaturescanner.BlackDuckSignatureScannerOptions in project synopsys-detect by blackducksoftware.

the class DetectConfigurationFactory method createBlackDuckSignatureScannerOptions.

public BlackDuckSignatureScannerOptions createBlackDuckSignatureScannerOptions() {
    List<Path> signatureScannerPaths = detectConfiguration.getPaths(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_PATHS);
    List<String> exclusionPatterns = collectSignatureScannerDirectoryExclusions();
    Integer scanMemory = detectConfiguration.getValue(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_MEMORY);
    Boolean dryRun = detectConfiguration.getValue(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_DRY_RUN);
    Boolean uploadSource = detectConfiguration.getValue(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_UPLOAD_SOURCE_MODE);
    Boolean licenseSearch = detectConfiguration.getValue(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_LICENSE_SEARCH);
    Boolean copyrightSearch = detectConfiguration.getValue(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_COPYRIGHT_SEARCH);
    Boolean followSymLinks = getFollowSymLinks();
    String additionalArguments = detectConfiguration.getNullableValue(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_ARGUMENTS);
    Path localScannerInstallPath = detectConfiguration.getPathOrNull(DetectProperties.DETECT_BLACKDUCK_SIGNATURE_SCANNER_LOCAL_PATH);
    Integer maxDepth = detectConfiguration.getValue(DetectProperties.DETECT_EXCLUDED_DIRECTORIES_SEARCH_DEPTH);
    Boolean treatSkippedScansAsSuccess = detectConfiguration.getValue(DetectProperties.DETECT_FORCE_SUCCESS_ON_SKIP);
    return new BlackDuckSignatureScannerOptions(signatureScannerPaths, exclusionPatterns, localScannerInstallPath, scanMemory, findParallelProcessors(), dryRun, findSnippetMatching(), uploadSource, additionalArguments, maxDepth, findIndividualFileMatching(), licenseSearch, copyrightSearch, followSymLinks, treatSkippedScansAsSuccess);
}
Also used : Path(java.nio.file.Path) BlackDuckSignatureScannerOptions(com.synopsys.integration.detect.tool.signaturescanner.BlackDuckSignatureScannerOptions)

Example 9 with BlackDuckSignatureScannerOptions

use of com.synopsys.integration.detect.tool.signaturescanner.BlackDuckSignatureScannerOptions in project synopsys-detect by blackducksoftware.

the class ProductDeciderTest method shouldRunBlackduckRapidModeAndBDIO2Enabled.

@Test
public void shouldRunBlackduckRapidModeAndBDIO2Enabled() {
    BlackDuckConnectionDetails blackDuckConnectionDetails = blackDuckConnectionDetails(false, VALID_URL);
    BlackDuckSignatureScannerOptions blackDuckSignatureScannerOptions = blackDuckSignatureScannerOptions(null, null);
    BlackDuckDecision productDecision = new ProductDecider().decideBlackDuck(blackDuckConnectionDetails, blackDuckSignatureScannerOptions, BlackduckScanMode.RAPID, createBdioOptions(true, true));
    Assertions.assertTrue(productDecision.shouldRun());
}
Also used : ProductDecider(com.synopsys.integration.detect.lifecycle.boot.decision.ProductDecider) BlackDuckSignatureScannerOptions(com.synopsys.integration.detect.tool.signaturescanner.BlackDuckSignatureScannerOptions) BlackDuckConnectionDetails(com.synopsys.integration.detect.configuration.connection.BlackDuckConnectionDetails) BlackDuckDecision(com.synopsys.integration.detect.lifecycle.boot.decision.BlackDuckDecision) Test(org.junit.jupiter.api.Test)

Example 10 with BlackDuckSignatureScannerOptions

use of com.synopsys.integration.detect.tool.signaturescanner.BlackDuckSignatureScannerOptions in project synopsys-detect by blackducksoftware.

the class ProductDeciderTest method shouldRunBlackDuckOfflineWhenInstallUrl.

@Test
public void shouldRunBlackDuckOfflineWhenInstallUrl() {
    BlackDuckConnectionDetails blackDuckConnectionDetails = blackDuckConnectionDetails(true, null);
    BlackDuckSignatureScannerOptions blackDuckSignatureScannerOptions = blackDuckSignatureScannerOptions(null, VALID_URL);
    BlackDuckDecision productDecision = new ProductDecider().decideBlackDuck(blackDuckConnectionDetails, blackDuckSignatureScannerOptions, BlackduckScanMode.INTELLIGENT, createBdioOptions(false, true));
    Assertions.assertTrue(productDecision.shouldRun());
    Assertions.assertTrue(productDecision.isOffline());
}
Also used : ProductDecider(com.synopsys.integration.detect.lifecycle.boot.decision.ProductDecider) BlackDuckSignatureScannerOptions(com.synopsys.integration.detect.tool.signaturescanner.BlackDuckSignatureScannerOptions) BlackDuckConnectionDetails(com.synopsys.integration.detect.configuration.connection.BlackDuckConnectionDetails) BlackDuckDecision(com.synopsys.integration.detect.lifecycle.boot.decision.BlackDuckDecision) Test(org.junit.jupiter.api.Test)

Aggregations

BlackDuckSignatureScannerOptions (com.synopsys.integration.detect.tool.signaturescanner.BlackDuckSignatureScannerOptions)14 BlackDuckConnectionDetails (com.synopsys.integration.detect.configuration.connection.BlackDuckConnectionDetails)13 BlackDuckDecision (com.synopsys.integration.detect.lifecycle.boot.decision.BlackDuckDecision)13 ProductDecider (com.synopsys.integration.detect.lifecycle.boot.decision.ProductDecider)13 Test (org.junit.jupiter.api.Test)13 Path (java.nio.file.Path)3