use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class CondaListParserTest method largeParseTest.
@Test
public void largeParseTest() {
final String condaInfoJson = testUtil.getResourceAsUTF8String("/conda/condaInfo.json");
final String condaListJson = testUtil.getResourceAsUTF8String("/conda/condaListLarge.json");
final DependencyGraph dependencyGraph = condaListParser.parse(condaListJson, condaInfoJson);
DependencyGraphResourceTestUtil.assertGraph("/conda/condaListLargeExpected_graph.json", dependencyGraph);
}
use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class CondaListParserTest method smallParseTest.
@Test
public void smallParseTest() {
final String condaInfoJson = testUtil.getResourceAsUTF8String("/conda/condaInfo.json");
final String condaListJson = testUtil.getResourceAsUTF8String("/conda/condaListSmall.json");
final DependencyGraph dependencyGraph = condaListParser.parse(condaListJson, condaInfoJson);
DependencyGraphResourceTestUtil.assertGraph("/conda/condaListSmallExpected_graph.json", dependencyGraph);
}
use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class GoVendorExtractorTest method test.
@Test
public void test() {
GoVendorExtractor extractor = new GoVendorExtractor(new Gson(), new ExternalIdFactory());
Extraction extraction = extractor.extract(new File("src/test/resources/go"), new File("src/test/resources/go/vendor/vendor.json"));
DependencyGraph graph = extraction.codeLocations.get(0).getDependencyGraph();
assertEquals(2, graph.getRootDependencies().size());
boolean foundErrorsPkg = false;
boolean foundMathPkg = false;
for (Dependency dep : graph.getRootDependencies()) {
if ("github.com/pkg/errors".equals(dep.name)) {
foundErrorsPkg = true;
assertEquals("github.com/pkg/errors", dep.externalId.name);
assertEquals("059132a15dd08d6704c67711dae0cf35ab991756", dep.externalId.version);
}
if ("github.com/pkg/math".equals(dep.name)) {
foundMathPkg = true;
assertEquals("github.com/pkg/math", dep.externalId.name);
assertEquals("f2ed9e40e245cdeec72c4b642d27ed4553f90667", dep.externalId.version);
}
}
assertTrue(foundErrorsPkg);
assertTrue(foundMathPkg);
}
use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class GemlockNodeParserTest method testParsingGemfileLock.
@Test
public void testParsingGemfileLock() {
final String text = testUtils.getResourceAsUTF8String("/rubygems/Gemfile.lock");
final List<String> gemfileLockContents = Arrays.asList(text.split("\n"));
final GemlockParser gemlockNodeParser = new GemlockParser(new ExternalIdFactory());
final DependencyGraph dependencyGraph = gemlockNodeParser.parseProjectDependencies(gemfileLockContents);
DependencyGraphResourceTestUtil.assertGraph("/rubygems/expectedParser_graph.json", dependencyGraph);
}
use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class GemlockNodeParserTest method testParsingSmallGemfileLock.
@Test
public void testParsingSmallGemfileLock() {
final String text = testUtils.getResourceAsUTF8String("/rubygems/small_gemfile_lock");
final List<String> gemfileLockContents = Arrays.asList(text.split("\n"));
final GemlockParser gemlockNodeParser = new GemlockParser(new ExternalIdFactory());
final DependencyGraph dependencyGraph = gemlockNodeParser.parseProjectDependencies(gemfileLockContents);
DependencyGraphResourceTestUtil.assertGraph("/rubygems/expectedSmallParser_graph.json", dependencyGraph);
}
Aggregations