use of com.synopsys.integration.detectable.util.graph.GraphAssert in project synopsys-detect by blackducksoftware.
the class NpmPeerExclusionTest method testPeerDependencyNotExists.
@Test
public void testPeerDependencyNotExists() {
NpmPackagerResult result = createPackager(NpmDependencyType.DEV, NpmDependencyType.PEER).parseAndTransform(packageJsonText, packageLockText);
GraphAssert graphAssert = new GraphAssert(Forge.NPMJS, result.getCodeLocation().getDependencyGraph());
graphAssert.hasNoDependency(childPeer);
graphAssert.hasNoDependency(parentPeer);
graphAssert.hasRootSize(0);
}
use of com.synopsys.integration.detectable.util.graph.GraphAssert in project synopsys-detect by blackducksoftware.
the class NpmPeerExclusionTest method testPeerDependencyExists.
@Test
public void testPeerDependencyExists() {
NpmPackagerResult result = createPackager(NpmDependencyType.DEV).parseAndTransform(packageJsonText, packageLockText);
GraphAssert graphAssert = new GraphAssert(Forge.NPMJS, result.getCodeLocation().getDependencyGraph());
graphAssert.hasDependency(childPeer);
graphAssert.hasDependency(parentPeer);
graphAssert.hasRootSize(1);
}
use of com.synopsys.integration.detectable.util.graph.GraphAssert in project synopsys-detect by blackducksoftware.
the class PackageJsonExtractorFunctionalTest method extractWithDevDependencies.
@Test
void extractWithDevDependencies() {
Extraction extraction = createExtractor(NpmDependencyType.PEER).extract(packageJsonInputStream);
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.hasNoDependency(testPeerDep1);
graphAssert.hasNoDependency(testPeerDep2);
graphAssert.hasRootSize(4);
}
use of com.synopsys.integration.detectable.util.graph.GraphAssert in project synopsys-detect by blackducksoftware.
the class PackageJsonExtractorFunctionalTest method extractWithNoDevDependencies.
@Test
void extractWithNoDevDependencies() {
Extraction extraction = createExtractor(NpmDependencyType.PEER, NpmDependencyType.DEV).extract(packageJsonInputStream);
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.hasNoDependency(testDevDep1);
graphAssert.hasNoDependency(testDevDep2);
graphAssert.hasNoDependency(testPeerDep1);
graphAssert.hasNoDependency(testPeerDep2);
graphAssert.hasRootSize(2);
}
use of com.synopsys.integration.detectable.util.graph.GraphAssert in project synopsys-detect by blackducksoftware.
the class PackageJsonExtractorTest method extractWithNoDevOrPeerDependencies.
@Test
void extractWithNoDevOrPeerDependencies() {
PackageJson packageJson = createPackageJson();
Extraction extraction = createExtractor(NpmDependencyType.DEV, 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.hasNoDependency(testDevDep1);
graphAssert.hasNoDependency(testDevDep2);
graphAssert.hasRootSize(2);
}
Aggregations