use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class CpanCliDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertEquals(1, extraction.getCodeLocations().size());
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.CPAN, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootSize(3);
graphAssert.hasRootDependency("Test-More", "1.3");
graphAssert.hasRootDependency("ExtUtils-MakeMaker", "7.24");
graphAssert.hasRootDependency("perl", "5.1");
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class PackratLockDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertEquals(1, extraction.getCodeLocations().size());
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.CRAN, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootSize(3);
graphAssert.hasRootDependency("BBmisc", "1.11");
graphAssert.hasRootDependency("checkmate", "1.8.5");
graphAssert.hasRootDependency("backports", "1.1.2");
graphAssert.hasParentChildRelationship("BBmisc", "1.11", "checkmate", "1.8.5");
graphAssert.hasParentChildRelationship("checkmate", "1.8.5", "backports", "1.1.2");
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class DartPubSpecLockDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertNotEquals(0, extraction.getCodeLocations().size(), "A code location should have been generated.");
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.DART, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootSize(3);
graphAssert.hasRootDependency("clock", "1.1.0");
graphAssert.hasRootDependency("collection", "1.15.0");
graphAssert.hasRootDependency("contacts_service", "0.4.6");
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class SwiftDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertNotEquals(0, extraction.getCodeLocations().size());
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.COCOAPODS, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootSize(2);
graphAssert.hasRootDependency("FisherYates", "2.0.5");
graphAssert.hasRootDependency("PlayingCard", "3.0.5");
graphAssert.hasParentChildRelationship("PlayingCard", "3.0.5", "GenericLibrary", "1.0.1");
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class PipenvTransformerTest method ignoresNonProject.
@Test
void ignoresNonProject() {
PipFreeze pipFreeze = new PipFreeze(new ArrayList<>());
List<PipenvGraphEntry> pipenvGraphEntries = new ArrayList<>();
pipenvGraphEntries.add(new PipenvGraphEntry("projectName", "projectVersion", Collections.singletonList(new PipenvGraphDependency("child", "childVersion", Collections.emptyList()))));
pipenvGraphEntries.add(new PipenvGraphEntry("non-projectName", "non-projectVersion", new ArrayList<>()));
PipenvGraph pipenvGraph = new PipenvGraph(pipenvGraphEntries);
PipenvTransformer pipenvTransformer = new PipenvTransformer(new ExternalIdFactory());
CodeLocation codeLocation = pipenvTransformer.transform("projectName", "projectVersion", pipFreeze, pipenvGraph, true);
DependencyGraph graph = codeLocation.getDependencyGraph();
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.PYPI, graph);
graphAssert.hasRootDependency("child", "childVersion");
graphAssert.hasNoDependency("non-projectName", "non-projectVersion");
}
Aggregations