Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[PATCH] Test to ensure we only rename the base project and not any of…
… the sub projects. 384510

Signed-off-by: Fred Bricon <fbricon@gmail.com>
  • Loading branch information
youngm authored and fbricon committed Jul 25, 2012
1 parent 5cf0227 commit b8eec91
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
@@ -0,0 +1,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.m2e.tests.project.localprojectscanner</groupId>
<artifactId>renameOutsideWorkspace</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>subNotRenamed</artifactId>
</project>
Expand Up @@ -10,4 +10,7 @@
<artifactId>m2e-test-parent</artifactId>
<version>1.0.0</version>
</parent>
<modules>
<module>384510_subNotRenamed</module>
</modules>
</project>
@@ -0,0 +1,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>rename</groupId>
<artifactId>maven-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>subNotRenamed</artifactId>
</project>
Expand Up @@ -4,4 +4,7 @@
<groupId>rename</groupId>
<artifactId>maven-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<modules>
<module>384510_subNotRenamed</module>
</modules>
</project>
Expand Up @@ -23,6 +23,7 @@

import junit.framework.TestCase;

import org.eclipse.core.internal.resources.ProjectInfo;
import org.eclipse.core.runtime.NullProgressMonitor;

import org.eclipse.m2e.core.MavenPlugin;
Expand Down Expand Up @@ -244,6 +245,12 @@ public void testRenameInWorkspace() throws Exception {

MavenProjectInfo project = projects.get(0);
assertEquals(MavenProjectInfo.RENAME_REQUIRED, project.getBasedirRename());

//Non of the sub modules should be renamed
for(MavenProjectInfo subProject : project.getProjects()) {
assertEquals(MavenProjectInfo.RENAME_NO, subProject.getBasedirRename());
}

}

public void testNoMetadata() throws Exception {
Expand Down Expand Up @@ -271,7 +278,14 @@ public void testOutsideWorkspace() throws Exception {
List<MavenProjectInfo> projects = scanner.getProjects();
MavenProjectInfo project = projects.get(0);

//The base directory should be renamed
assertEquals(MavenProjectInfo.RENAME_REQUIRED, project.getBasedirRename());

//Non of the sub modules should be renamed
for(MavenProjectInfo subProject : project.getProjects()) {
assertEquals(MavenProjectInfo.RENAME_NO, subProject.getBasedirRename());
}

}

}

0 comments on commit b8eec91

Please sign in to comment.