use of com.synopsys.integration.detectable.detectables.dart.pubdep.PubDepsParser 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);
}
use of com.synopsys.integration.detectable.detectables.dart.pubdep.PubDepsParser 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());
}
use of com.synopsys.integration.detectable.detectables.dart.pubdep.PubDepsParser in project synopsys-detect by blackducksoftware.
the class PubDepsParserTest method test.
@Test
public void test() {
List<String> pubDepsLines = FunctionalTestFiles.asListOfStrings("/dart/pubDeps.txt");
PubDepsParser pubDepsParser = new PubDepsParser();
DependencyGraph dependencyGraph = pubDepsParser.parse(pubDepsLines);
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.DART, dependencyGraph);
graphAssert.hasRootSize(4);
graphAssert.hasRootDependency("charcode", "1.1.3");
graphAssert.hasRootDependency("pedantic", "1.9.2");
graphAssert.hasRootDependency("test", "1.15.3");
graphAssert.hasRootDependency("typed_data", "1.2.0");
graphAssert.hasParentChildRelationship("analyzer", "0.39.17", "_fe_analyzer_shared", "7.0.0");
graphAssert.hasParentChildRelationship("glob", "1.2.0", "node_io", "1.1.1");
graphAssert.hasParentChildRelationship("node_interop", "1.1.1", "js", "1.1.0");
graphAssert.hasParentChildRelationship("js", "1.1.0", "async", "2.2.1");
graphAssert.hasParentChildRelationship("async", "2.2.1", "charcode", "1.1.3");
graphAssert.hasParentChildRelationship("typed_data", "1.2.0", "webkit_inspection_protocol", "0.7.3");
}
Aggregations