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/16 12:51:11 UTC

svn commit: r734982 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/ resources/mng-1992/

Author: bentmann
Date: Fri Jan 16 03:51:09 2009
New Revision: 734982

URL: http://svn.apache.org/viewvc?rev=734982&view=rev
Log:
[MNG-1992] CLI -D should override properties in settings.xml

o Added IT

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1992SystemPropOverridesPomPropTest.java   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-1992/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-1992/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=734982&r1=734981&r2=734982&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 Fri Jan 16 03:51:09 2009
@@ -230,6 +230,7 @@
         suite.addTestSuite( MavenITmng2006ChildPathAwareUrlInheritanceTest.class );
         suite.addTestSuite( MavenITmng1999DefaultReportsInheritanceTest.class );
         suite.addTestSuite( MavenITmng1995InterpolateBooleanModelElementsTest.class );
+        suite.addTestSuite( MavenITmng1992SystemPropOverridesPomPropTest.class );
         suite.addTestSuite( MavenITmng1908LegacySnapshotUpdateTest.class );
         suite.addTestSuite( MavenITmng1830ShowVersionTest.class );
         suite.addTestSuite( MavenITmng1703PluginMgmtDepInheritanceTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1992SystemPropOverridesPomPropTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1992SystemPropOverridesPomPropTest.java?rev=734982&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1992SystemPropOverridesPomPropTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1992SystemPropOverridesPomPropTest.java Fri Jan 16 03:51:09 2009
@@ -0,0 +1,65 @@
+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-1992">MNG-1992</a>.
+ * 
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class MavenITmng1992SystemPropOverridesPomPropTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng1992SystemPropOverridesPomPropTest()
+    {
+        super( "(2.999,)" );
+    }
+
+    /**
+     * Test that system/execution properties take precedence over the POM's properties section when configuring a
+     * plugin parameter that is annotated with @parameter expression="prop". Note that this issue is not about POM
+     * interpolation but rather plugin parameter expression evaluation.
+     */
+    public void testitMNG1992()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1992" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.getSystemProperties().setProperty( "config.stringParam", "PASSED" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        Properties configProps = verifier.loadProperties( "target/config.properties" );
+        assertEquals( "PASSED", configProps.getProperty( "stringParam" ) );
+    }
+
+}

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-1992/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-1992/pom.xml?rev=734982&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-1992/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-1992/pom.xml Fri Jan 16 03:51:09 2009
@@ -0,0 +1,60 @@
+<?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.mng1992</groupId>
+  <artifactId>test</artifactId>
+  <version>0.1</version>
+
+  <name>Maven Integration Test :: MNG-1992</name>
+  <description>
+    Test that system/execution properties take precedence over the POM's properties section when configuring a
+    plugin parameter that is annotated with @parameter expression="prop". Note that this issue is not about POM
+    interpolation but rather plugin parameter expression evaluation.
+  </description>
+
+  <properties>
+    <config.stringParam>FAILED</config.stringParam>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-configuration</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <phase>validate</phase>
+            <goals>
+              <goal>config</goal>
+            </goals>
+            <configuration>
+              <propertiesFile>target/config.properties</propertiesFile>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

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

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