Search in sources :

Example 1 with PipfileLockDependencyTransformer

use of com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockDependencyTransformer in project synopsys-detect by blackducksoftware.

the class DetectableFactory method createPipfileLockDetectable.

public PipfileLockDetectable createPipfileLockDetectable(DetectableEnvironment environment, PipfileLockDetectableOptions pipfileLockDetectableOptions) {
    PipfileLockDependencyVersionParser dependencyVersionParser = new PipfileLockDependencyVersionParser();
    PipfileLockTransformer pipfileLockTransformer = new PipfileLockTransformer(dependencyVersionParser, pipfileLockDetectableOptions.getDependencyTypeFilter());
    PipfileLockDependencyTransformer pipfileLockDependencyTransformer = new PipfileLockDependencyTransformer();
    PipfileLockExtractor pipfileLockExtractor = new PipfileLockExtractor(gson, pipfileLockTransformer, pipfileLockDependencyTransformer);
    return new PipfileLockDetectable(environment, fileFinder, pipfileLockExtractor);
}
Also used : PipfileLockDependencyVersionParser(com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockDependencyVersionParser) PipfileLockTransformer(com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockTransformer) PipfileLockDetectable(com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockDetectable) PipfileLockDependencyTransformer(com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockDependencyTransformer) PipfileLockExtractor(com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockExtractor)

Example 2 with PipfileLockDependencyTransformer

use of com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockDependencyTransformer in project synopsys-detect by blackducksoftware.

the class PipfileLockDependencyTransformerTest method testTransform.

@Test
public void testTransform() {
    List<PipfileLockDependency> dependencies = Arrays.asList(new PipfileLockDependency("comp1", "1.0"), new PipfileLockDependency("comp2", "2.0"));
    PipfileLockDependencyTransformer transformer = new PipfileLockDependencyTransformer();
    DependencyGraph dependencyGraph = transformer.transform(dependencies);
    NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.PYPI, dependencyGraph);
    graphAssert.hasRootSize(2);
    graphAssert.hasRootDependency("comp1", "1.0");
    graphAssert.hasRootDependency("comp2", "2.0");
}
Also used : PipfileLockDependency(com.synopsys.integration.detectable.detectables.pipenv.parse.model.PipfileLockDependency) PipfileLockDependencyTransformer(com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockDependencyTransformer) NameVersionGraphAssert(com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert) DependencyGraph(com.synopsys.integration.bdio.graph.DependencyGraph) Test(org.junit.jupiter.api.Test)

Aggregations

PipfileLockDependencyTransformer (com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockDependencyTransformer)2 DependencyGraph (com.synopsys.integration.bdio.graph.DependencyGraph)1 PipfileLockDependencyVersionParser (com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockDependencyVersionParser)1 PipfileLockDetectable (com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockDetectable)1 PipfileLockExtractor (com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockExtractor)1 PipfileLockTransformer (com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockTransformer)1 PipfileLockDependency (com.synopsys.integration.detectable.detectables.pipenv.parse.model.PipfileLockDependency)1 NameVersionGraphAssert (com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert)1 Test (org.junit.jupiter.api.Test)1