Author: bentmann
Date: Sun Nov  9 12:24:30 2008
New Revision: 712548

URL: http://svn.apache.org/viewvc?rev=712548&view=rev
Log:
[MNG-3827] Order of collection-valued plugin configuration parameters is 
reversed

o Added IT

Added:
    
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3827PluginConfigTest.java
   (with props)
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3827/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3827/pom.xml
   (with props)
Modified:
    
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java

Modified: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=712548&r1=712547&r2=712548&view=diff
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
 (original)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
 Sun Nov  9 12:24:30 2008
@@ -88,6 +88,7 @@
         // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- 
MNG-3137
 
+        suite.addTestSuite( MavenITmng3827PluginConfigTest.class );
         suite.addTestSuite( 
MavenITmng3822BasedirAlignedInterpolationTest.class );
         suite.addTestSuite( MavenITmng3821EqualPluginExecIdsTest.class );
         suite.addTestSuite( MavenITmng3818PluginDepPlexusUtilsTest.class );

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3827PluginConfigTest.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3827PluginConfigTest.java?rev=712548&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3827PluginConfigTest.java
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3827PluginConfigTest.java
 Sun Nov  9 12:24:30 2008
@@ -0,0 +1,106 @@
+package org.apache.maven.it;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+import java.util.Properties;
+
+/**
+ * This is a test set for <a 
href="http://jira.codehaus.org/browse/MNG-3827";>MNG-3827</a>.
+ * 
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class MavenITmng3827PluginConfigTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng3827PluginConfigTest()
+    {
+    }
+
+    /**
+     * Verify that plain plugin configuration works correctly.
+     */
+    public void testitMNG3827()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), 
"/mng-3827" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        Properties props = verifier.loadProperties( 
"target/plugin-config.properties" );
+
+        assertEquals( new File( testDir, "pom.xml" ), new File( 
props.getProperty( "fileParam" ) ) );
+        assertEquals( "true", props.getProperty( "booleanParam" ) );
+        assertEquals( "42", props.getProperty( "byteParam" ) );
+        assertEquals( "-12345", props.getProperty( "shortParam" ) );
+        assertEquals( "0", props.getProperty( "integerParam" ) );
+        assertEquals( "9876543210", props.getProperty( "longParam" ) );
+        assertEquals( "0.0", props.getProperty( "floatParam" ) );
+        assertEquals( "-1.5", props.getProperty( "doubleParam" ) );
+        assertEquals( "X", props.getProperty( "characterParam" ) );
+        assertEquals( "Hello World!", props.getProperty( "stringParam" ) );
+        assertEquals( "2008-11-09 11:59:03", props.getProperty( "dateParam" ) 
);
+        assertEquals( "http://maven.apache.org/";, props.getProperty( 
"urlParam" ) );
+
+        assertEquals( "4", props.getProperty( "stringParams" ) );
+        assertEquals( "one", props.getProperty( "stringParams.0" ) );
+        assertEquals( "two", props.getProperty( "stringParams.1" ) );
+        assertEquals( "three", props.getProperty( "stringParams.2" ) );
+        assertEquals( "four", props.getProperty( "stringParams.3" ) );
+
+        assertEquals( "4", props.getProperty( "listParam" ) );
+        assertEquals( "one", props.getProperty( "listParam.0" ) );
+        assertEquals( "two", props.getProperty( "listParam.1" ) );
+        assertEquals( "three", props.getProperty( "listParam.2" ) );
+        assertEquals( "four", props.getProperty( "listParam.3" ) );
+
+        assertEquals( "1", props.getProperty( "setParam" ) );
+        assertEquals( "item", props.getProperty( "setParam.0" ) );
+
+        assertEquals( "2", props.getProperty( "mapParam" ) );
+        assertEquals( "value1", props.getProperty( "mapParam.key1" ) );
+        assertEquals( "value2", props.getProperty( "mapParam.key2" ) );
+
+        assertEquals( "2", props.getProperty( "propertiesParam" ) );
+        assertEquals( "value1", props.getProperty( "propertiesParam.key1" ) );
+        assertEquals( "value2", props.getProperty( "propertiesParam.key2" ) );
+
+        assertEquals( "field", props.getProperty( "beanParam.fieldParam" ) );
+        assertEquals( "setter", props.getProperty( "beanParam.setterParam" ) );
+        assertEquals( "true", props.getProperty( "beanParam.setterCalled" ) );
+
+        assertEquals( "4", props.getProperty( "domParam.children" ) );
+        assertEquals( "one", props.getProperty( 
"domParam.children.echo.0.value" ) );
+        assertEquals( "two", props.getProperty( 
"domParam.children.echo.1.value" ) );
+        assertEquals( "three", props.getProperty( 
"domParam.children.echo.2.value" ) );
+        assertEquals( "four", props.getProperty( 
"domParam.children.echo.3.value" ) );
+    }
+
+}

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3827PluginConfigTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3827PluginConfigTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3827/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3827/pom.xml?rev=712548&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3827/pom.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3827/pom.xml
 Sun Nov  9 12:24:30 2008
@@ -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.mng3827</groupId>
+  <artifactId>test1</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>Maven Integration Test :: MNG-3827</name> 
+  <description>
+    Verify that plain 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>
+        <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>
+        <executions>
+          <execution>
+            <phase>validate</phase>
+            <goals>
+              <goal>config</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3827/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3827/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision


Reply via email to