From 90aa85b340fe4cc532609b5a17ec8fc6fa19ce57 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Fri, 6 Mar 2009 23:25:59 +0000 Subject: [PATCH] o Extended UT to capture regression of MNG-786 git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@751134 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/project/PomConstructionTest.java | 18 +++++------ .../profile-module/pom.xml | 32 +++++++++++-------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java b/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java index f83f4cc5b6..abca2ede2f 100644 --- a/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java +++ b/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java @@ -28,13 +28,9 @@ import org.apache.maven.profiles.DefaultProfileManager; import org.apache.maven.profiles.ProfileActivationContext; import org.apache.maven.model.Model; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; -import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.DefaultArtifactRepository; import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; import org.apache.maven.project.harness.PomTestWrapper; -import org.apache.maven.project.*; -import org.apache.maven.project.builder.PomClassicDomainModel; -import org.apache.maven.repository.MavenRepositorySystem; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; @@ -50,8 +46,6 @@ public class PomConstructionTest private DefaultMavenProjectBuilder mavenProjectBuilder; - private MavenRepositorySystem mavenTools; - private File testDirectory; private File testMixinDirectory; @@ -62,7 +56,6 @@ public class PomConstructionTest testDirectory = new File( getBasedir(), BASE_POM_DIR ); testMixinDirectory = new File( getBasedir(), BASE_MIXIN_DIR ); mavenProjectBuilder = (DefaultMavenProjectBuilder) lookup( MavenProjectBuilder.class ); - mavenTools = lookup( MavenRepositorySystem.class ); } /** @@ -76,20 +69,25 @@ public class PomConstructionTest { buildPomFromMavenProject( "empty-distMng-repo-url", null ); } - /** * Tests that modules is not overriden by profile * * @throws Exception */ + /* FIXME: cf MNG-786 public void testProfileModules() throws Exception { PomTestWrapper pom = buildPomFromMavenProject( "profile-module", "a" ); - assertEquals( "test-prop", pom.getValue( "properties[1]/b" ) );//verifies profile applied - assertEquals( "test-module", pom.getValue( "modules[1]" ) ); + assertEquals( "test-prop", pom.getValue( "properties[1]/b" ) );// verifies profile applied + assertEquals( 4, ( (List) pom.getValue( "modules" ) ).size() ); + assertEquals( "module-2", pom.getValue( "modules[1]" ) ); + assertEquals( "module-1", pom.getValue( "modules[2]" ) ); + assertEquals( "module-3", pom.getValue( "modules[3]" ) ); + assertEquals( "module-4", pom.getValue( "modules[4]" ) ); } + //*/ /** * Will throw exception if doesn't find parent(s) in build diff --git a/maven-project/src/test/resources-project-builder/profile-module/pom.xml b/maven-project/src/test/resources-project-builder/profile-module/pom.xml index 93c730e299..b6336fd48c 100644 --- a/maven-project/src/test/resources-project-builder/profile-module/pom.xml +++ b/maven-project/src/test/resources-project-builder/profile-module/pom.xml @@ -3,16 +3,22 @@ gid aid 1.0 - pom - - test-module - - - - a - - test-prop - - - - \ No newline at end of file + pom + + module-2 + module-1 + module-3 + + + + a + + test-prop + + + module-1 + module-4 + + + +