use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class GradleInspectorDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertEquals(1, extraction.getCodeLocations().size());
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.MAVEN, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootSize(1);
ExternalIdFactory externalIdFactory = new ExternalIdFactory();
ExternalId hubCommonExternalId = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "hub-common", "11.0.0-SNAPSHOT");
ExternalId hubCommonRestExternalId = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "hub-common-rest", "1.0.0");
ExternalId integrationCommonExternalId = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "integration-common", "5.2.1");
ExternalId slf4jExternalId = externalIdFactory.createMavenExternalId("org.slf4j", "slf4j-api", "1.7.22");
ExternalId commonsIoExternalId = externalIdFactory.createMavenExternalId("commons-io", "commons-io", "2.5");
ExternalId commonsCodecExternalId = externalIdFactory.createMavenExternalId("commons-codec", "commons-codec", "1.10");
ExternalId commonsLangExternalId = externalIdFactory.createMavenExternalId("org.apache.commons", "commons-lang3", "3.5");
graphAssert.hasParentChildRelationship(hubCommonExternalId, hubCommonRestExternalId);
graphAssert.hasParentChildRelationship(hubCommonRestExternalId, integrationCommonExternalId);
graphAssert.hasParentChildRelationship(integrationCommonExternalId, slf4jExternalId);
graphAssert.hasParentChildRelationship(integrationCommonExternalId, commonsIoExternalId);
graphAssert.hasParentChildRelationship(integrationCommonExternalId, commonsCodecExternalId);
graphAssert.hasParentChildRelationship(integrationCommonExternalId, commonsLangExternalId);
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class IvyParseDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertEquals(1, extraction.getCodeLocations().size(), "A code location should have been generated.");
Assertions.assertEquals("pmdungeon", extraction.getProjectName());
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.MAVEN, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootSize(3);
ExternalIdFactory externalIdFactory = new ExternalIdFactory();
ExternalId gson = externalIdFactory.createMavenExternalId("com.google.code.gson", "gson", "1.0");
ExternalId gdxUi = externalIdFactory.createMavenExternalId("com.badlogicgames.gdx", "gdx-ui", "2.0");
ExternalId gdxBackend = externalIdFactory.createMavenExternalId("com.badlogicgames.gdx", "gdx-backend", "3.0");
graphAssert.hasRootDependency(gson);
graphAssert.hasRootDependency(gdxUi);
graphAssert.hasRootDependency(gdxBackend);
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class LernaDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertEquals(Extraction.ExtractionResultType.SUCCESS, extraction.getResult(), "Extraction should have been a success.");
Assertions.assertEquals(2, extraction.getCodeLocations().size(), "Expected one code location from root, and one from a non-private package.");
NameVersionGraphAssert rootGraphAssert = new NameVersionGraphAssert(Forge.NPMJS, extraction.getCodeLocations().get(0).getDependencyGraph());
rootGraphAssert.hasRootSize(3);
rootGraphAssert.hasRootDependency("brace-expansion", "1.1.8");
rootGraphAssert.hasRootDependency("concat-map", "0.0.1");
rootGraphAssert.hasRootDependency("peer-example", "1.0.0");
NameVersionGraphAssert packageAGraphAssert = new NameVersionGraphAssert(Forge.NPMJS, extraction.getCodeLocations().get(1).getDependencyGraph());
packageAGraphAssert.hasRootSize(1);
packageAGraphAssert.hasRootDependency("brace-expansion", "1.1.8");
packageAGraphAssert.hasDependency("balanced-match", "1.0.0");
packageAGraphAssert.hasDependency("concat-map", "0.0.1");
packageAGraphAssert.hasNoDependency("peer-example", "1.0.0");
packageAGraphAssert.hasParentChildRelationship("brace-expansion", "1.1.8", "balanced-match", "1.0.0");
packageAGraphAssert.hasParentChildRelationship("brace-expansion", "1.1.8", "concat-map", "0.0.1");
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class GoDepCliDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertEquals(1, extraction.getCodeLocations().size());
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.GOLANG, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootSize(3);
graphAssert.hasRootDependency("github.com/davecgh/go-spew/spew", "v1.1.0");
graphAssert.hasRootDependency("github.com/golang/protobuf/proto", null);
graphAssert.hasRootDependency("github.com/gorilla/context", "v1.1");
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class GoGradleDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertEquals(1, extraction.getCodeLocations().size());
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.GOLANG, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootSize(2);
graphAssert.hasRootDependency("github.com/golang/example", "0dea2d0bf90754ffa40e0cb2f23b638f3e3d7e09");
graphAssert.hasRootDependency("crypto", "9756ffdc24725223350eb3266ffb92590d28f278");
}
Aggregations