use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class RebarParserTest method testParseRebarTreeOutput.
@Test
public void testParseRebarTreeOutput() {
final MutableMapDependencyGraph expectedGraph = new MutableMapDependencyGraph();
final Dependency gitInnerParentDependency = buildDependency("git_inner_parent_dependency", "0.0.2");
final Dependency hexInnerChildDependency = buildDependency("hex_inner_child_dependency", "0.3.0");
final Dependency hexGrandchildDependency = buildDependency("hex_grandchild_dependency", "4.0.0");
final Dependency gitInnerChildDependency = buildDependency("git_inner_child_dependency", "0.5.0");
final Dependency gitGrandchildDependency = buildDependency("git_grandchild_dependency", "6.0.0");
final Dependency gitOuterParentDependency = buildDependency("git_outer_parent_dependency", "0.0.7");
final Dependency gitOuterChildDependency = buildDependency("git_outer_child_dependency", "0.8.0");
expectedGraph.addChildrenToRoot(gitInnerParentDependency, gitOuterParentDependency);
expectedGraph.addChildWithParent(hexInnerChildDependency, gitInnerParentDependency);
expectedGraph.addChildWithParents(hexGrandchildDependency, hexInnerChildDependency);
expectedGraph.addChildWithParent(gitInnerChildDependency, gitInnerParentDependency);
expectedGraph.addChildWithParents(gitGrandchildDependency, gitInnerChildDependency);
expectedGraph.addChildWithParents(gitOuterChildDependency, gitOuterParentDependency);
final DetectCodeLocation codeLocation = build("/hex/dependencyTree.txt");
final DependencyGraph actualGraph = codeLocation.getDependencyGraph();
assertGraph(expectedGraph, actualGraph);
}
use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class PearDependencyTest method createPearDependencyNodeFromListTest.
@Test
public void createPearDependencyNodeFromListTest() {
final String installedPackages = testUtil.getResourceAsUTF8String("/pear/installed-packages.txt");
final ExecutableOutput exeOutput = new ExecutableOutput(installedPackages, "");
final List<String> dependencyNames = Arrays.asList("Archive_Tar", "Console_Getopt", "Structures_Graph");
final DependencyGraph actual = pearParser.createPearDependencyGraphFromList(exeOutput.getStandardOutputAsList(), dependencyNames);
DependencyGraphResourceTestUtil.assertGraph("/pear/dependency-node-list_graph.json", actual);
}
use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class RubygemsNodePackagerTest method findsAllVersions.
@Test
public void findsAllVersions() {
// Finds all versions of the package not just the first matching architecture.
final List<String> actualText = Arrays.asList(testUtils.getResourceAsUTF8String("/rubygems/Gemfile-rails.lock").split("\n"));
final GemlockParser rubygemsNodePackager = new GemlockParser(new ExternalIdFactory());
final DependencyGraph graph = rubygemsNodePackager.parseProjectDependencies(actualText);
assertNoDependency("nokogiri", "", graph);
assertDependency("nokogiri", "1.8.2", graph);
assertDependency("nokogiri", "1.8.2-java", graph);
assertDependency("nokogiri", "1.8.2-x86-mingw32", graph);
}
use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class RubygemsNodePackagerTest method packagerTest.
@Test
public void packagerTest() {
final List<String> actualText = Arrays.asList(testUtils.getResourceAsUTF8String("/rubygems/Gemfile.lock").split("\n"));
final GemlockParser rubygemsNodePackager = new GemlockParser(new ExternalIdFactory());
final DependencyGraph projects = rubygemsNodePackager.parseProjectDependencies(actualText);
Assert.assertEquals(8, projects.getRootDependencies().size());
DependencyGraphResourceTestUtil.assertGraph("/rubygems/expectedPackager_graph.json", projects);
}
use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class VndrParserTest method vndrParserTest.
@Test
public void vndrParserTest() throws IOException {
final TestUtil testUtil = new TestUtil();
final VndrParser vndrParser = new VndrParser(new ExternalIdFactory());
final String text = testUtil.getResourceAsUTF8String("/go/vendor.conf");
final List<String> vendorConfContents = Arrays.asList(text.split("\r?\n"));
final DependencyGraph dependencyGraph = vndrParser.parseVendorConf(vendorConfContents);
Assert.assertNotNull(dependencyGraph);
DependencyGraphResourceTestUtil.assertGraph("/go/Go_VndrExpected_graph.json", dependencyGraph);
}
Aggregations