AbstractDefineResourcesMojo extends AbstractWOMojo { String getFullTargetPath(final String targetPath) { StringBuilder builder = new StringBuilder(); builder.append("../"); if (includesVersionInArtifactName()) { builder.append(getFinalName()).append(getClassifierAsString()); } else { builder.append(getProject().getArtifactId()); } builder.append(".").append(getProductExtension()); if (this.hasContentsFolder()) { builder.append(File.separator).append("Contents"); } return builder.append(File.separator).append(targetPath).toString(); } AbstractDefineResourcesMojo(); void execute(); Boolean flattenResources(); abstract boolean hasContentsFolder(); abstract boolean includesVersionInArtifactName(); void setFlattingResources(final Boolean flattenResources);  }
@Test public void testDefaultFullTargetPath() throws Exception { mojo.setClassifier(null); String path = mojo.getFullTargetPath("test"); assertThat(path, is("../foo-1.0-SNAPSHOT.woa/Contents/test")); }
@Test public void testFullTargetPathWithClassifier() throws Exception { String path = mojo.getFullTargetPath("test"); assertThat(path, is("../foo-1.0-SNAPSHOT-someClassifier.woa/Contents/test")); }
@Test public void testFullTargetPathWithFinalName() throws Exception { mojo.setFinalName("foo-bar-project"); mojo.setClassifier(null); String path = mojo.getFullTargetPath("test"); assertThat(path, is("../foo-bar-project.woa/Contents/test")); }