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/12/07 21:18:24 UTC
svn commit: r724188 - in
/maven/core-integration-testing/trunk/core-it-suite/src/test:
java/org/apache/maven/it/IntegrationTestSuite.java
java/org/apache/maven/it/MavenIT0144LifecycleExecutionOrderTest.java
resources/it0144/ resources/it0144/pom.xml
Author: bentmann
Date: Sun Dec 7 12:18:24 2008
New Revision: 724188
URL: http://svn.apache.org/viewvc?rev=724188&view=rev
Log:
o Added IT to check execution order of lifecycle phases
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0144LifecycleExecutionOrderTest.java (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0144/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0144/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=724188&r1=724187&r2=724188&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 Sun Dec 7 12:18:24 2008
@@ -227,6 +227,7 @@
suite.addTestSuite( MavenITmng0282NonReactorExecWhenProjectIndependentTest.class );
suite.addTestSuite( MavenITmng0249ResolveDepsFromReactorTest.class );
suite.addTestSuite( MavenITmng0095ReactorFailureBehaviorTest.class );
+ suite.addTestSuite( MavenIT0144LifecycleExecutionOrderTest.class );
suite.addTestSuite( MavenIT0143TransitiveDependencyScopesTest.class );
suite.addTestSuite( MavenIT0142DirectDependencyScopesTest.class );
suite.addTestSuite( MavenIT0140Test.class );
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0144LifecycleExecutionOrderTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0144LifecycleExecutionOrderTest.java?rev=724188&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0144LifecycleExecutionOrderTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0144LifecycleExecutionOrderTest.java Sun Dec 7 12:18:24 2008
@@ -0,0 +1,96 @@
+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.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ *
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class MavenIT0144LifecycleExecutionOrderTest
+ extends AbstractMavenIntegrationTestCase
+{
+
+ public MavenIT0144LifecycleExecutionOrderTest()
+ {
+ }
+
+ /**
+ * Test that the lifecycle phases execute in proper order.
+ */
+ public void testit0144()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0144" );
+
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+ verifier.deleteDirectory( "target" );
+ verifier.setAutoclean( false );
+ verifier.executeGoals( Arrays.asList( new String[] { "post-clean", "deploy", "site-deploy" } ) );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ List expected = new ArrayList();
+
+ expected.add( "pre-clean" );
+ expected.add( "clean" );
+ expected.add( "post-clean" );
+
+ expected.add( "validate" );
+ expected.add( "initialize" );
+ expected.add( "generate-sources" );
+ expected.add( "process-sources" );
+ expected.add( "generate-resources" );
+ expected.add( "process-resources" );
+ expected.add( "compile" );
+ expected.add( "process-classes" );
+ expected.add( "generate-test-sources" );
+ expected.add( "process-test-sources" );
+ expected.add( "generate-test-resources" );
+ expected.add( "process-test-resources" );
+ expected.add( "test-compile" );
+ expected.add( "process-test-classes" );
+ expected.add( "test" );
+ expected.add( "package" );
+ expected.add( "pre-integration-test" );
+ expected.add( "integration-test" );
+ expected.add( "post-integration-test" );
+ expected.add( "verify" );
+ expected.add( "install" );
+ expected.add( "deploy" );
+
+ expected.add( "pre-site" );
+ expected.add( "site" );
+ expected.add( "post-site" );
+ expected.add( "site-deploy" );
+
+ List phases = verifier.loadLines( "target/phases.log", "UTF-8" );
+ assertEquals( expected, phases );
+ }
+
+}
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0144LifecycleExecutionOrderTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0144LifecycleExecutionOrderTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0144/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0144/pom.xml?rev=724188&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0144/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0144/pom.xml Sun Dec 7 12:18:24 2008
@@ -0,0 +1,401 @@
+<?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.it0144</groupId>
+ <artifactId>test</artifactId>
+ <version>1.0</version>
+ <packaging>jar</packaging>
+
+ <name>Maven Integration Test :: it0144</name>
+ <description>
+ Test that the lifecycle phases execute in proper order.
+ </description>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-log-file</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <executions>
+ <!-- default lifecycle -->
+ <execution>
+ <id>validate</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>validate</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>initialize</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>initialize</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>generate-sources</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>process-sources</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>process-sources</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-resources</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>generate-resources</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>process-resources</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>process-resources</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>compile</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>compile</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>process-classes</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>process-classes</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-test-sources</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>generate-test-sources</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>process-test-sources</id>
+ <phase>process-test-sources</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>process-test-sources</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-test-resources</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>generate-test-resources</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>process-test-resources</id>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>process-test-resources</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>test-compile</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>test-compile</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>process-test-classes</id>
+ <phase>process-test-classes</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>process-test-classes</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>test</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>package</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>pre-integration-test</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>pre-integration-test</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>integration-test</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>integration-test</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>post-integration-test</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>post-integration-test</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>verify</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>verify</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>install</id>
+ <phase>install</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>install</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>deploy</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>deploy</string>
+ </configuration>
+ </execution>
+ <!-- clean lifecycle -->
+ <execution>
+ <id>pre-clean</id>
+ <phase>pre-clean</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>pre-clean</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>clean</id>
+ <phase>clean</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>clean</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>post-clean</id>
+ <phase>post-clean</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>post-clean</string>
+ </configuration>
+ </execution>
+ <!-- site lifecycle -->
+ <execution>
+ <id>pre-site</id>
+ <phase>pre-site</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>pre-site</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>site</id>
+ <phase>site</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>site</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>post-site</id>
+ <phase>post-site</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>post-site</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>site-deploy</id>
+ <phase>site-deploy</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/phases.log</logFile>
+ <string>site-deploy</string>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- NOTE: Be sure to use stub plugins here to avoid interferences from the production plugins. -->
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>0.1-stub-SNAPSHOT</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>0.1-stub-SNAPSHOT</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>0.1-stub-SNAPSHOT</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>0.1-stub-SNAPSHOT</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>0.1-stub-SNAPSHOT</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>0.1-stub-SNAPSHOT</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>0.1-stub-SNAPSHOT</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>0.1-stub-SNAPSHOT</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0144/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/it0144/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision