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(externalIdFactory);
PackageResolved packageResolved = createPackageResolved(rSwiftLibraryPackage);
DependencyGraph dependencyGraph = transformer.transform(packageResolved);
GraphAssert graphAssert = new GraphAssert(Forge.GITHUB, dependencyGraph);
ExternalId rSwiftLibrary = externalIdFactory.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 noGitExtensionTest.
@Test
void noGitExtensionTest() {
ResolvedPackage swiftLogPackage = new ResolvedPackage("swift-log", // Won't be malformed for sanity check
"http://github.com/apple/swift-log", new PackageState(null, "5d66f7ba25daf4f94100e7022febf3c75e37a6c7", "1.4.2"));
PackageResolvedTransformer transformer = new PackageResolvedTransformer(externalIdFactory);
PackageResolved packageResolved = createPackageResolved(swiftLogPackage);
DependencyGraph dependencyGraph = transformer.transform(packageResolved);
GraphAssert graphAssert = new GraphAssert(Forge.GITHUB, dependencyGraph);
ExternalId swiftLog = externalIdFactory.createNameVersionExternalId(Forge.GITHUB, "apple/swift-log", "1.4.2");
graphAssert.hasRootDependency(swiftLog);
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(externalIdFactory);
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 BitbakeDependencyGraphTransformerTest method ignoredNoVersion.
@Test
public void ignoredNoVersion() {
ExternalIdFactory externalIdFactory = new ExternalIdFactory();
BitbakeGraph bitbakeGraph = new BitbakeGraph();
bitbakeGraph.addNode("example", null, "meta");
Map<String, List<String>> recipeToLayerMap = new HashMap<>();
recipeToLayerMap.put("example", Collections.singletonList("meta"));
BitbakeDependencyGraphTransformer bitbakeDependencyGraphTransformer = new BitbakeDependencyGraphTransformer(EnumListFilter.excludeNone());
DependencyGraph dependencyGraph = bitbakeDependencyGraphTransformer.transform(bitbakeGraph, recipeToLayerMap, null);
GraphAssert graphAssert = new GraphAssert(Forge.YOCTO, dependencyGraph);
graphAssert.hasNoDependency(externalIdFactory.createYoctoExternalId("meta", "example", null));
graphAssert.hasRootSize(0);
}
use of com.synopsys.integration.detectable.util.graph.GraphAssert in project synopsys-detect by blackducksoftware.
the class GemspecParserTest method parseWithRuntimeDependencies.
@Test
void parseWithRuntimeDependencies() throws IOException {
InputStream gemspecInputStream = createGemspecInputStream();
DependencyGraph dependencyGraph = gemspecParser(GemspecDependencyType.DEV).parse(gemspecInputStream);
GraphAssert graphAssert = new GraphAssert(Forge.RUBYGEMS, dependencyGraph);
graphAssert.hasRootDependency(externalId1);
graphAssert.hasRootDependency(externalId2);
graphAssert.hasNoDependency(externalId3);
}
Aggregations