From 67c93459ccdf7d0c88b3fcc7bf399a3d87790553 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Fri, 23 Jan 2009 16:28:48 +0000 Subject: [PATCH] o Created UT for MNG-3836 git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@737071 13f79535-47bb-0310-9956-ffa450edef68 --- .../project/builder/PomConstructionTest.java | 23 +++- .../plugin-config-merging/child/pom.xml | 76 ++++++++++++ .../plugin-config-merging/pom.xml | 72 +++++++++++ .../plugin-exec-config-order/pom.xml | 117 ------------------ 4 files changed, 168 insertions(+), 120 deletions(-) create mode 100644 maven-project/src/test/resources-project-builder/plugin-config-merging/child/pom.xml create mode 100644 maven-project/src/test/resources-project-builder/plugin-config-merging/pom.xml delete mode 100644 maven-project/src/test/resources-project-builder/plugin-exec-config-order/pom.xml diff --git a/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java b/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java index 5a33a193df..eb4f1fac8e 100644 --- a/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java +++ b/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java @@ -91,7 +91,7 @@ public class PomConstructionTest assertEquals( 1, ( (List) pom.getValue( "build/plugins[1]/dependencies" ) ).size() ); } - /* FIXME: cf. MNG-3821 + /** MNG-3821 */ public void testErroneousJoiningOfDifferentPluginsWithEqualExecutionIds() throws Exception { @@ -105,7 +105,6 @@ public class PomConstructionTest assertEquals( "maven-it-plugin-b", pom.getValue( "reporting/plugins[2]/artifactId" ) ); assertEquals( 1, ( (List) pom.getValue( "reporting/plugins[1]/reportSets" ) ).size() ); } - //*/ /** MNG-3965 */ public void testExecutionConfigurationSubcollections() @@ -127,7 +126,6 @@ public class PomConstructionTest throws Exception { PomTestWrapper pom = buildPom( "dual-execution-ids/sub" ); - // System.out.println(pom.getDomainModel().asString()); assertEquals( 1, ( (List) pom.getValue( "build/plugins[1]/executions" ) ).size() ); } @@ -520,6 +518,25 @@ public class PomConstructionTest } //*/ + /* FIXME: cf. MNG-3836 + public void testMergeOfInheritedPluginConfiguration() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-config-merging/child" ); + String prefix = "build/plugins[1]/configuration/"; + assertEquals( "PASSED", pom.getValue( prefix + "propertiesFile" ) ); + assertEquals( "PASSED", pom.getValue( prefix + "parent" ) ); + assertEquals( "PASSED-1", pom.getValue( prefix + "stringParams/stringParam[1]" ) ); + assertEquals( "PASSED-2", pom.getValue( prefix + "stringParams/stringParam[2]" ) ); + assertEquals( "PASSED-3", pom.getValue( prefix + "stringParams/stringParam[3]" ) ); + assertEquals( "PASSED-4", pom.getValue( prefix + "stringParams/stringParam[4]" ) ); + assertEquals( "PASSED-1", pom.getValue( prefix + "listParam/listParam[1]" ) ); + assertEquals( "PASSED-2", pom.getValue( prefix + "listParam/listParam[2]" ) ); + assertEquals( "PASSED-3", pom.getValue( prefix + "listParam/listParam[3]" ) ); + assertEquals( "PASSED-4", pom.getValue( prefix + "listParam/listParam[4]" ) ); + } + //*/ + private PomArtifactResolver artifactResolver( String basedir ) { return new FileBasedPomArtifactResolver( new File( BASE_POM_DIR, basedir ) ); diff --git a/maven-project/src/test/resources-project-builder/plugin-config-merging/child/pom.xml b/maven-project/src/test/resources-project-builder/plugin-config-merging/child/pom.xml new file mode 100644 index 0000000000..dd5fe00885 --- /dev/null +++ b/maven-project/src/test/resources-project-builder/plugin-config-merging/child/pom.xml @@ -0,0 +1,76 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.mng3836 + parent + 1.0-SNAPSHOT + + + org.apache.maven.its.mng3836 + child + 1.0-SNAPSHOT + + Maven Integration Test :: MNG-3836 + + Verify that children can *override* inherited plugin configuration. + + + + + + org.apache.maven.its.plugins + maven-it-plugin-configuration + 2.1-SNAPSHOT + + + PASSED + + PASSED-1 + PASSED-3 + PASSED-2 + PASSED-4 + + + PASSED-1 + PASSED-3 + PASSED-2 + PASSED-4 + + + + + validate + + config + + + + + + + diff --git a/maven-project/src/test/resources-project-builder/plugin-config-merging/pom.xml b/maven-project/src/test/resources-project-builder/plugin-config-merging/pom.xml new file mode 100644 index 0000000000..e96d6e1534 --- /dev/null +++ b/maven-project/src/test/resources-project-builder/plugin-config-merging/pom.xml @@ -0,0 +1,72 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3836 + parent + 1.0-SNAPSHOT + pom + + Maven Integration Test :: MNG-3836 + + Verify that children can *override* inherited plugin configuration. + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-configuration + 2.1-SNAPSHOT + + FAILED + + FAILED-1 + FAILED-3 + FAILED-2 + FAILED-4 + + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-configuration + 2.1-SNAPSHOT + + FAILED + + FAILED-1 + FAILED-3 + FAILED-2 + FAILED-4 + + PASSED + + + + + diff --git a/maven-project/src/test/resources-project-builder/plugin-exec-config-order/pom.xml b/maven-project/src/test/resources-project-builder/plugin-exec-config-order/pom.xml deleted file mode 100644 index 7401a94b1a..0000000000 --- a/maven-project/src/test/resources-project-builder/plugin-exec-config-order/pom.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - 4.0.0 - - org.apache.maven.its.mng3864 - test1 - 1.0-SNAPSHOT - - Maven Integration Test :: MNG-3864 - - Verify that plain per-execution plugin configuration works correctly. - - - - - - - - org.apache.maven.its.plugins - maven-it-plugin-configuration - 2.1-SNAPSHOT - - - - - - org.apache.maven.its.plugins - maven-it-plugin-configuration - - - validate - - config - - - target/plugin-config.properties - true - 42 - -12345 - 0 - 9876543210 - 0.0 - -1.5 - X - Hello World! - pom.xml - 2008-11-09 11:59:03.0 PM - http://maven.apache.org/ - - one - two - three - four - - - one - two - three - four - - - item - item - - - value1 - value2 - - - - key1 - value1 - - - key2 - value2 - - - - field - setter - - - one - two - three - four - - - - - - - -