use of com.synopsys.integration.bdio.model.externalid.ExternalIdFactory in project hub-detect by blackducksoftware.
the class GradleReportParserTest method testSpringFrameworkAop.
@Test
public void testSpringFrameworkAop() throws IOException {
final File file = new File("src/test/resources/gradle/spring-framework/spring_aop_dependencyGraph.txt");
final GradleReportParser gradleReportParser = new GradleReportParser(new ExternalIdFactory());
final Optional<DetectCodeLocation> result = gradleReportParser.parseDependencies(file);
assertTrue(result.isPresent());
System.out.println(new GsonBuilder().setPrettyPrinting().create().toJson(result.get()));
}
use of com.synopsys.integration.bdio.model.externalid.ExternalIdFactory in project hub-detect by blackducksoftware.
the class GradleReportParserTest method createNewCodeLocationTest.
private void createNewCodeLocationTest(final String gradleInspectorOutputFilePath, final String expectedResourcePath, final String rootProjectFilePath, final String rootProjectName, final String rootProjectVersionName) throws IOException {
final GradleReportParser gradleReportParser = new GradleReportParser(new ExternalIdFactory());
final Optional<DetectCodeLocation> result = gradleReportParser.parseDependencies(new File(gradleInspectorOutputFilePath));
final Optional<NameVersion> rootProjectNameVersion = gradleReportParser.parseRootProjectNameVersion(new File(rootProjectFilePath));
assertTrue(result.isPresent());
assertTrue(rootProjectNameVersion.isPresent());
assertEquals(rootProjectName, rootProjectNameVersion.get().getName());
assertEquals(rootProjectVersionName, rootProjectNameVersion.get().getVersion());
testUtil.testJsonResource(expectedResourcePath, result.get());
}
use of com.synopsys.integration.bdio.model.externalid.ExternalIdFactory in project hub-detect by blackducksoftware.
the class MavenCodeLocationPackagerTest method testParseDependency.
@Test
public void testParseDependency() {
final MavenCodeLocationPackager mavenCodeLocationPackager = new MavenCodeLocationPackager(new ExternalIdFactory());
ScopedDependency dependency = mavenCodeLocationPackager.textToDependency("stuff:things:jar:0.0.1:compile");
assertNotNull(dependency);
dependency = mavenCodeLocationPackager.textToDependency("stuff:things:jar:classifier:0.0.1:test");
assertNotNull(dependency);
dependency = mavenCodeLocationPackager.textToDependency("stuff:things:jar");
assertNull(dependency);
dependency = mavenCodeLocationPackager.textToDependency("stuff:things:jar:classifier:0.0.1");
assertNotNull(dependency);
}
use of com.synopsys.integration.bdio.model.externalid.ExternalIdFactory in project hub-detect by blackducksoftware.
the class MavenCodeLocationPackagerTest method testLineWithBadColonPlacement.
@Test
public void testLineWithBadColonPlacement() {
final MavenCodeLocationPackager mavenCodeLocationPackager = new MavenCodeLocationPackager(new ExternalIdFactory());
String line = "[INFO] | | | \\- org.eclipse.scout.sdk.deps:org.eclipse.core.jobs:jar:3.8.0.v20160509-0411:pants (version selected from: [3.8.0,3.8.1))";
line = mavenCodeLocationPackager.trimLogLevel(line);
final String cleanedLine = mavenCodeLocationPackager.calculateCurrentLevelAndCleanLine(line);
final Dependency dependency = mavenCodeLocationPackager.textToDependency(cleanedLine);
assertEquals("org.eclipse.scout.sdk.deps:org.eclipse.core.jobs:pants (version selected from", dependency.externalId.createExternalId());
}
use of com.synopsys.integration.bdio.model.externalid.ExternalIdFactory in project hub-detect by blackducksoftware.
the class MavenCodeLocationPackagerTest method testLineWithExtraTextAfterScope.
@Test
public void testLineWithExtraTextAfterScope() {
final MavenCodeLocationPackager mavenCodeLocationPackager = new MavenCodeLocationPackager(new ExternalIdFactory());
String line = "[INFO] | | | \\- org.eclipse.scout.sdk.deps:org.eclipse.core.jobs:jar:3.8.0.v20160509-0411:compile (version selected from constraint [3.8.0,3.8.1))";
line = mavenCodeLocationPackager.trimLogLevel(line);
final String cleanedLine = mavenCodeLocationPackager.calculateCurrentLevelAndCleanLine(line);
final Dependency dependency = mavenCodeLocationPackager.textToDependency(cleanedLine);
assertEquals("org.eclipse.scout.sdk.deps:org.eclipse.core.jobs:3.8.0.v20160509-0411", dependency.externalId.createExternalId());
}
Aggregations