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());
}
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());
}
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());
}
Aggregations