use of com.synopsys.integration.detectable.detectables.maven.cli.ScopedDependency in project synopsys-detect by blackducksoftware.
the class MavenCodeLocationPackagerTest method testParseDependency.
@Test
public void testParseDependency() {
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.detectable.detectables.maven.cli.ScopedDependency in project synopsys-detect by blackducksoftware.
the class MavenCodeLocationPackagerTest method testLineWithUnknownScope.
@Test
public void testLineWithUnknownScope() {
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 constraint [3.8.0,3.8.1))";
line = mavenCodeLocationPackager.trimLogLevel(line);
String cleanedLine = mavenCodeLocationPackager.calculateCurrentLevelAndCleanLine(line);
ScopedDependency scopedDependency = mavenCodeLocationPackager.textToDependency(cleanedLine);
assertEquals("org.eclipse.scout.sdk.deps:org.eclipse.core.jobs:3.8.0.v20160509-0411", scopedDependency.getExternalId().createExternalId());
}
Aggregations