use of com.synopsys.integration.detectable.util.graph.GraphAssert in project synopsys-detect by blackducksoftware.
the class PackageJsonExtractorTest method extractWithDevNoPeerDependencies.
@Test
void extractWithDevNoPeerDependencies() {
PackageJson packageJson = createPackageJson();
Extraction extraction = createExtractor(NpmDependencyType.PEER).extract(packageJson);
assertEquals(1, extraction.getCodeLocations().size());
CodeLocation codeLocation = extraction.getCodeLocations().get(0);
DependencyGraph dependencyGraph = codeLocation.getDependencyGraph();
GraphAssert graphAssert = new GraphAssert(Forge.RUBYGEMS, dependencyGraph);
graphAssert.hasRootDependency(testDep1);
graphAssert.hasRootDependency(testDep2);
graphAssert.hasRootDependency(testDevDep1);
graphAssert.hasRootDependency(testDevDep2);
graphAssert.hasRootSize(4);
}
use of com.synopsys.integration.detectable.util.graph.GraphAssert in project synopsys-detect by blackducksoftware.
the class PackageResolvedTransformerTest method manyExtensionsTest.
@Test
void manyExtensionsTest() {
ResolvedPackage rSwiftLibraryPackage = new ResolvedPackage("R.swift.Library", "http://github.com/mac-cain13/R.swift.Library", new PackageState(null, "8998cfe77f4fce79ee6dfab0c88a7d551659d8fb", "5.4.0"));
PackageResolvedTransformer transformer = new PackageResolvedTransformer();
PackageResolved packageResolved = createPackageResolved(rSwiftLibraryPackage);
DependencyGraph dependencyGraph = transformer.transform(packageResolved);
GraphAssert graphAssert = new GraphAssert(Forge.GITHUB, dependencyGraph);
ExternalId rSwiftLibrary = ExternalId.FACTORY.createNameVersionExternalId(Forge.GITHUB, "mac-cain13/R.swift.Library", "5.4.0");
graphAssert.hasRootDependency(rSwiftLibrary);
graphAssert.hasRootSize(1);
}
use of com.synopsys.integration.detectable.util.graph.GraphAssert in project synopsys-detect by blackducksoftware.
the class PackageResolvedTransformerTest method malformedUrlTest.
@Test
void malformedUrlTest() {
ResolvedPackage malformedUrlPackage = new ResolvedPackage("MalformedUrlPackage", "data that isn't a url", new PackageState(null, "revision", "version"));
PackageResolvedTransformer transformer = new PackageResolvedTransformer();
PackageResolved packageResolved = createPackageResolved(malformedUrlPackage);
DependencyGraph dependencyGraph = transformer.transform(packageResolved);
GraphAssert graphAssert = new GraphAssert(Forge.GITHUB, dependencyGraph);
graphAssert.hasRootSize(0);
}
use of com.synopsys.integration.detectable.util.graph.GraphAssert in project synopsys-detect by blackducksoftware.
the class GemspecParserTest method parseWithAllDependencies.
@Test
void parseWithAllDependencies() throws IOException {
InputStream gemspecInputStream = createGemspecInputStream();
DependencyGraph dependencyGraph = gemspecParser().parse(gemspecInputStream);
GraphAssert graphAssert = new GraphAssert(Forge.RUBYGEMS, dependencyGraph);
graphAssert.hasRootDependency(externalId1);
graphAssert.hasRootDependency(externalId2);
graphAssert.hasRootDependency(externalId3);
}
use of com.synopsys.integration.detectable.util.graph.GraphAssert in project synopsys-detect by blackducksoftware.
the class GemspecParserTest method parseWithJustNormalDependencies.
@Test
void parseWithJustNormalDependencies() throws IOException {
InputStream gemspecInputStream = createGemspecInputStream();
DependencyGraph dependencyGraph = gemspecParser(GemspecDependencyType.RUNTIME, GemspecDependencyType.DEV).parse(gemspecInputStream);
GraphAssert graphAssert = new GraphAssert(Forge.RUBYGEMS, dependencyGraph);
graphAssert.hasRootDependency(externalId1);
graphAssert.hasNoDependency(externalId2);
graphAssert.hasNoDependency(externalId3);
}
Aggregations