Search in sources :

Example 6 with PackageResolved

use of com.synopsys.integration.detectable.detectables.swift.lock.data.PackageResolved 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();
    PackageResolved packageResolved = createPackageResolved(rSwiftLibraryPackage);
    DependencyGraph dependencyGraph = transformer.transform(packageResolved);
    GraphAssert graphAssert = new GraphAssert(Forge.GITHUB, dependencyGraph);
    ExternalId rSwiftLibrary = ExternalId.FACTORY.createNameVersionExternalId(Forge.GITHUB, "mac-cain13/R.swift.Library", "5.4.0");
    graphAssert.hasRootDependency(rSwiftLibrary);
    graphAssert.hasRootSize(1);
}
Also used : PackageResolved(com.synopsys.integration.detectable.detectables.swift.lock.data.PackageResolved) GraphAssert(com.synopsys.integration.detectable.util.graph.GraphAssert) ExternalId(com.synopsys.integration.bdio.model.externalid.ExternalId) PackageState(com.synopsys.integration.detectable.detectables.swift.lock.data.PackageState) DependencyGraph(com.synopsys.integration.bdio.graph.DependencyGraph) ResolvedPackage(com.synopsys.integration.detectable.detectables.swift.lock.data.ResolvedPackage) Test(org.junit.jupiter.api.Test)

Example 7 with PackageResolved

use of com.synopsys.integration.detectable.detectables.swift.lock.data.PackageResolved 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();
    PackageResolved packageResolved = createPackageResolved(malformedUrlPackage);
    DependencyGraph dependencyGraph = transformer.transform(packageResolved);
    GraphAssert graphAssert = new GraphAssert(Forge.GITHUB, dependencyGraph);
    graphAssert.hasRootSize(0);
}
Also used : PackageResolved(com.synopsys.integration.detectable.detectables.swift.lock.data.PackageResolved) GraphAssert(com.synopsys.integration.detectable.util.graph.GraphAssert) PackageState(com.synopsys.integration.detectable.detectables.swift.lock.data.PackageState) DependencyGraph(com.synopsys.integration.bdio.graph.DependencyGraph) ResolvedPackage(com.synopsys.integration.detectable.detectables.swift.lock.data.ResolvedPackage) Test(org.junit.jupiter.api.Test)

Example 8 with PackageResolved

use of com.synopsys.integration.detectable.detectables.swift.lock.data.PackageResolved in project synopsys-detect by blackducksoftware.

the class PackageResolvedTransformerTest method createPackageResolved.

private PackageResolved createPackageResolved(ResolvedPackage resolvedPackage) {
    List<ResolvedPackage> resolvedPackages = Collections.singletonList(resolvedPackage);
    ResolvedObject resolvedObject = new ResolvedObject(resolvedPackages);
    return new PackageResolved(resolvedObject, "1");
}
Also used : ResolvedObject(com.synopsys.integration.detectable.detectables.swift.lock.data.ResolvedObject) PackageResolved(com.synopsys.integration.detectable.detectables.swift.lock.data.PackageResolved) ResolvedPackage(com.synopsys.integration.detectable.detectables.swift.lock.data.ResolvedPackage)

Aggregations

PackageResolved (com.synopsys.integration.detectable.detectables.swift.lock.data.PackageResolved)8 ResolvedPackage (com.synopsys.integration.detectable.detectables.swift.lock.data.ResolvedPackage)6 Test (org.junit.jupiter.api.Test)6 DependencyGraph (com.synopsys.integration.bdio.graph.DependencyGraph)5 PackageState (com.synopsys.integration.detectable.detectables.swift.lock.data.PackageState)5 GraphAssert (com.synopsys.integration.detectable.util.graph.GraphAssert)5 ExternalId (com.synopsys.integration.bdio.model.externalid.ExternalId)4 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 ResolvedObject (com.synopsys.integration.detectable.detectables.swift.lock.data.ResolvedObject)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1