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/30 17:09:56 UTC
svn commit: r739321 - in
/maven/core-integration-testing/trunk/core-it-suite/src/test:
java/org/apache/maven/it/ resources/mng-4016/
Author: bentmann
Date: Fri Jan 30 16:09:55 2009
New Revision: 739321
URL: http://svn.apache.org/viewvc?rev=739321&view=rev
Log:
[MNG-4016] Properties with the prefix project/pom are not interpolated from the properties section
o Added IT
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4016PrefixedPropertyInterpolationTest.java (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4016/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4016/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=739321&r1=739320&r2=739321&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 30 16:09:55 2009
@@ -90,6 +90,7 @@
// suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
+ suite.addTestSuite( MavenITmng4016PrefixedPropertyInterpolationTest.class );
suite.addTestSuite( MavenITmng4009InheritProfileEffectsTest.class );
suite.addTestSuite( MavenITmng4008MergedFilterOrderTest.class );
suite.addTestSuite( MavenITmng4007PlatformFileSeparatorTest.class );
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4016PrefixedPropertyInterpolationTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4016PrefixedPropertyInterpolationTest.java?rev=739321&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4016PrefixedPropertyInterpolationTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4016PrefixedPropertyInterpolationTest.java Fri Jan 30 16:09:55 2009
@@ -0,0 +1,66 @@
+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-4016">MNG-4016</a>.
+ *
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class MavenITmng4016PrefixedPropertyInterpolationTest
+ extends AbstractMavenIntegrationTestCase
+{
+
+ public MavenITmng4016PrefixedPropertyInterpolationTest()
+ {
+ super( "(2.1.0-M1,)" );
+ }
+
+ /**
+ * Test that expressions with the special prefixes "project.", "pom." and "env." can be interpolated from
+ * properties that include the prefix.
+ */
+ public void testitMNG4016()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4016" );
+
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.deleteDirectory( "target" );
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ verifier.assertFilePresent( "target/model.properties" );
+ Properties props = verifier.loadProperties( "target/model.properties" );
+ assertEquals( "PASSED-1", props.getProperty( "project.properties.projectProperty" ) );
+ assertEquals( "PASSED-2", props.getProperty( "project.properties.pomProperty" ) );
+ assertEquals( "PASSED-3", props.getProperty( "project.properties.envProperty" ) );
+ }
+
+}
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4016PrefixedPropertyInterpolationTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4016PrefixedPropertyInterpolationTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4016/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4016/pom.xml?rev=739321&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4016/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4016/pom.xml Fri Jan 30 16:09:55 2009
@@ -0,0 +1,70 @@
+<?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.mng4016</groupId>
+ <artifactId>test</artifactId>
+ <version>0.1</version>
+ <packaging>pom</packaging>
+
+ <name>Maven Integration Test :: MNG-4016</name>
+ <description>
+ Test that expressions with the special prefixes "project.", "pom." and "env." can be interpolated from
+ properties that include the prefix.
+ </description>
+
+ <properties>
+ <!-- source properties for the expressions to evaluate -->
+ <project.theTestProperty>PASSED-1</project.theTestProperty>
+ <pom.anotherTestProperty>PASSED-2</pom.anotherTestProperty>
+ <env.yetAnotherTestProperty>PASSED-3</env.yetAnotherTestProperty>
+ <!-- interpolation targets -->
+ <projectProperty>${project.theTestProperty}</projectProperty>
+ <pomProperty>${pom.anotherTestProperty}</pomProperty>
+ <envProperty>${env.yetAnotherTestProperty}</envProperty>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-expression</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>eval</goal>
+ </goals>
+ <configuration>
+ <outputFile>target/model.properties</outputFile>
+ <expressions>
+ <expression>project/properties</expression>
+ </expressions>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4016/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4016/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision