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 2008/10/21 23:00:14 UTC

svn commit: r706767 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/IntegrationTestSuite.java java/org/apache/maven/it/MavenIT0091Test.java resources/it0091/pom.xml resources/it0091/src/

Author: bentmann
Date: Tue Oct 21 14:00:14 2008
New Revision: 706767

URL: http://svn.apache.org/viewvc?rev=706767&view=rev
Log:
o Decoupled it0091 from production plugins
o Enabled it0091 for Maven 3.x where it's passing (i.e. MNG-1995 is apparently fixed)

Removed:
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0091/src/
Modified:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0091Test.java
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0091/pom.xml

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=706767&r1=706766&r2=706767&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 Tue Oct 21 14:00:14 2008
@@ -184,6 +184,7 @@
         suite.addTestSuite( MavenIT0096Test.class );
         suite.addTestSuite( MavenIT0095Test.class );
         suite.addTestSuite( MavenIT0092Test.class );
+        suite.addTestSuite( MavenIT0091Test.class );
         suite.addTestSuite( MavenIT0090Test.class );
         suite.addTestSuite( MavenIT0088Test.class );
         suite.addTestSuite( MavenIT0087Test.class );
@@ -287,7 +288,6 @@
         // suite.addTestSuite( MavenIT0124PomExtensionComponentOverrideTest.class ); -- MNG-2771
 
         // suite.addTestSuite( MavenIT0126TestJarDependency.class ); // MJAR-75 / MNG-3160
-        // suite.addTestSuite(MavenIT0091Test.class); // MNG-3160
 
         return suite;
     }

Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0091Test.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0091Test.java?rev=706767&r1=706766&r2=706767&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0091Test.java (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0091Test.java Tue Oct 21 14:00:14 2008
@@ -23,29 +23,39 @@
 import org.apache.maven.it.util.ResourceExtractor;
 
 import java.io.File;
+import java.util.Properties;
 
 /**
- * # it0091 currrently fails. Not sure if there is an associated JIRA.
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-1995">MNG-1995</a>.
+ * 
+ * @author Benjamin Bentmann
+ * @version $Id$
  */
 public class MavenIT0091Test
     extends AbstractMavenIntegrationTestCase
 {
 
+    public MavenIT0091Test()
+    {
+        super( "(2.999.0,)" );
+    }
+
     /**
-     * Test that currently demonstrates that properties are not correctly
-     * interpolated into other areas in the POM. This may strictly be a boolean
-     * problem: I captured the problem as it was reported.
+     * Verify that POM fields that are of type boolean can be interpolated with expressions.
      */
-    public void testit0091()
+    public void testitMNG1995()
         throws Exception
     {
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0091" );
+
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        verifier.executeGoal( "test" );
-        verifier.assertFilePresent( "target/classes/test.properties" );
+
+        verifier.executeGoal( "validate" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 
+        Properties props = verifier.loadProperties( "target/expression.properties" );
+        assertEquals( "true", props.getProperty( "project.build.resources.0.filtering" ) );
     }
-}
 
+}

Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0091/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0091/pom.xml?rev=706767&r1=706766&r2=706767&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0091/pom.xml (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0091/pom.xml Tue Oct 21 14:00:14 2008
@@ -1,41 +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>
-  <name>Maven Integration Test :: it0091</name> 
-  <groupId>org.apache.maven.its.it0091</groupId>
-  <artifactId>maven-it-it0091</artifactId>
-  <description>Test that currently demonstrates that properties are not correctly
-        interpolated into other areas in the POM. This may strictly be a boolean
-        problem: I captured the problem as it was reported.</description>
+
+  <groupId>org.apache.maven.its.mng1995</groupId>
+  <artifactId>test1</artifactId>
   <version>1.0</version>
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-      <type>jar</type>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
+
+  <name>Maven Integration Test :: MNG-1995</name> 
+  <description>
+    Verify that POM fields that are of type boolean can be interpolated with expressions.
+  </description>
+
   <properties>
     <filter.resources>true</filter.resources>
-    <name>jason</name>
   </properties>
+
   <build>
     <resources>
       <resource>
         <directory>src/main/resources</directory>
-        <filtering>true</filtering>
-        <!--
-        <filtering>${filtering.resources}</filtering>
-        -->
+        <!-- That's the boolean POM field we would like to interpolate -->
+        <filtering>${filter.resources}</filtering>
       </resource>    
-      <resource>
-        <directory>${project.build.sourceDirectory}</directory>
-        <filtering>true</filtering>
-        <includes>
-          <include>**/*.properties</include>
-        </includes>
-      </resource>
     </resources>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-expression</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <configuration>
+          <outputFile>target/expression.properties</outputFile>
+          <expressions>
+            <expression>project/build/resources/0/filtering</expression>
+          </expressions>
+        </configuration>
+        <executions>
+          <execution>
+            <id>test</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>eval</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
   </build>
 </project>