use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class CarthageDeclarationTransformerTest method excludeNonGitHubOrigin.
@Test
void excludeNonGitHubOrigin() {
CarthageDeclarationTransformer transformer = new CarthageDeclarationTransformer();
List<CarthageDeclaration> carthageDeclarations = Arrays.asList(new CarthageDeclaration("binary", "https://some.binary.url", "binary-version"), new CarthageDeclaration("github", "some-name/resource", "some-version"), new CarthageDeclaration("wonky-origin", "wonky-name", "wonky-version"));
DependencyGraph graph = transformer.transform(carthageDeclarations);
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.GITHUB, graph);
graphAssert.hasRootDependency("some-name/resource", "some-version");
graphAssert.hasNoDependency("https://some.binary.url", "binary-version");
graphAssert.hasNoDependency("wonky-name", "wonky-version");
graphAssert.hasRootSize(1);
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class CarthageDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertEquals(1, extraction.getCodeLocations().size());
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.GITHUB, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootDependency("GEOSwift/GEOSwift", "8.0.2");
graphAssert.hasRootDependency("MobileNativeFoundation/Kronos", "4.2.1");
graphAssert.hasRootDependency("ReactiveCocoa/ReactiveCocoa", "11.1.0");
graphAssert.hasRootDependency("realm/realm-cocoa", "v10.7.2");
graphAssert.hasNoDependency("https://downloads.localytics.com/SDKs/iOS/Localytics.json", "6.2.1");
graphAssert.hasRootSize(4);
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class PubSpecLockParserTest method test.
@Test
public void test() {
List<String> pubSpecLockLines = Arrays.asList("# Generated by pub", "# See https://dart.dev/tools/pub/glossary#lockfile", "packages:", " async:", " dependency: transitive", " description:", " name: async", " source: hosted", " version: \"2.6.1\"", " boolean_selector:", " dependency: transitive", " description:", " name: boolean_selector", " url: \"https://pub.dartlang.org\"", " version: \"2.1.0\"", " characters:", " description:", " name: characters", " version: \"1.1.0\"");
PubSpecLockParser pubSpecLockParser = new PubSpecLockParser();
DependencyGraph dependencyGraph = pubSpecLockParser.parse(pubSpecLockLines);
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.DART, dependencyGraph);
graphAssert.hasRootSize(3);
graphAssert.hasRootDependency("async", "2.6.1");
graphAssert.hasRootDependency("boolean_selector", "2.1.0");
graphAssert.hasRootDependency("characters", "1.1.0");
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class CondaCliDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
Assertions.assertEquals(1, extraction.getCodeLocations().size());
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.ANACONDA, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootSize(2);
graphAssert.hasRootDependency("mkl", "2017.0.3-0-osx-64");
graphAssert.hasRootDependency("numpy", "1.13.1-py36_0-osx-64");
}
use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.
the class DartPubDepsDetectableTest 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.DART, extraction.getCodeLocations().get(0).getDependencyGraph());
graphAssert.hasRootSize(2);
graphAssert.hasRootDependency("pedantic", "1.9.2");
graphAssert.hasRootDependency("source_span", "1.7.0");
graphAssert.hasParentChildRelationship("source_span", "1.7.0", "meta", "1.2.3");
graphAssert.hasParentChildRelationship("source_span", "1.7.0", "path", "1.7.0");
}
Aggregations