@Test public void testConstructorAndGetters() { // Set up // Invoke final GAV gav = new GAV(GROUP_ID, ARTIFACT_ID, VERSION); // Check assertEquals(GROUP_ID, gav.getGroupId()); assertEquals(ARTIFACT_ID, gav.getArtifactId()); assertEquals(VERSION, gav.getVersion()); }
@Test public void testGetInstance() { // Set up final String coordinates = StringUtils.arrayToDelimitedString( new String[] {GROUP_ID, ARTIFACT_ID, VERSION}, MavenUtils.COORDINATE_SEPARATOR); // Invoke final GAV gav = GAV.getInstance(coordinates); // Check assertEquals(GROUP_ID, gav.getGroupId()); assertEquals(ARTIFACT_ID, gav.getArtifactId()); assertEquals(VERSION, gav.getVersion()); }
public void createModule( final JavaPackage topLevelPackage, final String name, final GAV parent, final PackagingType packagingType) { Assert.isTrue(isCreateModuleAvailable(), "Cannot create modules at this time"); final String moduleName = StringUtils.defaultIfEmpty(name, topLevelPackage.getLastElement()); final GAV module = new GAV(topLevelPackage.getFullyQualifiedPackageName(), moduleName, parent.getVersion()); final ProjectMetadata project = getProjectMetadata(); // TODO create or update "modules" element of parent module's POM // Create the new module's directory, named by its artifactId (Maven standard practice) fileManager.createDirectory(moduleName); // Focus the new module so that artifacts created below go to the correct path(s) focus(module); packagingType.createArtifacts(topLevelPackage, name, "${java.version}", parent); }