Search in sources :

Example 1 with FileFinder

use of com.synopsys.integration.common.util.finder.FileFinder in project synopsys-detect by blackducksoftware.

the class XcodeWorkspaceDetectable method extractable.

@Override
public DetectableResult extractable() {
    Requirements requirements = new Requirements(fileFinder, environment);
    File swiftPMDirectory = workspaceDirectory.toPath().resolve("xcshareddata/swiftpm").toFile();
    requirements.anyFile(new SearchPattern(swiftPMDirectory, "Package.resolved", packageResolvedFile -> foundPackageResolvedFile = packageResolvedFile), new SearchPattern(workspaceDirectory, "contents.xcworkspacedata", workspaceDataFile -> foundWorkspaceDataFile = workspaceDataFile));
    return requirements.result();
}
Also used : DetectableResult(com.synopsys.integration.detectable.detectable.result.DetectableResult) PackageResolvedResult(com.synopsys.integration.detectable.detectables.swift.lock.model.PackageResolvedResult) Extraction(com.synopsys.integration.detectable.extraction.Extraction) XcodeWorkspaceResult(com.synopsys.integration.detectable.detectables.xcode.model.XcodeWorkspaceResult) IOException(java.io.IOException) FileFinder(com.synopsys.integration.common.util.finder.FileFinder) SearchPattern(com.synopsys.integration.detectable.detectable.SearchPattern) File(java.io.File) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) DetectableInfo(com.synopsys.integration.detectable.detectable.annotation.DetectableInfo) CodeLocation(com.synopsys.integration.detectable.detectable.codelocation.CodeLocation) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) Requirements(com.synopsys.integration.detectable.detectable.Requirements) ExtractionEnvironment(com.synopsys.integration.detectable.extraction.ExtractionEnvironment) Detectable(com.synopsys.integration.detectable.Detectable) SAXException(org.xml.sax.SAXException) FailedDetectableResult(com.synopsys.integration.detectable.detectable.result.FailedDetectableResult) Optional(java.util.Optional) DetectableEnvironment(com.synopsys.integration.detectable.DetectableEnvironment) PackageResolvedExtractor(com.synopsys.integration.detectable.detectables.swift.lock.PackageResolvedExtractor) LinkedList(java.util.LinkedList) SearchPattern(com.synopsys.integration.detectable.detectable.SearchPattern) File(java.io.File) Requirements(com.synopsys.integration.detectable.detectable.Requirements)

Example 2 with FileFinder

use of com.synopsys.integration.common.util.finder.FileFinder 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 3 with FileFinder

use of com.synopsys.integration.common.util.finder.FileFinder in project synopsys-detect by blackducksoftware.

the class ComposerLockDetectableTest method testApplicable.

@Test
public void testApplicable() {
    ComposerLockExtractor composerLockExtractor = null;
    DetectableEnvironment environment = MockDetectableEnvironment.empty();
    FileFinder fileFinder = MockFileFinder.withFilesNamed("composer.lock", "composer.json");
    ComposerLockDetectable detectable = new ComposerLockDetectable(environment, fileFinder, composerLockExtractor);
    assertTrue(detectable.applicable().getPassed());
}
Also used : MockFileFinder(com.synopsys.integration.detectable.util.MockFileFinder) FileFinder(com.synopsys.integration.common.util.finder.FileFinder) ComposerLockExtractor(com.synopsys.integration.detectable.detectables.packagist.ComposerLockExtractor) DetectableEnvironment(com.synopsys.integration.detectable.DetectableEnvironment) MockDetectableEnvironment(com.synopsys.integration.detectable.util.MockDetectableEnvironment) ComposerLockDetectable(com.synopsys.integration.detectable.detectables.packagist.ComposerLockDetectable) Test(org.junit.jupiter.api.Test)

Example 4 with FileFinder

use of com.synopsys.integration.common.util.finder.FileFinder in project synopsys-detect by blackducksoftware.

the class GemspecParseDetectableTest method testApplicable.

@Test
public void testApplicable() {
    GemspecParseExtractor gemspecParseExtractor = null;
    GemspecParseDetectableOptions gemspecParseDetectableOptions = null;
    DetectableEnvironment environment = MockDetectableEnvironment.empty();
    FileFinder fileFinder = MockFileFinder.withFileNamed("test.gemspec");
    GemspecParseDetectable detectable = new GemspecParseDetectable(environment, fileFinder, gemspecParseExtractor);
    assertTrue(detectable.applicable().getPassed());
}
Also used : GemspecParseDetectable(com.synopsys.integration.detectable.detectables.rubygems.gemspec.GemspecParseDetectable) MockFileFinder(com.synopsys.integration.detectable.util.MockFileFinder) FileFinder(com.synopsys.integration.common.util.finder.FileFinder) GemspecParseExtractor(com.synopsys.integration.detectable.detectables.rubygems.gemspec.GemspecParseExtractor) DetectableEnvironment(com.synopsys.integration.detectable.DetectableEnvironment) MockDetectableEnvironment(com.synopsys.integration.detectable.util.MockDetectableEnvironment) GemspecParseDetectableOptions(com.synopsys.integration.detectable.detectables.rubygems.gemspec.GemspecParseDetectableOptions) Test(org.junit.jupiter.api.Test)

Example 5 with FileFinder

use of com.synopsys.integration.common.util.finder.FileFinder in project synopsys-detect by blackducksoftware.

the class NpmPackageJsonParseDetectableTest method testApplicable.

@Test
public void testApplicable() {
    DetectableEnvironment environment = MockDetectableEnvironment.empty();
    FileFinder fileFinder = MockFileFinder.withFileNamed(PACKAGE_JSON_FILENAME);
    EnumListFilter<NpmDependencyType> npmDependencyTypeFilter = EnumListFilter.fromExcluded(NpmDependencyType.DEV, NpmDependencyType.PEER);
    NpmPackageJsonParseDetectableOptions npmPackageJsonParseDetectableOptions = new NpmPackageJsonParseDetectableOptions(npmDependencyTypeFilter);
    NpmPackageJsonParseDetectable detectable = new NpmPackageJsonParseDetectable(environment, fileFinder, null);
    assertTrue(detectable.applicable().getPassed());
}
Also used : NpmPackageJsonParseDetectableOptions(com.synopsys.integration.detectable.detectables.npm.packagejson.NpmPackageJsonParseDetectableOptions) MockFileFinder(com.synopsys.integration.detectable.util.MockFileFinder) FileFinder(com.synopsys.integration.common.util.finder.FileFinder) NpmDependencyType(com.synopsys.integration.detectable.detectables.npm.NpmDependencyType) DetectableEnvironment(com.synopsys.integration.detectable.DetectableEnvironment) MockDetectableEnvironment(com.synopsys.integration.detectable.util.MockDetectableEnvironment) NpmPackageJsonParseDetectable(com.synopsys.integration.detectable.detectables.npm.packagejson.NpmPackageJsonParseDetectable) Test(org.junit.jupiter.api.Test)

Aggregations

FileFinder (com.synopsys.integration.common.util.finder.FileFinder)15 DetectableEnvironment (com.synopsys.integration.detectable.DetectableEnvironment)12 Test (org.junit.jupiter.api.Test)12 MockDetectableEnvironment (com.synopsys.integration.detectable.util.MockDetectableEnvironment)9 MockFileFinder (com.synopsys.integration.detectable.util.MockFileFinder)8 File (java.io.File)6 NugetInspectorResolver (com.synopsys.integration.detectable.detectable.inspector.nuget.NugetInspectorResolver)3 NugetInspectorExtractor (com.synopsys.integration.detectable.detectables.nuget.NugetInspectorExtractor)3 NugetInspectorOptions (com.synopsys.integration.detectable.detectables.nuget.NugetInspectorOptions)3 SimpleFileFinder (com.synopsys.integration.common.util.finder.SimpleFileFinder)2 DetectableExecutableRunner (com.synopsys.integration.detectable.detectable.executable.DetectableExecutableRunner)2 DetectableResult (com.synopsys.integration.detectable.detectable.result.DetectableResult)2 DockerExtractor (com.synopsys.integration.detectable.detectables.docker.DockerExtractor)2 NugetSolutionDetectable (com.synopsys.integration.detectable.detectables.nuget.NugetSolutionDetectable)2 Gson (com.google.gson.Gson)1 DetectInfo (com.synopsys.integration.detect.configuration.DetectInfo)1 DetectBootResult (com.synopsys.integration.detect.lifecycle.boot.DetectBootResult)1 ExitManager (com.synopsys.integration.detect.lifecycle.exit.ExitManager)1 ProductRunData (com.synopsys.integration.detect.lifecycle.run.data.ProductRunData)1 ExceptionUtility (com.synopsys.integration.detect.lifecycle.shutdown.ExceptionUtility)1