use of org.sonatype.aether.util.artifact.SubArtifact in project sonatype-aether by sonatype.
the class SubArtifactTest method testPropertiesCopied.
@Test
public void testPropertiesCopied() {
Map<String, String> props = new HashMap<String, String>();
props.put("key", "value1");
Artifact a = new SubArtifact(newMainArtifact("gid:aid:ver"), "", "pom", props, null);
assertEquals("value1", a.getProperty("key", null));
props.clear();
assertEquals("value1", a.getProperty("key", null));
props.put("key", "value2");
a = a.setProperties(props);
assertEquals("value2", a.getProperty("key", null));
props.clear();
assertEquals("value2", a.getProperty("key", null));
}
use of org.sonatype.aether.util.artifact.SubArtifact in project sonatype-aether by sonatype.
the class SubArtifactTest method testMainArtifactFileNotRetained.
@Test
public void testMainArtifactFileNotRetained() {
Artifact a = newMainArtifact("gid:aid:ver").setFile(new File(""));
assertNotNull(a.getFile());
a = new SubArtifact(a, "", "pom");
assertNull(a.getFile());
}
use of org.sonatype.aether.util.artifact.SubArtifact in project sonatype-aether by sonatype.
the class SubArtifactTest method testSameExtension.
@Test
public void testSameExtension() {
Artifact main = newMainArtifact("gid:aid:ext:cls:ver");
Artifact sub = new SubArtifact(main, "tests", "*");
assertEquals("ext", sub.getExtension());
}
use of org.sonatype.aether.util.artifact.SubArtifact in project sonatype-aether by sonatype.
the class SubArtifactTest method testMainArtifactPropertiesNotRetained.
@Test
public void testMainArtifactPropertiesNotRetained() {
Artifact a = newMainArtifact("gid:aid:ver").setProperties(Collections.singletonMap("key", "value"));
assertEquals(1, a.getProperties().size());
a = new SubArtifact(a, "", "pom");
assertEquals(0, a.getProperties().size());
assertSame(null, a.getProperty("key", null));
}
use of org.sonatype.aether.util.artifact.SubArtifact in project sonatype-aether by sonatype.
the class SubArtifactTest method testSameClassifier.
@Test
public void testSameClassifier() {
Artifact main = newMainArtifact("gid:aid:ext:cls:ver");
Artifact sub = new SubArtifact(main, "*", "pom");
assertEquals("cls", sub.getClassifier());
}
Aggregations