diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java index 062917606d..3e5fc7bf6f 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java @@ -227,6 +227,7 @@ public class IntegrationTestSuite 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 ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0144LifecycleExecutionOrderTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0144LifecycleExecutionOrderTest.java new file mode 100644 index 0000000000..a217940162 --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0144LifecycleExecutionOrderTest.java @@ -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 ); + } + +} diff --git a/its/core-it-suite/src/test/resources/it0144/pom.xml b/its/core-it-suite/src/test/resources/it0144/pom.xml new file mode 100644 index 0000000000..541e75db4d --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0144/pom.xml @@ -0,0 +1,401 @@ + + + + + + 4.0.0 + + org.apache.maven.its.it0144 + test + 1.0 + jar + + Maven Integration Test :: it0144 + + Test that the lifecycle phases execute in proper order. + + + + + + org.apache.maven.its.plugins + maven-it-plugin-log-file + 2.1-SNAPSHOT + + + + validate + validate + + log-string + + + target/phases.log + validate + + + + initialize + initialize + + log-string + + + target/phases.log + initialize + + + + generate-sources + generate-sources + + log-string + + + target/phases.log + generate-sources + + + + process-sources + process-sources + + log-string + + + target/phases.log + process-sources + + + + generate-resources + generate-resources + + log-string + + + target/phases.log + generate-resources + + + + process-resources + process-resources + + log-string + + + target/phases.log + process-resources + + + + compile + compile + + log-string + + + target/phases.log + compile + + + + process-classes + process-classes + + log-string + + + target/phases.log + process-classes + + + + generate-test-sources + generate-test-sources + + log-string + + + target/phases.log + generate-test-sources + + + + process-test-sources + process-test-sources + + log-string + + + target/phases.log + process-test-sources + + + + generate-test-resources + generate-test-resources + + log-string + + + target/phases.log + generate-test-resources + + + + process-test-resources + process-test-resources + + log-string + + + target/phases.log + process-test-resources + + + + test-compile + test-compile + + log-string + + + target/phases.log + test-compile + + + + process-test-classes + process-test-classes + + log-string + + + target/phases.log + process-test-classes + + + + test + test + + log-string + + + target/phases.log + test + + + + package + package + + log-string + + + target/phases.log + package + + + + pre-integration-test + pre-integration-test + + log-string + + + target/phases.log + pre-integration-test + + + + integration-test + integration-test + + log-string + + + target/phases.log + integration-test + + + + post-integration-test + post-integration-test + + log-string + + + target/phases.log + post-integration-test + + + + verify + verify + + log-string + + + target/phases.log + verify + + + + install + install + + log-string + + + target/phases.log + install + + + + deploy + deploy + + log-string + + + target/phases.log + deploy + + + + + pre-clean + pre-clean + + log-string + + + target/phases.log + pre-clean + + + + clean + clean + + log-string + + + target/phases.log + clean + + + + post-clean + post-clean + + log-string + + + target/phases.log + post-clean + + + + + pre-site + pre-site + + log-string + + + target/phases.log + pre-site + + + + site + site + + log-string + + + target/phases.log + site + + + + post-site + post-site + + log-string + + + target/phases.log + post-site + + + + site-deploy + site-deploy + + log-string + + + target/phases.log + site-deploy + + + + + + + maven-clean-plugin + 0.1-stub-SNAPSHOT + + + maven-compiler-plugin + 0.1-stub-SNAPSHOT + + + maven-deploy-plugin + 0.1-stub-SNAPSHOT + + + maven-install-plugin + 0.1-stub-SNAPSHOT + + + maven-jar-plugin + 0.1-stub-SNAPSHOT + + + maven-resources-plugin + 0.1-stub-SNAPSHOT + + + maven-surefire-plugin + 0.1-stub-SNAPSHOT + + + maven-site-plugin + 0.1-stub-SNAPSHOT + + + +