SubArtifact extends AbstractArtifact { public String getClassifier() { return expand( classifier, mainArtifact.getClassifier() ); } SubArtifact( Artifact mainArtifact, String classifier, String extension );  SubArtifact( Artifact mainArtifact, String classifier, String extension, File file );  SubArtifact( Artifact mainArtifact, String classifier, String extension, Map<String, String> properties );  SubArtifact( Artifact mainArtifact, String classifier, String extension, Map<String, String> properties,
                        File file ); private  SubArtifact( Artifact mainArtifact, String classifier, String extension, File file,
                         Map<String, String> properties ); String getGroupId(); String getArtifactId(); String getVersion(); Artifact setVersion( String version ); String getBaseVersion(); boolean isSnapshot(); String getClassifier(); String getExtension(); File getFile(); Artifact setFile( File file ); String getProperty( String key, String defaultValue ); Map<String, String> getProperties(); Artifact setProperties( Map<String, String> properties );  }
@Test public void testEmptyClassifier() { Artifact main = newMainArtifact( "gid:aid:ext:cls:ver" ); Artifact sub = new SubArtifact( main, "", "pom" ); assertEquals( "", sub.getClassifier() ); sub = new SubArtifact( main, null, "pom" ); assertEquals( "", sub.getClassifier() ); }
@Test public void testSameClassifier() { Artifact main = newMainArtifact( "gid:aid:ext:cls:ver" ); Artifact sub = new SubArtifact( main, "*", "pom" ); assertEquals( "cls", sub.getClassifier() ); }
@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() ); }