use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class SwiftPackageResolvedDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
assertEquals(1, extraction.getCodeLocations().size(), "Expected only one code location.");
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.GITHUB, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootDependency("apple/swift-argument-parser", "1.0.1");
graphAssert.hasRootDependency("auth0/Auth0.swift", "1.35.0");
graphAssert.hasRootDependency("mac-cain13/R.swift.Library", "5.4.0");
graphAssert.hasNoDependency("invalid/url", "1.2.3");
graphAssert.hasRootSize(3);
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class XcodeProjectDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
assertEquals(1, extraction.getCodeLocations().size(), "Expected only one code location.");
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.GITHUB, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootDependency("apple/swift-argument-parser", "1.0.1");
graphAssert.hasRootDependency("auth0/Auth0.swift", "1.35.0");
graphAssert.hasRootDependency("mac-cain13/R.swift.Library", "5.4.0");
graphAssert.hasNoDependency("invalid/url", "1.2.3");
graphAssert.hasRootSize(3);
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class XcodeWorkspaceDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
assertEquals(3, extraction.getCodeLocations().size(), "Expected 1 code location from local and 2 defined in the workspace data file.");
NameVersionGraphAssert graphAssert;
CodeLocation workspaceLocalCodeLocation = extraction.getCodeLocations().get(0);
graphAssert = new NameVersionGraphAssert(Forge.GITHUB, workspaceLocalCodeLocation.getDependencyGraph());
graphAssert.hasRootDependency("apple/swift-argument-parser", "1.0.1");
graphAssert.hasNoDependency("invalid/url", "1.2.3");
graphAssert.hasRootSize(1);
CodeLocation myLibraryCodeLocation = extraction.getCodeLocations().get(1);
graphAssert = new NameVersionGraphAssert(Forge.GITHUB, myLibraryCodeLocation.getDependencyGraph());
graphAssert.hasRootDependency("auth0/Auth0.swift", "1.35.0");
graphAssert.hasRootSize(1);
CodeLocation xcodeProjectCodeLocation = extraction.getCodeLocations().get(2);
graphAssert = new NameVersionGraphAssert(Forge.GITHUB, xcodeProjectCodeLocation.getDependencyGraph());
graphAssert.hasRootDependency("mac-cain13/R.swift.Library", "5.4.0");
graphAssert.hasRootSize(1);
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class YarnLockDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertEquals(1, extraction.getCodeLocations().size());
CodeLocation codeLocation = extraction.getCodeLocations().get(0);
Assertions.assertEquals("babel", extraction.getProjectName());
Assertions.assertEquals("1.2.3", extraction.getProjectVersion());
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.NPMJS, codeLocation.getDependencyGraph());
graphAssert.hasRootSize(2);
graphAssert.hasRootDependency("async", "2.5.0");
graphAssert.hasRootDependency("lodash", "4.17.4");
graphAssert.hasParentChildRelationship("async", "2.5.0", "lodash", "4.17.4");
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class PipEnvDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertEquals("simple", extraction.getProjectName());
Assertions.assertEquals("1", extraction.getProjectVersion());
Assertions.assertEquals(1, extraction.getCodeLocations().size());
DependencyGraph dependencyGraph = extraction.getCodeLocations().get(0).getDependencyGraph();
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.PYPI, dependencyGraph);
graphAssert.hasNoDependency("simple", "1");
graphAssert.hasRootDependency("with-dashes", "2.0");
graphAssert.hasRootDependency("dots.and-dashes", "3.1.2");
graphAssert.hasParentChildRelationship("with-dashes", "2.0", "dots.and-dashes", "3.1.2");
}
Aggregations