use of com.synopsys.integration.detectable.detectables.conan.ConanDetectableResult in project synopsys-detect by blackducksoftware.
the class ConanLockfileParserFunctionalTest method testWithDevDependencies.
@Test
public void testWithDevDependencies() throws IOException, IntegrationException {
File lockfile = FunctionalTestFiles.asFile("/conan/lockfile/conan_buildrequirements.lock");
EnumListFilter<ConanDependencyType> dependencyTypeFilter = EnumListFilter.excludeNone();
ConanLockfileParser parser = new ConanLockfileParser(new Gson(), new ConanCodeLocationGenerator(dependencyTypeFilter, false), new ExternalIdFactory());
String conanLockfileContents = FileUtils.readFileToString(lockfile, StandardCharsets.UTF_8);
ConanDetectableResult result = parser.generateCodeLocationFromConanLockfileContents(conanLockfileContents);
assertEquals(3, result.getCodeLocation().getDependencyGraph().getRootDependencies().size());
DependencyGraph actualDependencyGraph = result.getCodeLocation().getDependencyGraph();
GraphCompare.assertEqualsResource("/conan/lockfile/noProjectRef_graph.json", actualDependencyGraph);
}
use of com.synopsys.integration.detectable.detectables.conan.ConanDetectableResult in project synopsys-detect by blackducksoftware.
the class ConanLockfileParserFunctionalTest method testNoProjectRefLongFormExternalIds.
@Test
public void testNoProjectRefLongFormExternalIds() throws IOException, IntegrationException {
File lockfile = FunctionalTestFiles.asFile("/conan/lockfile/conan.lock");
EnumListFilter<ConanDependencyType> dependencyTypeFilter = EnumListFilter.excludeNone();
ConanLockfileParser parser = new ConanLockfileParser(new Gson(), new ConanCodeLocationGenerator(dependencyTypeFilter, true), new ExternalIdFactory());
String conanLockfileContents = FileUtils.readFileToString(lockfile, StandardCharsets.UTF_8);
ConanDetectableResult result = parser.generateCodeLocationFromConanLockfileContents(conanLockfileContents);
assertEquals(3, result.getCodeLocation().getDependencyGraph().getRootDependencies().size());
DependencyGraph actualDependencyGraph = result.getCodeLocation().getDependencyGraph();
GraphCompare.assertEqualsResource("/conan/lockfile/noProjectRefLongForm_graph.json", actualDependencyGraph);
}
use of com.synopsys.integration.detectable.detectables.conan.ConanDetectableResult in project synopsys-detect by blackducksoftware.
the class ConanLockfileParserFunctionalTest method testProjectRef.
@Test
public void testProjectRef() throws IOException, IntegrationException {
File lockfile = FunctionalTestFiles.asFile("/conan/lockfile/conan_projectref.lock");
EnumListFilter<ConanDependencyType> dependencyTypeFilter = EnumListFilter.excludeNone();
ConanLockfileParser parser = new ConanLockfileParser(new Gson(), new ConanCodeLocationGenerator(dependencyTypeFilter, true), new ExternalIdFactory());
String conanLockfileContents = FileUtils.readFileToString(lockfile, StandardCharsets.UTF_8);
ConanDetectableResult result = parser.generateCodeLocationFromConanLockfileContents(conanLockfileContents);
assertEquals("chat", result.getProjectName());
assertEquals("0.1", result.getProjectVersion());
}
Aggregations