Search in sources :

Example 1 with NugetInspectorResolver

use of com.synopsys.integration.detectable.detectable.inspector.nuget.NugetInspectorResolver in project synopsys-detect by blackducksoftware.

the class NugetSolutionDetectableTest method testApplicableForSolution.

@Test
public void testApplicableForSolution() {
    NugetInspectorResolver nugetInspectorManager = null;
    NugetInspectorExtractor nugetInspectorExtractor = null;
    NugetInspectorOptions nugetInspectorOptions = null;
    DetectableEnvironment environment = MockDetectableEnvironment.empty();
    FileFinder fileFinder = MockFileFinder.withFileNamed("test.sln");
    NugetSolutionDetectable detectable = new NugetSolutionDetectable(environment, fileFinder, nugetInspectorManager, nugetInspectorExtractor, nugetInspectorOptions);
    assertTrue(detectable.applicable().getPassed());
}
Also used : NugetInspectorExtractor(com.synopsys.integration.detectable.detectables.nuget.NugetInspectorExtractor) NugetSolutionDetectable(com.synopsys.integration.detectable.detectables.nuget.NugetSolutionDetectable) NugetInspectorResolver(com.synopsys.integration.detectable.detectable.inspector.nuget.NugetInspectorResolver) MockFileFinder(com.synopsys.integration.detectable.util.MockFileFinder) FileFinder(com.synopsys.integration.common.util.finder.FileFinder) NugetInspectorOptions(com.synopsys.integration.detectable.detectables.nuget.NugetInspectorOptions) DetectableEnvironment(com.synopsys.integration.detectable.DetectableEnvironment) MockDetectableEnvironment(com.synopsys.integration.detectable.util.MockDetectableEnvironment) Test(org.junit.jupiter.api.Test)

Example 2 with NugetInspectorResolver

use of com.synopsys.integration.detectable.detectable.inspector.nuget.NugetInspectorResolver in project synopsys-detect by blackducksoftware.

the class DetectorFactory method nugetInspectorResolver.

private NugetInspectorResolver nugetInspectorResolver(DetectInfo detectInfo) throws DetectUserFriendlyException {
    NugetInspectorResolver resolver;
    Optional<File> nugetAirGapPath = airGapInspectorPaths.getNugetInspectorAirGapFile();
    NugetInspectorExecutableLocator executableLocator = new NugetInspectorExecutableLocator(detectInfo);
    if (nugetAirGapPath.isPresent()) {
        resolver = new AirgapNugetInspectorResolver(airGapInspectorPaths, executableLocator, detectInfo);
    } else {
        ArtifactoryNugetInspectorInstaller installer = new ArtifactoryNugetInspectorInstaller(detectInfo, artifactoryZipInstaller, executableLocator);
        resolver = new OnlineNugetInspectorResolver(installer, directoryManager, installedToolManager, installedToolLocator);
    }
    return resolver;
}
Also used : NugetInspectorExecutableLocator(com.synopsys.integration.detect.tool.detector.inspectors.nuget.NugetInspectorExecutableLocator) ArtifactoryNugetInspectorInstaller(com.synopsys.integration.detect.tool.detector.inspectors.nuget.ArtifactoryNugetInspectorInstaller) AirgapNugetInspectorResolver(com.synopsys.integration.detect.tool.detector.inspectors.nuget.AirgapNugetInspectorResolver) OnlineNugetInspectorResolver(com.synopsys.integration.detect.tool.detector.inspectors.nuget.OnlineNugetInspectorResolver) NugetInspectorResolver(com.synopsys.integration.detectable.detectable.inspector.nuget.NugetInspectorResolver) AirgapNugetInspectorResolver(com.synopsys.integration.detect.tool.detector.inspectors.nuget.AirgapNugetInspectorResolver) OnlineNugetInspectorResolver(com.synopsys.integration.detect.tool.detector.inspectors.nuget.OnlineNugetInspectorResolver) File(java.io.File)

Example 3 with NugetInspectorResolver

use of com.synopsys.integration.detectable.detectable.inspector.nuget.NugetInspectorResolver in project synopsys-detect by blackducksoftware.

the class NugetProjectDetectableTest method testApplicableForRproj.

@Test
public void testApplicableForRproj() {
    NugetInspectorOptions nugetInspectorOptions = null;
    NugetInspectorResolver nugetInspectorResolver = null;
    NugetInspectorExtractor nugetInspectorExtractor = null;
    DetectableEnvironment environment = MockDetectableEnvironment.empty();
    FileFinder fileFinder = MockFileFinder.withFileNamed("example.rproj");
    NugetProjectDetectable detectable = new NugetProjectDetectable(environment, fileFinder, nugetInspectorOptions, nugetInspectorResolver, nugetInspectorExtractor);
    assertTrue(detectable.applicable().getPassed());
}
Also used : NugetInspectorExtractor(com.synopsys.integration.detectable.detectables.nuget.NugetInspectorExtractor) NugetProjectDetectable(com.synopsys.integration.detectable.detectables.nuget.NugetProjectDetectable) NugetInspectorResolver(com.synopsys.integration.detectable.detectable.inspector.nuget.NugetInspectorResolver) MockFileFinder(com.synopsys.integration.detectable.util.MockFileFinder) FileFinder(com.synopsys.integration.common.util.finder.FileFinder) NugetInspectorOptions(com.synopsys.integration.detectable.detectables.nuget.NugetInspectorOptions) DetectableEnvironment(com.synopsys.integration.detectable.DetectableEnvironment) MockDetectableEnvironment(com.synopsys.integration.detectable.util.MockDetectableEnvironment) Test(org.junit.jupiter.api.Test)

Example 4 with NugetInspectorResolver

use of com.synopsys.integration.detectable.detectable.inspector.nuget.NugetInspectorResolver in project synopsys-detect by blackducksoftware.

the class NugetSolutionDetectableTest method notApplicableForPodfile.

@Test
public void notApplicableForPodfile() {
    NugetInspectorResolver nugetInspectorManager = null;
    NugetInspectorExtractor nugetInspectorExtractor = null;
    NugetInspectorOptions nugetInspectorOptions = null;
    DetectableEnvironment environment = MockDetectableEnvironment.empty();
    FileFinder fileFinder = MockFileFinder.withFileNamed("podfile.lock");
    NugetSolutionDetectable detectable = new NugetSolutionDetectable(environment, fileFinder, nugetInspectorManager, nugetInspectorExtractor, nugetInspectorOptions);
    assertFalse(detectable.applicable().getPassed());
}
Also used : NugetInspectorExtractor(com.synopsys.integration.detectable.detectables.nuget.NugetInspectorExtractor) NugetSolutionDetectable(com.synopsys.integration.detectable.detectables.nuget.NugetSolutionDetectable) NugetInspectorResolver(com.synopsys.integration.detectable.detectable.inspector.nuget.NugetInspectorResolver) MockFileFinder(com.synopsys.integration.detectable.util.MockFileFinder) FileFinder(com.synopsys.integration.common.util.finder.FileFinder) NugetInspectorOptions(com.synopsys.integration.detectable.detectables.nuget.NugetInspectorOptions) DetectableEnvironment(com.synopsys.integration.detectable.DetectableEnvironment) MockDetectableEnvironment(com.synopsys.integration.detectable.util.MockDetectableEnvironment) Test(org.junit.jupiter.api.Test)

Aggregations

NugetInspectorResolver (com.synopsys.integration.detectable.detectable.inspector.nuget.NugetInspectorResolver)4 FileFinder (com.synopsys.integration.common.util.finder.FileFinder)3 DetectableEnvironment (com.synopsys.integration.detectable.DetectableEnvironment)3 NugetInspectorExtractor (com.synopsys.integration.detectable.detectables.nuget.NugetInspectorExtractor)3 NugetInspectorOptions (com.synopsys.integration.detectable.detectables.nuget.NugetInspectorOptions)3 MockDetectableEnvironment (com.synopsys.integration.detectable.util.MockDetectableEnvironment)3 MockFileFinder (com.synopsys.integration.detectable.util.MockFileFinder)3 Test (org.junit.jupiter.api.Test)3 NugetSolutionDetectable (com.synopsys.integration.detectable.detectables.nuget.NugetSolutionDetectable)2 AirgapNugetInspectorResolver (com.synopsys.integration.detect.tool.detector.inspectors.nuget.AirgapNugetInspectorResolver)1 ArtifactoryNugetInspectorInstaller (com.synopsys.integration.detect.tool.detector.inspectors.nuget.ArtifactoryNugetInspectorInstaller)1 NugetInspectorExecutableLocator (com.synopsys.integration.detect.tool.detector.inspectors.nuget.NugetInspectorExecutableLocator)1 OnlineNugetInspectorResolver (com.synopsys.integration.detect.tool.detector.inspectors.nuget.OnlineNugetInspectorResolver)1 NugetProjectDetectable (com.synopsys.integration.detectable.detectables.nuget.NugetProjectDetectable)1 File (java.io.File)1