use of org.eclipse.dash.licenses.IContentId in project dash-licenses by eclipse.
the class YarnLockFileReaderTests method testInvalidEntry.
@Test
void testInvalidEntry() throws IOException {
// @formatter:off
String contents = "spawn-command@^0.0.2-1:\n" + " resolved \"https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0\"\n" + " integrity sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=\n" + "";
// @formatter:on
var ids = new YarnLockFileReader(new StringReader(contents)).getContentIds();
IContentId id = ids.get(0);
assertFalse(id.isValid());
}
use of org.eclipse.dash.licenses.IContentId in project dash-licenses by eclipse.
the class YarnLockFileReaderTests method testSingleEntryWithNamespace.
@Test
void testSingleEntryWithNamespace() throws IOException {
// @formatter:off
String contents = "\"@babel/code-frame@^7.0.0\", \"@babel/code-frame@^7.12.13\":\n" + " version \"7.12.13\"\n" + " resolved \"https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658\"\n" + " integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==\n" + " dependencies:\n" + " \"@babel/highlight\" \"^7.12.13\"";
// @formatter:on
var ids = new YarnLockFileReader(new StringReader(contents)).getContentIds();
IContentId id = ids.get(0);
assertEquals("@babel", id.getNamespace());
assertEquals("code-frame", id.getName());
assertEquals("7.12.13", id.getVersion());
}
use of org.eclipse.dash.licenses.IContentId in project dash-licenses by eclipse.
the class LicenseCheckerTests method testWithUnsupported.
@Test
void testWithUnsupported() {
IContentId contentId = ContentId.getContentId("p2/eclipseplugin/-/write/0.2.0");
Map<IContentId, LicenseData> licenseData = licenseChecker.getLicenseData(Collections.singleton(contentId));
LicenseData data = licenseData.get(contentId);
assertNull(data.getLicense());
assertEquals(LicenseSupport.Status.Restricted, data.getStatus());
}
use of org.eclipse.dash.licenses.IContentId in project dash-licenses by eclipse.
the class LicenseCheckerTests method testSingleApprovedLicense.
@Test
void testSingleApprovedLicense() {
IContentId contentId = ContentId.getContentId("npm/npmjs/-/write/1.0.3");
Map<IContentId, LicenseData> licenseData = licenseChecker.getLicenseData(Collections.singleton(contentId));
LicenseData data = licenseData.get(contentId);
assertEquals("MIT", data.getLicense());
assertEquals(LicenseSupport.Status.Approved, data.getStatus());
}
use of org.eclipse.dash.licenses.IContentId in project dash-licenses by eclipse.
the class MavenIdParserTests method testOrbitBundle.
@Test
public void testOrbitBundle() {
IContentId value = parser.parseId("p2.eclipse-plugin:org.eclipse.core.jobs:jar:3.8.0.v20160509-0411");
assertEquals("p2", value.getType());
assertEquals("orbit", value.getSource());
assertEquals("p2.eclipse-plugin", value.getNamespace());
assertEquals("org.eclipse.core.jobs", value.getName());
assertEquals("3.8.0.v20160509-0411", value.getVersion());
}
Aggregations