Search in sources :

Example 21 with IContentId

use of org.eclipse.dash.licenses.IContentId in project dash-licenses by eclipse.

the class MavenIdParserTests method testMavenP2.

@Test
public void testMavenP2() {
    IContentId value = parser.parseId("p2.eclipse-plugin:org.apache.ant:jar:lib/ant-commons-net.jar:1.10.8.v20200515-1239:system");
    assertEquals("maven", value.getType());
    assertEquals("mavencentral", value.getSource());
    assertEquals("org.apache.ant", value.getNamespace());
    assertEquals("ant-commons-net", value.getName());
    assertEquals("1.10.8", value.getVersion());
}
Also used : IContentId(org.eclipse.dash.licenses.IContentId) Test(org.junit.jupiter.api.Test)

Example 22 with IContentId

use of org.eclipse.dash.licenses.IContentId in project dash-licenses by eclipse.

the class MavenIdParserTests method testMissingPhase.

@Test
public void testMissingPhase() {
    IContentId value = parser.parseId("groupid:artifactid:jar:test:1.2.3");
    assertEquals("groupid", value.getNamespace());
    assertEquals("artifactid", value.getName());
    assertEquals("1.2.3", value.getVersion());
}
Also used : IContentId(org.eclipse.dash.licenses.IContentId) Test(org.junit.jupiter.api.Test)

Example 23 with IContentId

use of org.eclipse.dash.licenses.IContentId in project dash-licenses by eclipse.

the class MavenIdParserTests method testExtraPadding.

@Test
public void testExtraPadding() {
    IContentId value = parser.parseId("  groupid:artifactid:jar:1.2.3:compile  ");
    assertEquals("groupid", value.getNamespace());
    assertEquals("artifactid", value.getName());
    assertEquals("1.2.3", value.getVersion());
}
Also used : IContentId(org.eclipse.dash.licenses.IContentId) Test(org.junit.jupiter.api.Test)

Example 24 with IContentId

use of org.eclipse.dash.licenses.IContentId in project dash-licenses by eclipse.

the class MavenIdParserTests method testRetainQualifier1.

@Test
public void testRetainQualifier1() {
    IContentId value = parser.parseId("p2.eclipse-plugin:org.eclipse.core.jobs:jar:3.8.0.20160509");
    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.20160509", value.getVersion());
}
Also used : IContentId(org.eclipse.dash.licenses.IContentId) Test(org.junit.jupiter.api.Test)

Example 25 with IContentId

use of org.eclipse.dash.licenses.IContentId in project dash-licenses by eclipse.

the class MavenIdParserTests method testCreation1.

@Test
public void testCreation1() {
    IContentId value = parser.parseId("groupid:artifactid:1.2.3");
    assertEquals("groupid", value.getNamespace());
    assertEquals("artifactid", value.getName());
    assertEquals("1.2.3", value.getVersion());
}
Also used : IContentId(org.eclipse.dash.licenses.IContentId) Test(org.junit.jupiter.api.Test)

Aggregations

IContentId (org.eclipse.dash.licenses.IContentId)26 Test (org.junit.jupiter.api.Test)23 StringReader (java.io.StringReader)4 LicenseData (org.eclipse.dash.licenses.LicenseData)4 YarnLockFileReader (org.eclipse.dash.licenses.cli.YarnLockFileReader)3 Guice (com.google.inject.Guice)2 Injector (com.google.inject.Injector)2 File (java.io.File)2 FileOutputStream (java.io.FileOutputStream)2 InputStream (java.io.InputStream)2 OutputStream (java.io.OutputStream)2 StandardCharsets (java.nio.charset.StandardCharsets)2 ArrayList (java.util.ArrayList)2 Collection (java.util.Collection)2 List (java.util.List)2 ISettings (org.eclipse.dash.licenses.ISettings)2 LicenseChecker (org.eclipse.dash.licenses.LicenseChecker)2 PackageLockFileReader (org.eclipse.dash.licenses.cli.PackageLockFileReader)2 Disabled (org.junit.jupiter.api.Disabled)2 Json (jakarta.json.Json)1