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 2011/07/27 15:28:43 UTC

svn commit: r1151459 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/MavenITmng4112MavenVersionPropertyTest.java resources/mng-4112/pom.xml

Author: bentmann
Date: Wed Jul 27 13:28:42 2011
New Revision: 1151459

URL: http://svn.apache.org/viewvc?rev=1151459&view=rev
Log:
o Decoupled from production plugin

Modified:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4112MavenVersionPropertyTest.java
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4112/pom.xml

Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4112MavenVersionPropertyTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4112MavenVersionPropertyTest.java?rev=1151459&r1=1151458&r2=1151459&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4112MavenVersionPropertyTest.java (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4112MavenVersionPropertyTest.java Wed Jul 27 13:28:42 2011
@@ -29,30 +29,33 @@ import java.util.Properties;
 public class MavenITmng4112MavenVersionPropertyTest
     extends AbstractMavenIntegrationTestCase
 {
+
     public MavenITmng4112MavenVersionPropertyTest()
     {
         super( "(3.0.3,)" );
     }
 
     /**
-     * Test simple POM interpolation
+     * Test for ${maven.version} and ${maven.build.version} property
      */
-    public void testitMNG4112()
+    public void testit()
         throws Exception
     {
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4112" );
+
         Verifier verifier = newVerifier( testDir.getAbsolutePath() );
         verifier.setAutoclean( false );
         verifier.deleteDirectory( "target" );
-        verifier.executeGoal( "package" );
+        verifier.executeGoal( "validate" );
 
-        Properties props = verifier.loadProperties( "target/build.properties" );
+        Properties props = verifier.loadProperties( "target/pom.properties" );
 
-        String testMavenVersion = props.getProperty( "maven.version" );
-        assertFalse( testMavenVersion.contains( "$" ) );
+        String testMavenVersion = props.getProperty( "project.properties.simpleVersion", "" );
+        assertFalse( testMavenVersion, testMavenVersion.contains( "$" ) );
+        assertTrue( testMavenVersion, testMavenVersion.matches( "[0-9]+\\.[0-9]+.*" ) );
 
-        String testMavenBuildVersion = props.getProperty( "maven.build.version" );
-        assertTrue( testMavenBuildVersion.contains( testMavenVersion ) );
+        String testMavenBuildVersion = props.getProperty( "project.properties.fullVersion", "" );
+        assertTrue( testMavenBuildVersion, testMavenBuildVersion.contains( testMavenVersion ) );
 
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();

Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4112/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4112/pom.xml?rev=1151459&r1=1151458&r2=1151459&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4112/pom.xml (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4112/pom.xml Wed Jul 27 13:28:42 2011
@@ -1,32 +1,61 @@
+<?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>
-  <name>Maven Integration Test :: MNG-4112</name> 
+
   <groupId>org.apache.maven.its.mgn4112</groupId>
-  <artifactId>maven-it-mng4112</artifactId>
-  <description>Test for ${maven.version} property</description>
+  <artifactId>test</artifactId>
   <packaging>pom</packaging>
   <version>1.0</version>
+
+  <name>Maven Integration Test :: MNG-4112</name> 
+  <description>
+    Test for ${maven.version} and ${maven.build.version} property
+  </description>
+
+  <properties>
+    <simpleVersion>${maven.version}</simpleVersion>
+    <fullVersion>${maven.build.version}</fullVersion>
+  </properties>
+
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-antrun-plugin</artifactId>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-expression</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <configuration>
+          <outputFile>target/pom.properties</outputFile>
+          <expressions>
+            <expression>project/properties</expression>
+          </expressions>
+        </configuration>
         <executions>
           <execution>
-            <phase>package</phase>
+            <id>test</id>
+            <phase>validate</phase>
             <goals>
-              <goal>run</goal>
+              <goal>eval</goal>
             </goals>
-            <configuration>
-              <tasks>
-                <mkdir dir="${project.build.directory}"/>
-                <echo file="${project.build.directory}/build.properties"
-                      message="maven.version = ${maven.version}${line.separator}"/>
-                <echo file="${project.build.directory}/build.properties"
-                      append="true"
-                      message="maven.build.version = ${maven.build.version}${line.separator}"/>
-              </tasks>
-            </configuration>
           </execution>
         </executions>
       </plugin>