Search in sources :

Example 1 with PubDepsExtractor

use of com.synopsys.integration.detectable.detectables.dart.pubdep.PubDepsExtractor in project synopsys-detect by blackducksoftware.

the class DetectableFactory method createDartPubDepDetectable.

public DartPubDepDetectable createDartPubDepDetectable(DetectableEnvironment environment, DartPubDepsDetectableOptions dartPubDepsDetectableOptions, DartResolver dartResolver, FlutterResolver flutterResolver) {
    PubDepsParser pubDepsParser = new PubDepsParser();
    PubSpecYamlNameVersionParser pubSpecYamlNameVersionParser = new PubSpecYamlNameVersionParser();
    PubDepsExtractor pubDepsExtractor = new PubDepsExtractor(executableRunner, pubDepsParser, pubSpecYamlNameVersionParser, toolVersionLogger);
    return new DartPubDepDetectable(environment, fileFinder, pubDepsExtractor, dartPubDepsDetectableOptions, dartResolver, flutterResolver);
}
Also used : PubDepsParser(com.synopsys.integration.detectable.detectables.dart.pubdep.PubDepsParser) PubSpecYamlNameVersionParser(com.synopsys.integration.detectable.detectables.dart.PubSpecYamlNameVersionParser) PubDepsExtractor(com.synopsys.integration.detectable.detectables.dart.pubdep.PubDepsExtractor) DartPubDepDetectable(com.synopsys.integration.detectable.detectables.dart.pubdep.DartPubDepDetectable)

Example 2 with PubDepsExtractor

use of com.synopsys.integration.detectable.detectables.dart.pubdep.PubDepsExtractor in project synopsys-detect by blackducksoftware.

the class PubDepsExtractorTest method testGracefulFailure.

private void testGracefulFailure(ExecutableOutput mockExecutableOutput) throws ExecutableRunnerException {
    DetectableExecutableRunner executableRunner = Mockito.mock(DetectableExecutableRunner.class);
    Mockito.when(executableRunner.execute(Mockito.any())).thenReturn(mockExecutableOutput);
    PubDepsExtractor extractor = new PubDepsExtractor(executableRunner, new PubDepsParser(), null, new ToolVersionLogger(executableRunner));
    Extraction extraction = extractor.extract(null, null, null, new DartPubDepsDetectableOptions(EnumListFilter.excludeNone()), null);
    Assertions.assertFalse(extraction.isSuccess() && null == extraction.getError());
}
Also used : PubDepsParser(com.synopsys.integration.detectable.detectables.dart.pubdep.PubDepsParser) DetectableExecutableRunner(com.synopsys.integration.detectable.detectable.executable.DetectableExecutableRunner) DartPubDepsDetectableOptions(com.synopsys.integration.detectable.detectables.dart.pubdep.DartPubDepsDetectableOptions) PubDepsExtractor(com.synopsys.integration.detectable.detectables.dart.pubdep.PubDepsExtractor) Extraction(com.synopsys.integration.detectable.extraction.Extraction) ToolVersionLogger(com.synopsys.integration.detectable.util.ToolVersionLogger)

Aggregations

PubDepsExtractor (com.synopsys.integration.detectable.detectables.dart.pubdep.PubDepsExtractor)2 PubDepsParser (com.synopsys.integration.detectable.detectables.dart.pubdep.PubDepsParser)2 DetectableExecutableRunner (com.synopsys.integration.detectable.detectable.executable.DetectableExecutableRunner)1 PubSpecYamlNameVersionParser (com.synopsys.integration.detectable.detectables.dart.PubSpecYamlNameVersionParser)1 DartPubDepDetectable (com.synopsys.integration.detectable.detectables.dart.pubdep.DartPubDepDetectable)1 DartPubDepsDetectableOptions (com.synopsys.integration.detectable.detectables.dart.pubdep.DartPubDepsDetectableOptions)1 Extraction (com.synopsys.integration.detectable.extraction.Extraction)1 ToolVersionLogger (com.synopsys.integration.detectable.util.ToolVersionLogger)1