use of com.synopsys.integration.detectable.detectables.dart.pubspec.PubSpecLockParser in project synopsys-detect by blackducksoftware.
the class DetectableFactory method createDartPubSpecLockDetectable.
public DartPubSpecLockDetectable createDartPubSpecLockDetectable(DetectableEnvironment environment) {
PubSpecLockParser pubSpecLockParser = new PubSpecLockParser();
PubSpecYamlNameVersionParser pubSpecYamlNameVersionParser = new PubSpecYamlNameVersionParser();
PubSpecExtractor pubSpecExtractor = new PubSpecExtractor(pubSpecLockParser, pubSpecYamlNameVersionParser);
return new DartPubSpecLockDetectable(environment, fileFinder, pubSpecExtractor);
}
use of com.synopsys.integration.detectable.detectables.dart.pubspec.PubSpecLockParser in project synopsys-detect by blackducksoftware.
the class PubSpecLockParserTest method test.
@Test
public void test() {
List<String> pubSpecLockLines = Arrays.asList("# Generated by pub", "# See https://dart.dev/tools/pub/glossary#lockfile", "packages:", " async:", " dependency: transitive", " description:", " name: async", " source: hosted", " version: \"2.6.1\"", " boolean_selector:", " dependency: transitive", " description:", " name: boolean_selector", " url: \"https://pub.dartlang.org\"", " version: \"2.1.0\"", " characters:", " description:", " name: characters", " version: \"1.1.0\"");
PubSpecLockParser pubSpecLockParser = new PubSpecLockParser();
DependencyGraph dependencyGraph = pubSpecLockParser.parse(pubSpecLockLines);
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.DART, dependencyGraph);
graphAssert.hasRootSize(3);
graphAssert.hasRootDependency("async", "2.6.1");
graphAssert.hasRootDependency("boolean_selector", "2.1.0");
graphAssert.hasRootDependency("characters", "1.1.0");
}
Aggregations