use of com.synopsys.integration.detectable.detectables.yarn.parse.entry.YarnLockEntryParser in project synopsys-detect by blackducksoftware.
the class YarnLockParserFunctionalTest method testV1Lockfile.
@Test
void testV1Lockfile() throws IOException {
File lockfile = FunctionalTestFiles.asFile("/yarn/lockfilev1/yarn.lock");
List<String> yarnLockLines = FileUtils.readLines(lockfile, StandardCharsets.UTF_8);
Assertions.assertTrue(lockfile.exists());
YarnLockLineAnalyzer yarnLockLineAnalyzer = new YarnLockLineAnalyzer();
YarnLockDependencySpecParser yarnLockDependencySpecParser = new YarnLockDependencySpecParser(yarnLockLineAnalyzer);
YarnLockEntrySectionParserSet yarnLockEntryElementParser = new YarnLockEntrySectionParserSet(yarnLockLineAnalyzer, yarnLockDependencySpecParser);
YarnLockEntryParser yarnLockEntryParser = new YarnLockEntryParser(yarnLockLineAnalyzer, yarnLockEntryElementParser);
YarnLockParser yarnLockParser = new YarnLockParser(yarnLockEntryParser);
YarnLock yarnLock = yarnLockParser.parseYarnLock(yarnLockLines);
Assertions.assertEquals(4238, yarnLock.getEntries().size());
Assertions.assertEquals("zwitch", yarnLock.getEntries().get(4237).getIds().get(0).getName());
Assertions.assertEquals("^1.0.0", yarnLock.getEntries().get(4237).getIds().get(0).getVersion());
}
use of com.synopsys.integration.detectable.detectables.yarn.parse.entry.YarnLockEntryParser in project synopsys-detect by blackducksoftware.
the class YarnLockParserTest method createYarnLockParser.
@NotNull
private YarnLockParser createYarnLockParser() {
YarnLockLineAnalyzer lineAnalyzer = new YarnLockLineAnalyzer();
YarnLockDependencySpecParser yarnLockDependencySpecParser = new YarnLockDependencySpecParser(lineAnalyzer);
YarnLockEntrySectionParserSet yarnLockEntryElementParser = new YarnLockEntrySectionParserSet(lineAnalyzer, yarnLockDependencySpecParser);
YarnLockEntryParser entryParser = new YarnLockEntryParser(lineAnalyzer, yarnLockEntryElementParser);
YarnLockParser yarnLockParser = new YarnLockParser(entryParser);
return yarnLockParser;
}
use of com.synopsys.integration.detectable.detectables.yarn.parse.entry.YarnLockEntryParser in project synopsys-detect by blackducksoftware.
the class DetectableFactory method yarnLockParser.
private YarnLockParser yarnLockParser() {
YarnLockLineAnalyzer yarnLockLineAnalyzer = new YarnLockLineAnalyzer();
YarnLockDependencySpecParser yarnLockDependencySpecParser = new YarnLockDependencySpecParser(yarnLockLineAnalyzer);
YarnLockEntrySectionParserSet yarnLockEntryElementParser = new YarnLockEntrySectionParserSet(yarnLockLineAnalyzer, yarnLockDependencySpecParser);
YarnLockEntryParser yarnLockEntryParser = new YarnLockEntryParser(yarnLockLineAnalyzer, yarnLockEntryElementParser);
return new YarnLockParser(yarnLockEntryParser);
}
Aggregations