use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class NpmLockDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertEquals(1, extraction.getCodeLocations().size(), "A code location should have been generated.");
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.NPMJS, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootSize(4);
graphAssert.hasRootDependency("peer-example", "1.0.0");
graphAssert.hasRootDependency("brace-expansion", "1.1.8");
graphAssert.hasRootDependency("balanced-match", "1.0.0");
graphAssert.hasRootDependency("concat-map", "0.0.1");
graphAssert.hasParentChildRelationship("brace-expansion", "1.1.8", "balanced-match", "1.0.0");
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class NpmShrinkwrapDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertEquals(1, extraction.getCodeLocations().size(), "A code location should have been generated.");
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.NPMJS, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootSize(6);
graphAssert.hasRootDependency("abbrev", "1.0.9");
graphAssert.hasRootDependency("accepts", "1.3.3");
graphAssert.hasRootDependency("mime-types", "https://registry.npmjs.org/mime-types/-/mime-types-2.1.13.tgz");
graphAssert.hasRootDependency("mime-db", "https://registry.npmjs.org/mime-db/-/mime-db-1.25.0.tgz");
graphAssert.hasRootDependency("negotiator", "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz");
graphAssert.hasRootDependency("peer-example", "1.0.0");
graphAssert.hasParentChildRelationship("accepts", "1.3.3", "mime-types", "https://registry.npmjs.org/mime-types/-/mime-types-2.1.13.tgz");
graphAssert.hasParentChildRelationship("mime-types", "https://registry.npmjs.org/mime-types/-/mime-types-2.1.13.tgz", "mime-db", "https://registry.npmjs.org/mime-db/-/mime-db-1.25.0.tgz");
graphAssert.hasParentChildRelationship("accepts", "1.3.3", "negotiator", "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz");
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class MavenParseDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertEquals(1, extraction.getCodeLocations().size(), "A code location should have been generated.");
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.MAVEN, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootSize(2);
ExternalIdFactory externalIdFactory = new ExternalIdFactory();
ExternalId commonsIo = externalIdFactory.createMavenExternalId("commons-io", "commons-io", "2.6");
ExternalId hubCommon = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "hub-common", "1.1.0");
graphAssert.hasRootDependency(commonsIo);
graphAssert.hasRootDependency(hubCommon);
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class MavenCorruptOutputTest method test.
@Test
public void test() {
ExternalIdFactory externalIdFactory = new ExternalIdFactory();
MavenCodeLocationPackager packager = new MavenCodeLocationPackager(externalIdFactory);
List<MavenParseResult> results = packager.extractCodeLocations("", getInput(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.MAVEN, results.get(0).getCodeLocation().getDependencyGraph());
graphAssert.hasRootSize(1);
ExternalId hubCommon = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "hub-common", "13.1.2");
ExternalId integrationCommon = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "integration-common", "6.0.2");
ExternalId hubCommonRest = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "hub-common-rest", "2.1.3");
graphAssert.hasRootDependency(hubCommon);
graphAssert.hasParentChildRelationship(hubCommonRest, integrationCommon);
graphAssert.hasParentChildRelationship(hubCommon, hubCommonRest);
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class PearCliDetectableTest 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.PEAR, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootSize(2);
graphAssert.hasRootDependency("PHP", "7.1.0");
graphAssert.hasRootDependency("PearInstaller", "1.10.1");
}
Aggregations