You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/01/23 17:06:38 UTC

svn commit: r737066 - in /maven/components/trunk/maven-project/src/test: java/org/apache/maven/project/builder/ resources-project-builder/plugin-exec-config-order/ resources-project-builder/plugin-exec-config-order/w-plugin-mngt/ resources-project-buil...

Author: bentmann
Date: Fri Jan 23 08:06:37 2009
New Revision: 737066

URL: http://svn.apache.org/viewvc?rev=737066&view=rev
Log:
o Created UT for MNG-3864

Added:
    maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/   (with props)
    maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/pom.xml   (with props)
    maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/   (with props)
    maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/pom.xml   (with props)
    maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/   (with props)
    maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/pom.xml   (with props)
Modified:
    maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java

Modified: maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java?rev=737066&r1=737065&r2=737066&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java (original)
+++ maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java Fri Jan 23 08:06:37 2009
@@ -492,6 +492,34 @@
     }
     //*/
 
+    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 ) );

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/
------------------------------------------------------------------------------
    bugtraq:label = Enter issue ID:

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/
------------------------------------------------------------------------------
    bugtraq:message = Issue id: %BUGID%

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/
------------------------------------------------------------------------------
    bugtraq:number = false

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/
------------------------------------------------------------------------------
    bugtraq:url = http://jira.codehaus.org/browse/%BUGID%

Added: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/pom.xml?rev=737066&view=auto
==============================================================================
--- maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/pom.xml (added)
+++ maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/pom.xml Fri Jan 23 08:06:37 2009
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng3864</groupId>
+  <artifactId>test1</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>Maven Integration Test :: MNG-3864</name> 
+  <description>
+    Verify that plain per-execution plugin configuration works correctly.
+  </description>
+
+  <build>
+    <pluginManagement>
+      <!--
+      NOTE: The usage of <pluginManagement> for the employed IT plugin is crucial to exhibit the bug!
+      -->
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.its.plugins</groupId>
+          <artifactId>maven-it-plugin-configuration</artifactId>
+          <version>2.1-SNAPSHOT</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-configuration</artifactId>
+        <executions>
+          <execution>
+            <phase>validate</phase>
+            <goals>
+              <goal>config</goal>
+            </goals>
+            <configuration>
+              <propertiesFile>target/plugin-config.properties</propertiesFile>
+              <booleanParam>true</booleanParam>
+              <byteParam>42</byteParam>
+              <shortParam>-12345</shortParam>
+              <integerParam>0</integerParam>
+              <longParam>9876543210</longParam>
+              <floatParam>0.0</floatParam>
+              <doubleParam>-1.5</doubleParam>
+              <characterParam>X</characterParam>
+              <stringParam>Hello World!</stringParam>
+              <fileParam>pom.xml</fileParam>
+              <dateParam>2008-11-09 11:59:03.0 PM</dateParam>
+              <urlParam>http://maven.apache.org/</urlParam>
+              <stringParams>
+                <stringParam>one</stringParam>
+                <stringParam>two</stringParam>
+                <stringParam>three</stringParam>
+                <stringParam>four</stringParam>
+              </stringParams>
+              <listParam>
+                <listParam>one</listParam>
+                <listParam>two</listParam>
+                <listParam>three</listParam>
+                <listParam>four</listParam>
+              </listParam>
+              <setParam>
+                <setParam>item</setParam>
+                <setParam>item</setParam>
+              </setParam>
+              <mapParam>
+                <key1>value1</key1>
+                <key2>value2</key2>
+              </mapParam>
+              <propertiesParam>
+                <property>
+                  <name>key1</name>
+                  <value>value1</value>
+                </property>
+                <property>
+                  <name>key2</name>
+                  <value>value2</value>
+                </property>
+              </propertiesParam>
+              <beanParam>
+                <fieldParam>field</fieldParam>
+                <setterParam>setter</setterParam>
+              </beanParam>
+              <domParam>
+                <echo>one</echo>
+                <echo>two</echo>
+                <echo>three</echo>
+                <echo>four</echo>
+              </domParam>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/
------------------------------------------------------------------------------
    bugtraq:label = Enter issue ID:

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/
------------------------------------------------------------------------------
    bugtraq:message = Issue id: %BUGID%

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/
------------------------------------------------------------------------------
    bugtraq:number = false

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/
------------------------------------------------------------------------------
    bugtraq:url = http://jira.codehaus.org/browse/%BUGID%

Added: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/pom.xml?rev=737066&view=auto
==============================================================================
--- maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/pom.xml (added)
+++ maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/pom.xml Fri Jan 23 08:06:37 2009
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng3827</groupId>
+  <artifactId>test2</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>Maven Integration Test :: MNG-3864</name> 
+  <description>
+    Verify that plain per-execution plugin configuration works correctly.
+  </description>
+
+  <build>
+    <!-- This project uses plugin management for the test plugin -->
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.its.plugins</groupId>
+          <artifactId>maven-it-plugin-configuration</artifactId>
+          <version>2.1-SNAPSHOT</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-configuration</artifactId>
+        <executions>
+          <execution>
+            <phase>validate</phase>
+            <goals>
+              <goal>config</goal>
+            </goals>
+            <configuration>
+              <stringParams>
+                <stringParam>one</stringParam>
+                <stringParam>two</stringParam>
+                <stringParam>three</stringParam>
+                <stringParam>four</stringParam>
+              </stringParams>
+              <propertiesParam>
+                <property>
+                  <name>key1</name>
+                  <value>value1</value>
+                </property>
+                <property>
+                  <name>key2</name>
+                  <value>value2</value>
+                </property>
+              </propertiesParam>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/
------------------------------------------------------------------------------
    bugtraq:label = Enter issue ID:

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/
------------------------------------------------------------------------------
    bugtraq:message = Issue id: %BUGID%

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/
------------------------------------------------------------------------------
    bugtraq:number = false

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/
------------------------------------------------------------------------------
    bugtraq:url = http://jira.codehaus.org/browse/%BUGID%

Added: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/pom.xml?rev=737066&view=auto
==============================================================================
--- maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/pom.xml (added)
+++ maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/pom.xml Fri Jan 23 08:06:37 2009
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng3827</groupId>
+  <artifactId>test1</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>Maven Integration Test :: MNG-3864</name> 
+  <description>
+    Verify that plain per-execution plugin configuration works correctly.
+  </description>
+
+  <build>
+    <!-- This project does not use plugin management for the test plugin -->
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-configuration</artifactId>
+        <executions>
+          <execution>
+            <phase>validate</phase>
+            <goals>
+              <goal>config</goal>
+            </goals>
+            <configuration>
+              <stringParams>
+                <stringParam>one</stringParam>
+                <stringParam>two</stringParam>
+                <stringParam>three</stringParam>
+                <stringParam>four</stringParam>
+              </stringParams>
+              <propertiesParam>
+                <property>
+                  <name>key1</name>
+                  <value>value1</value>
+                </property>
+                <property>
+                  <name>key2</name>
+                  <value>value2</value>
+                </property>
+              </propertiesParam>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision