Search in sources :

Example 1 with MavenParseResult

use of com.synopsys.integration.detectable.detectables.maven.cli.MavenParseResult in project synopsys-detect by blackducksoftware.

the class MavenComplexOutputTest method test.

@Test
public void test() {
    ExternalIdFactory externalIdFactory = new ExternalIdFactory();
    MavenCodeLocationPackager packager = new MavenCodeLocationPackager(externalIdFactory);
    List<MavenParseResult> results = packager.extractCodeLocations("", getInput(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
    NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.MAVEN, results.get(0).getCodeLocation().getDependencyGraph());
    graphAssert.hasRootSize(1);
    ExternalId hubCommon = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "hub-common", "13.1.2");
    ExternalId integrationCommon = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "integration-common", "6.0.2");
    ExternalId hubCommonRest = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "hub-common-rest", "2.1.3");
    graphAssert.hasRootDependency(hubCommon);
    graphAssert.hasParentChildRelationship(hubCommonRest, integrationCommon);
    graphAssert.hasParentChildRelationship(hubCommon, hubCommonRest);
}
Also used : ExternalIdFactory(com.synopsys.integration.bdio.model.externalid.ExternalIdFactory) ExternalId(com.synopsys.integration.bdio.model.externalid.ExternalId) NameVersionGraphAssert(com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert) MavenParseResult(com.synopsys.integration.detectable.detectables.maven.cli.MavenParseResult) MavenCodeLocationPackager(com.synopsys.integration.detectable.detectables.maven.cli.MavenCodeLocationPackager) Test(org.junit.jupiter.api.Test)

Example 2 with MavenParseResult

use of com.synopsys.integration.detectable.detectables.maven.cli.MavenParseResult in project synopsys-detect by blackducksoftware.

the class MavenCorruptOutputTest method test.

@Test
public void test() {
    ExternalIdFactory externalIdFactory = new ExternalIdFactory();
    MavenCodeLocationPackager packager = new MavenCodeLocationPackager(externalIdFactory);
    List<MavenParseResult> results = packager.extractCodeLocations("", getInput(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
    NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.MAVEN, results.get(0).getCodeLocation().getDependencyGraph());
    graphAssert.hasRootSize(1);
    ExternalId hubCommon = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "hub-common", "13.1.2");
    ExternalId integrationCommon = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "integration-common", "6.0.2");
    ExternalId hubCommonRest = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "hub-common-rest", "2.1.3");
    graphAssert.hasRootDependency(hubCommon);
    graphAssert.hasParentChildRelationship(hubCommonRest, integrationCommon);
    graphAssert.hasParentChildRelationship(hubCommon, hubCommonRest);
}
Also used : ExternalIdFactory(com.synopsys.integration.bdio.model.externalid.ExternalIdFactory) ExternalId(com.synopsys.integration.bdio.model.externalid.ExternalId) NameVersionGraphAssert(com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert) MavenParseResult(com.synopsys.integration.detectable.detectables.maven.cli.MavenParseResult) MavenCodeLocationPackager(com.synopsys.integration.detectable.detectables.maven.cli.MavenCodeLocationPackager) Test(org.junit.jupiter.api.Test)

Aggregations

ExternalId (com.synopsys.integration.bdio.model.externalid.ExternalId)2 ExternalIdFactory (com.synopsys.integration.bdio.model.externalid.ExternalIdFactory)2 MavenCodeLocationPackager (com.synopsys.integration.detectable.detectables.maven.cli.MavenCodeLocationPackager)2 MavenParseResult (com.synopsys.integration.detectable.detectables.maven.cli.MavenParseResult)2 NameVersionGraphAssert (com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert)2 Test (org.junit.jupiter.api.Test)2