From 2e4285f616ae6fba25ac1d371085025704c6e590 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Fri, 23 Jan 2009 16:06:37 +0000 Subject: [PATCH] o Created UT for MNG-3864 git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@737066 13f79535-47bb-0310-9956-ffa450edef68 --- .../project/builder/PomConstructionTest.java | 28 +++++ .../plugin-exec-config-order/pom.xml | 117 ++++++++++++++++++ .../w-plugin-mngt/pom.xml | 78 ++++++++++++ .../wo-plugin-mngt/pom.xml | 69 +++++++++++ 4 files changed, 292 insertions(+) create mode 100644 maven-project/src/test/resources-project-builder/plugin-exec-config-order/pom.xml create mode 100644 maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/pom.xml create mode 100644 maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/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 35b8f7e9c3..5a33a193df 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 @@ -492,6 +492,34 @@ public class PomConstructionTest } //*/ + public void testOrderOfPluginExecutionConfigurationElementsWithoutPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-config-order/wo-plugin-mngt" ); + String prefix = "build/plugins[1]/executions[1]/configuration/"; + assertEquals( "one", pom.getValue( prefix + "stringParams/stringParam[1]" ) ); + assertEquals( "two", pom.getValue( prefix + "stringParams/stringParam[2]" ) ); + assertEquals( "three", pom.getValue( prefix + "stringParams/stringParam[3]" ) ); + assertEquals( "four", pom.getValue( prefix + "stringParams/stringParam[4]" ) ); + assertEquals( "key1", pom.getValue( prefix + "propertiesParam/property[1]/name" ) ); + assertEquals( "key2", pom.getValue( prefix + "propertiesParam/property[2]/name" ) ); + } + + /* FIXME: cf. MNG-3864 + public void testOrderOfPluginExecutionConfigurationElementsWithPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-config-order/w-plugin-mngt" ); + String prefix = "build/plugins[1]/executions[1]/configuration/"; + assertEquals( "one", pom.getValue( prefix + "stringParams/stringParam[1]" ) ); + assertEquals( "two", pom.getValue( prefix + "stringParams/stringParam[2]" ) ); + assertEquals( "three", pom.getValue( prefix + "stringParams/stringParam[3]" ) ); + assertEquals( "four", pom.getValue( prefix + "stringParams/stringParam[4]" ) ); + assertEquals( "key1", pom.getValue( prefix + "propertiesParam/property[1]/name" ) ); + assertEquals( "key2", pom.getValue( prefix + "propertiesParam/property[2]/name" ) ); + } + //*/ + 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-exec-config-order/pom.xml b/maven-project/src/test/resources-project-builder/plugin-exec-config-order/pom.xml new file mode 100644 index 0000000000..7401a94b1a --- /dev/null +++ b/maven-project/src/test/resources-project-builder/plugin-exec-config-order/pom.xml @@ -0,0 +1,117 @@ + + + + + + 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 + + + + + + + + diff --git a/maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/pom.xml b/maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/pom.xml new file mode 100644 index 0000000000..a5ecf1ba6f --- /dev/null +++ b/maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/pom.xml @@ -0,0 +1,78 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3827 + test2 + 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 + + + + one + two + three + four + + + + key1 + value1 + + + key2 + value2 + + + + + + + + + diff --git a/maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/pom.xml b/maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/pom.xml new file mode 100644 index 0000000000..5a5f4c726b --- /dev/null +++ b/maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/pom.xml @@ -0,0 +1,69 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3827 + 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 + + + validate + + config + + + + one + two + three + four + + + + key1 + value1 + + + key2 + value2 + + + + + + + + +