use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class GradleReportParserTest method complexTest.
@Test
public void complexTest() throws IOException {
final DetectCodeLocation codeLocation = build("src/test/resources/gradle/parse-tests/complex_dependencyGraph.txt");
final DependencyGraph graph = codeLocation.getDependencyGraph();
assertHasMavenGav(graph, "non-project:with-nested:1.0.0");
assertHasMavenGav(graph, "solo:component:4.12");
assertHasMavenGav(graph, "some.group:child:2.2.2");
assertHasMavenGav(graph, "terminal:child:6.2.3");
assertDoesNotHave(graph, "child-project");
assertDoesNotHave(graph, "nested-parent");
assertDoesNotHave(graph, "spring-webflux");
assertDoesNotHave(graph, "spring-beans");
assertDoesNotHave(graph, "spring-core");
assertDoesNotHave(graph, "spring-web");
assertDoesNotHave(graph, "should-suppress");
assertHasRootMavenGavs(graph, "solo:component:4.12", "non-project:with-nested:1.0.0", "some.group:parent:5.0.0", "terminal:child:6.2.3");
assertParentHasChildMavenGav("some.group:parent:5.0.0", graph, "some.group:child:2.2.2");
}
use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class CocoapodsPackagerTest method complexTest.
@Test
public void complexTest() throws IOException {
final String podlockText = testUtil.getResourceAsUTF8String("/cocoapods/complexPodfile.lock");
final DependencyGraph projectDependencies = podlockParser.extractDependencyGraph(podlockText);
DependencyGraphResourceTestUtil.assertGraph("/cocoapods/complexExpected_graph.json", projectDependencies);
}
use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class GopkgLockParserTest method gopkgParserTest.
@Test
public void gopkgParserTest() throws IOException {
final GopkgLockParser gopkgLockParser = new GopkgLockParser(new ExternalIdFactory());
final String gopkgLockContents = IOUtils.toString(getClass().getResourceAsStream("/go/Gopkg.lock"), StandardCharsets.UTF_8);
final DependencyGraph dependencyGraph = gopkgLockParser.parseDepLock(gopkgLockContents);
Assert.assertNotNull(dependencyGraph);
DependencyGraphResourceTestUtil.assertGraph("/go/Go_GopkgExpected_graph.json", dependencyGraph);
}
use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class CpanListParserTest method makeDependencyNodesTest.
@Test
public void makeDependencyNodesTest() {
final DependencyGraph dependencyGraph = cpanListParser.parse(cpanListText, showDepsText);
DependencyGraphResourceTestUtil.assertGraph("/cpan/expectedDependencyNodes_graph.json", dependencyGraph);
}
use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class GoVendorJsonParserTest method test.
@Test
public void test() throws IOException {
ExternalIdFactory externalIdFactory = new ExternalIdFactory();
GoVendorJsonParser parser = new GoVendorJsonParser(externalIdFactory);
File vendorJsonFile = new File("src/test/resources/go/vendor/vendor.json");
String vendorJsonContents = FileUtils.readFileToString(vendorJsonFile, StandardCharsets.UTF_8);
DependencyGraph graph = parser.parseVendorJson(new Gson(), vendorJsonContents);
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);
}
Aggregations