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/11/29 13:20:49 UTC
svn commit: r721671 - in
/maven/core-integration-testing/trunk/core-it-suite/src/test:
java/org/apache/maven/it/ resources/mng-3475/ resources/mng-3877/
Author: bentmann
Date: Sat Nov 29 04:20:49 2008
New Revision: 721671
URL: http://svn.apache.org/viewvc?rev=721671&view=rev
Log:
[MNG-3877] Reporting output directory not basedir aligned when queried from MavenProject
o Added IT
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3877BasedirAlignedModelTest.java (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3877/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3877/pom.xml (with props)
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/MavenITmng3475BaseAlignedDirTest.java
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3475/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=721671&r1=721670&r2=721671&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 Sat Nov 29 04:20:49 2008
@@ -88,6 +88,7 @@
// suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
+ suite.addTestSuite( MavenITmng3877BasedirAlignedModelTest.class );
suite.addTestSuite( MavenITmng3866PluginConfigInheritanceTest.class );
suite.addTestSuite( MavenITmng3864PerExecPluginConfigTest.class );
suite.addTestSuite( MavenITmng3863AutoPluginGroupIdTest.class );
Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3475BaseAlignedDirTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3475BaseAlignedDirTest.java?rev=721671&r1=721670&r2=721671&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3475BaseAlignedDirTest.java (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3475BaseAlignedDirTest.java Sat Nov 29 04:20:49 2008
@@ -42,7 +42,7 @@
}
/**
- * Verify that project directories are basedir aligned when inspected by plugins.
+ * Verify that project directories are basedir aligned when queried by plugin parameter expressions.
*/
public void testitMNG3475()
throws Exception
@@ -56,46 +56,33 @@
verifier.verifyErrorFreeLog();
verifier.resetStreams();
- /*
- * NOTE: The script source directory is deliberately excluded from the checks due to MNG-3741.
- */
-
Properties configProps = verifier.loadProperties( "target/config.properties" );
- Properties modelProps = verifier.loadProperties( "target/model.properties" );
assertPathEquals( testDir, "target", configProps.getProperty( "mapParam.buildDirectory" ) );
- assertPathEquals( testDir, "target", modelProps.getProperty( "project.build.directory" ) );
assertPathEquals( testDir, "target/classes", configProps.getProperty( "mapParam.buildOutputDirectory" ) );
- assertPathEquals( testDir, "target/classes", modelProps.getProperty( "project.build.outputDirectory" ) );
assertPathEquals( testDir, "target/test-classes", configProps.getProperty( "mapParam.buildTestOutputDirectory" ) );
- assertPathEquals( testDir, "target/test-classes", modelProps.getProperty( "project.build.testOutputDirectory" ) );
assertPathEquals( testDir, "src/main/java", configProps.getProperty( "mapParam.buildSourceDirectory" ) );
- assertPathEquals( testDir, "src/main/java", modelProps.getProperty( "project.build.sourceDirectory" ) );
assertPathEquals( testDir, "src/test/java", configProps.getProperty( "mapParam.buildTestSourceDirectory" ) );
- assertPathEquals( testDir, "src/test/java", modelProps.getProperty( "project.build.testSourceDirectory" ) );
if ( matchesVersionRange( "[2.1.0-M1,)" ) )
{
assertPathEquals( testDir, "target/site", configProps.getProperty( "mapParam.reportingOutputDirectory" ) );
- assertPathEquals( testDir, "target/site", modelProps.getProperty( "project.reporting.outputDirectory" ) );
}
- assertPathEquals( testDir, "src/main/resources", modelProps.getProperty( "project.build.resources.0.directory" ) );
-
- assertPathEquals( testDir, "src/test/resources", modelProps.getProperty( "project.build.testResources.0.directory" ) );
-
- assertPathEquals( testDir, "src/main/filters/it.properties", modelProps.getProperty( "project.build.filters.0" ) );
+ /*
+ * NOTE: The script source directory is deliberately excluded from the checks due to MNG-3741.
+ */
}
- private void assertPathEquals( File basedir, String subdir, String path )
+ private void assertPathEquals( File basedir, String expected, String actual )
{
- File actual = new File( path );
- assertTrue( "path not absolute: " + actual, actual.isAbsolute() );
- assertEquals( new File( basedir, subdir ), actual );
+ File actualFile = new File( actual );
+ assertTrue( "path not absolute: " + actualFile, actualFile.isAbsolute() );
+ assertEquals( new File( basedir, expected ), actualFile );
}
}
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3877BasedirAlignedModelTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3877BasedirAlignedModelTest.java?rev=721671&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3877BasedirAlignedModelTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3877BasedirAlignedModelTest.java Sat Nov 29 04:20:49 2008
@@ -0,0 +1,95 @@
+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-3877">MNG-3877</a>.
+ *
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class MavenITmng3877BasedirAlignedModelTest
+ extends AbstractMavenIntegrationTestCase
+{
+
+ public MavenITmng3877BasedirAlignedModelTest()
+ {
+ }
+
+ /**
+ * Verify that project directories are basedir aligned when inspected by plugins via the MavenProject instance.
+ */
+ public void testitMNG3877()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3877" );
+
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.deleteDirectory( "target" );
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ Properties modelProps = verifier.loadProperties( "target/model.properties" );
+
+ assertPathEquals( testDir, "target", modelProps.getProperty( "project.build.directory" ) );
+
+ assertPathEquals( testDir, "target/classes", modelProps.getProperty( "project.build.outputDirectory" ) );
+
+ assertPathEquals( testDir, "target/test-classes", modelProps.getProperty( "project.build.testOutputDirectory" ) );
+
+ assertPathEquals( testDir, "src/main/java", modelProps.getProperty( "project.build.sourceDirectory" ) );
+ assertPathEquals( testDir, "src/main/java", modelProps.getProperty( "project.compileSourceRoots.0" ) );
+
+ assertPathEquals( testDir, "src/test/java", modelProps.getProperty( "project.build.testSourceDirectory" ) );
+ assertPathEquals( testDir, "src/test/java", modelProps.getProperty( "project.testCompileSourceRoots.0" ) );
+
+ assertPathEquals( testDir, "src/main/resources", modelProps.getProperty( "project.build.resources.0.directory" ) );
+
+ assertPathEquals( testDir, "src/test/resources", modelProps.getProperty( "project.build.testResources.0.directory" ) );
+
+ assertPathEquals( testDir, "src/main/filters/it.properties", modelProps.getProperty( "project.build.filters.0" ) );
+
+ /*
+ * NOTE: The script source directory is deliberately excluded from the checks due to MNG-3741.
+ */
+
+ // FIXME: MNG-3877
+ if ( matchesVersionRange( "(4,)" ) )
+ {
+ assertPathEquals( testDir, "target/site", modelProps.getProperty( "project.reporting.outputDirectory" ) );
+ }
+ }
+
+ private void assertPathEquals( File basedir, String expected, String actual )
+ {
+ File actualFile = new File( actual );
+ assertTrue( "path not absolute: " + actualFile, actualFile.isAbsolute() );
+ assertEquals( new File( basedir, expected ), actualFile );
+ }
+
+}
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3877BasedirAlignedModelTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3877BasedirAlignedModelTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3475/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3475/pom.xml?rev=721671&r1=721670&r2=721671&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3475/pom.xml (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3475/pom.xml Sat Nov 29 04:20:49 2008
@@ -29,16 +29,23 @@
<name>Maven Integration Test :: MNG-3475</name>
<description>
- Verify that project directories are basedir aligned when inspected by plugins.
+ Verify that project directories are basedir aligned when queried by plugin parameter expressions.
</description>
<build>
- <filters>
- <filter>src/main/filters/it.properties</filter>
- </filters>
+ <!--
+ NOTE: Deliberately re-specify default paths to decouple from super POM and interpolation. Proper handling of
+ *relative* paths is the whole point of this test.
+ -->
+ <sourceDirectory>src/main/java</sourceDirectory>
+ <testSourceDirectory>src/test/java</testSourceDirectory>
+ <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
+ <directory>target</directory>
+ <outputDirectory>target/classes</outputDirectory>
+ <testOutputDirectory>target/test-classes</testOutputDirectory>
+
<plugins>
<plugin>
- <!-- This checks the project directories retrieved via plugin configuration -->
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-configuration</artifactId>
<version>2.1-SNAPSHOT</version>
@@ -64,36 +71,14 @@
</execution>
</executions>
</plugin>
- <plugin>
- <!-- This checks the project directories as retrieved via pure MavenProjet API -->
- <groupId>org.apache.maven.its.plugins</groupId>
- <artifactId>maven-it-plugin-expression</artifactId>
- <version>2.1-SNAPSHOT</version>
- <configuration>
- <outputFile>target/model.properties</outputFile>
- <expressions>
- <expression>project/build/directory</expression>
- <expression>project/build/outputDirectory</expression>
- <expression>project/build/testOutputDirectory</expression>
- <expression>project/build/sourceDirectory</expression>
- <expression>project/build/testSourceDirectory</expression>
- <expression>project/build/scriptSourceDirectory</expression>
- <expression>project/build/resources/0/directory</expression>
- <expression>project/build/testResources/0/directory</expression>
- <expression>project/build/filters/0</expression>
- <expression>project/reporting/outputDirectory</expression>
- </expressions>
- </configuration>
- <executions>
- <execution>
- <id>effective-model</id>
- <phase>validate</phase>
- <goals>
- <goal>eval</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
+
+ <reporting>
+ <!--
+ NOTE: Deliberately re-specify default paths to decouple from super POM and interpolation. Proper handling of
+ *relative* paths is the whole point of this test.
+ -->
+ <outputDirectory>target/site</outputDirectory>
+ </reporting>
</project>
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3877/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3877/pom.xml?rev=721671&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3877/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3877/pom.xml Sat Nov 29 04:20:49 2008
@@ -0,0 +1,103 @@
+<?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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.its.mng3877</groupId>
+ <artifactId>mng3877</artifactId>
+ <version>1.0</version>
+ <packaging>pom</packaging>
+
+ <name>Maven Integration Test :: MNG-3877</name>
+ <description>
+ Verify that project directories are basedir aligned when inspected by plugins.
+ </description>
+
+ <build>
+ <!--
+ NOTE: Deliberately re-specify default paths to decouple from super POM and interpolation. Proper handling of
+ *relative* paths is the whole point of this test.
+ -->
+ <sourceDirectory>src/main/java</sourceDirectory>
+ <testSourceDirectory>src/test/java</testSourceDirectory>
+ <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ </testResources>
+ <directory>target</directory>
+ <outputDirectory>target/classes</outputDirectory>
+ <testOutputDirectory>target/test-classes</testOutputDirectory>
+ <filters>
+ <filter>src/main/filters/it.properties</filter>
+ </filters>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-expression</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <configuration>
+ <outputFile>target/model.properties</outputFile>
+ <expressions>
+ <expression>project/build/directory</expression>
+ <expression>project/build/outputDirectory</expression>
+ <expression>project/build/testOutputDirectory</expression>
+ <expression>project/build/sourceDirectory</expression>
+ <expression>project/build/testSourceDirectory</expression>
+ <expression>project/build/scriptSourceDirectory</expression>
+ <expression>project/build/resources/0/directory</expression>
+ <expression>project/build/testResources/0/directory</expression>
+ <expression>project/build/filters/0</expression>
+ <expression>project/reporting/outputDirectory</expression>
+ <expression>project/compileSourceRoots</expression>
+ <expression>project/testCompileSourceRoots</expression>
+ <expression>project/scriptSourceRoots</expression>
+ </expressions>
+ </configuration>
+ <executions>
+ <execution>
+ <id>effective-model</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>eval</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <!--
+ NOTE: Deliberately re-specify default paths to decouple from super POM and interpolation. Proper handling of
+ *relative* paths is the whole point of this test.
+ -->
+ <outputDirectory>target/site</outputDirectory>
+ </reporting>
+</project>
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3877/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3877/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision