Author: jdcasey
Date: Fri Aug 1 13:38:09 2008
New Revision: 681815
URL: http://svn.apache.org/viewvc?rev=681815&view=rev
Log:
[MNG-3694] integration test for this issue.
Added:
maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3694ReactorProjectsDynamismTest.java
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/maven-mng3694-plugin/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/maven-mng3694-plugin/pom.xml
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/maven-mng3694-plugin/src/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/maven-mng3694-plugin/src/main/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/maven-mng3694-plugin/src/main/java/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/maven-mng3694-plugin/src/main/java/plugin/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/maven-mng3694-plugin/src/main/java/plugin/MyMojo.java
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/project/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/pom.xml
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/main/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/main/java/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/main/java/tests/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/main/java/tests/App.java
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/test/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/test/java/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/test/java/tests/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/test/java/tests/AppTest.java
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/pom.xml
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/pom.xml
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/main/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/main/java/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/main/java/tests/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/main/java/tests/App.java
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/test/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/test/java/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/test/java/tests/
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/test/java/tests/AppTest.java
Modified:
maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java
Modified:
maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java?rev=681815&r1=681814&r2=681815&view=diff
==============================================================================
---
maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java
(original)
+++
maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java
Fri Aug 1 13:38:09 2008
@@ -76,6 +76,7 @@
MavenITmng3645POMSyntaxErrorTest
*/
+ suite.addTestSuite( MavenITmng3694ReactorProjectsDynamismTest.class );
suite.addTestSuite( MavenITmng3693PomFileBasedirChangeTest.class );
suite.addTestSuite( MavenITmng3599useHttpProxyForWebDAV.class );
suite.addTestSuite( MavenITmng3684BuildPluginParameterTest.class );
Added:
maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3694ReactorProjectsDynamismTest.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3694ReactorProjectsDynamismTest.java?rev=681815&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3694ReactorProjectsDynamismTest.java
(added)
+++
maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3694ReactorProjectsDynamismTest.java
Fri Aug 1 13:38:09 2008
@@ -0,0 +1,40 @@
+package org.apache.maven.integrationtests;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.integrationtests.AbstractMavenIntegrationTestCase;
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * Verify that any plugin injecting reactorProjects gets project instances that
+ * have their concrete state calculated.
+ *
+ * @author jdcasey
+ */
+public class MavenITmng3694ReactorProjectsDynamismTest
+ extends AbstractMavenIntegrationTestCase
+{
+ public void testitMNG3694 ()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(),
"/mng-3694-reactorProjectsDynamism" );
+
+ File pluginDir = new File( testDir, "maven-mng3694-plugin" );
+ File projectDir = new File( testDir, "projects" );
+
+ Verifier verifier = new Verifier( pluginDir.getAbsolutePath() );
+
+ verifier.executeGoal( "install" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ verifier = new Verifier( projectDir.getAbsolutePath() );
+
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+ }
+}
Added:
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/maven-mng3694-plugin/pom.xml
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/maven-mng3694-plugin/pom.xml?rev=681815&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/maven-mng3694-plugin/pom.xml
(added)
+++
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/maven-mng3694-plugin/pom.xml
Fri Aug 1 13:38:09 2008
@@ -0,0 +1,28 @@
+<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.mng3694</groupId>
+ <artifactId>maven-mng3694-plugin</artifactId>
+ <packaging>maven-plugin</packaging>
+ <version>1</version>
+ <name>maven-mng3694-plugin Maven Mojo</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>2.0.9</version>
+ </dependency>
+ </dependencies>
+</project>
Added:
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/maven-mng3694-plugin/src/main/java/plugin/MyMojo.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/maven-mng3694-plugin/src/main/java/plugin/MyMojo.java?rev=681815&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/maven-mng3694-plugin/src/main/java/plugin/MyMojo.java
(added)
+++
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/maven-mng3694-plugin/src/main/java/plugin/MyMojo.java
Fri Aug 1 13:38:09 2008
@@ -0,0 +1,61 @@
+package plugin;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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 java.util.Iterator;
+import java.util.List;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * @goal check
+ * @phase validate
+ */
+public class MyMojo
+ extends AbstractMojo
+{
+ /**
+ * @parameter expression="${reactorProjects}"
+ * @required
+ */
+ private List reactorProjects;
+
+ public void execute()
+ throws MojoExecutionException
+ {
+ for ( Iterator it = reactorProjects.iterator(); it.hasNext(); )
+ {
+ MavenProject project = (MavenProject) it.next();
+
+ String basedir = project.getBasedir().getAbsolutePath();
+ List compileSourceRoots = project.getCompileSourceRoots();
+
+ System.out.println( " Compile-source roots for project: " +
project + " are: " + project.getCompileSourceRoots() );
+ for ( Iterator srcIt = compileSourceRoots.iterator();
srcIt.hasNext(); )
+ {
+ String srcRoot = (String) srcIt.next();
+
+ if ( !srcRoot.startsWith( basedir ) )
+ {
+ throw new MojoExecutionException( "Source root: " +
srcRoot + " doesn't begin with project basedir: " + basedir );
+ }
+ }
+ }
+ }
+}
Added:
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/pom.xml
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/pom.xml?rev=681815&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/pom.xml
(added)
+++
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/pom.xml
Fri Aug 1 13:38:09 2008
@@ -0,0 +1,17 @@
+<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.mng3694</groupId>
+ <artifactId>not-used</artifactId>
+ <packaging>jar</packaging>
+ <version>1</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Added:
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/main/java/tests/App.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/main/java/tests/App.java?rev=681815&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/main/java/tests/App.java
(added)
+++
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/main/java/tests/App.java
Fri Aug 1 13:38:09 2008
@@ -0,0 +1,13 @@
+package tests;
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
Added:
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/test/java/tests/AppTest.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/test/java/tests/AppTest.java?rev=681815&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/test/java/tests/AppTest.java
(added)
+++
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/not-used/src/test/java/tests/AppTest.java
Fri Aug 1 13:38:09 2008
@@ -0,0 +1,38 @@
+package tests;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
Added:
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/pom.xml
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/pom.xml?rev=681815&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/pom.xml
(added)
+++
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/pom.xml
Fri Aug 1 13:38:09 2008
@@ -0,0 +1,13 @@
+<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.mng3694</groupId>
+ <artifactId>projects</artifactId>
+ <packaging>pom</packaging>
+ <version>1</version>
+
+ <modules>
+ <module>not-used</module>
+ <module>project</module>
+ </modules>
+</project>
Added:
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/pom.xml
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/pom.xml?rev=681815&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/pom.xml
(added)
+++
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/pom.xml
Fri Aug 1 13:38:09 2008
@@ -0,0 +1,36 @@
+<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.mng3694</groupId>
+ <artifactId>project</artifactId>
+ <packaging>jar</packaging>
+ <version>1</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.its.mng3694</groupId>
+ <artifactId>maven-mng3694-plugin</artifactId>
+ <version>1</version>
+ <executions>
+ <execution>
+ <id>test</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added:
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/main/java/tests/App.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/main/java/tests/App.java?rev=681815&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/main/java/tests/App.java
(added)
+++
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/main/java/tests/App.java
Fri Aug 1 13:38:09 2008
@@ -0,0 +1,13 @@
+package tests;
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
Added:
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/test/java/tests/AppTest.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/test/java/tests/AppTest.java?rev=681815&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/test/java/tests/AppTest.java
(added)
+++
maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3694-reactorProjectsDynamism/projects/project/src/test/java/tests/AppTest.java
Fri Aug 1 13:38:09 2008
@@ -0,0 +1,38 @@
+package tests;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}