Search in sources :

Example 11 with SubArtifact

use of org.sonatype.aether.util.artifact.SubArtifact in project sonatype-aether by sonatype.

the class SubArtifactTest method testDerivedExtension.

@Test
public void testDerivedExtension() {
    Artifact main = newMainArtifact("gid:aid:ext:cls:ver");
    Artifact sub = new SubArtifact(main, "", "*.asc");
    assertEquals("ext.asc", sub.getExtension());
    sub = new SubArtifact(main, "", "asc.*");
    assertEquals("asc.ext", sub.getExtension());
}
Also used : SubArtifact(org.sonatype.aether.util.artifact.SubArtifact) Artifact(org.sonatype.aether.artifact.Artifact) SubArtifact(org.sonatype.aether.util.artifact.SubArtifact) Test(org.junit.Test)

Example 12 with SubArtifact

use of org.sonatype.aether.util.artifact.SubArtifact in project sonatype-aether by sonatype.

the class SubArtifactTest method testEmptyExtension.

@Test
public void testEmptyExtension() {
    Artifact main = newMainArtifact("gid:aid:ext:cls:ver");
    Artifact sub = new SubArtifact(main, "tests", "");
    assertEquals("", sub.getExtension());
    sub = new SubArtifact(main, "tests", null);
    assertEquals("", sub.getExtension());
}
Also used : SubArtifact(org.sonatype.aether.util.artifact.SubArtifact) Artifact(org.sonatype.aether.artifact.Artifact) SubArtifact(org.sonatype.aether.util.artifact.SubArtifact) Test(org.junit.Test)

Example 13 with SubArtifact

use of org.sonatype.aether.util.artifact.SubArtifact in project sonatype-aether by sonatype.

the class SubArtifactTest method testDerivedClassifier.

@Test
public void testDerivedClassifier() {
    Artifact main = newMainArtifact("gid:aid:ext:cls:ver");
    Artifact sub = new SubArtifact(main, "*-tests", "pom");
    assertEquals("cls-tests", sub.getClassifier());
    sub = new SubArtifact(main, "tests-*", "pom");
    assertEquals("tests-cls", sub.getClassifier());
    main = newMainArtifact("gid:aid:ext:ver");
    sub = new SubArtifact(main, "*-tests", "pom");
    assertEquals("tests", sub.getClassifier());
    sub = new SubArtifact(main, "tests-*", "pom");
    assertEquals("tests", sub.getClassifier());
}
Also used : SubArtifact(org.sonatype.aether.util.artifact.SubArtifact) Artifact(org.sonatype.aether.artifact.Artifact) SubArtifact(org.sonatype.aether.util.artifact.SubArtifact) Test(org.junit.Test)

Aggregations

Artifact (org.sonatype.aether.artifact.Artifact)13 SubArtifact (org.sonatype.aether.util.artifact.SubArtifact)13 Test (org.junit.Test)10 File (java.io.File)5 DefaultArtifact (org.sonatype.aether.util.artifact.DefaultArtifact)3 RepositorySystem (org.sonatype.aether.RepositorySystem)2 RepositorySystemSession (org.sonatype.aether.RepositorySystemSession)2 HashMap (java.util.HashMap)1 DeployRequest (org.sonatype.aether.deployment.DeployRequest)1 InstallRequest (org.sonatype.aether.installation.InstallRequest)1 RemoteRepository (org.sonatype.aether.repository.RemoteRepository)1