Author: olamy Date: Wed Dec 7 22:53:08 2011 New Revision: 1211689 URL: http://svn.apache.org/viewvc?rev=1211689&view=rev Log: add integration test to ensure plexus lifecycle is honoured: Contextualizable, Disposable
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5206PlexusLifecycleHonoured.java (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5206/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5206/pom.xml (with props) maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/pom.xml (with props) maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/java/ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/java/org/ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/java/org/apache/ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/java/org/apache/maven/ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/java/org/apache/maven/its/ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/java/org/apache/maven/its/plugins/ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/java/org/apache/maven/its/plugins/MojoWithPlexusLifecycle.java (with props) maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/resources/ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/resources/template.vm (with props) Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/pom.xml Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5206PlexusLifecycleHonoured.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5206PlexusLifecycleHonoured.java?rev=1211689&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5206PlexusLifecycleHonoured.java (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5206PlexusLifecycleHonoured.java Wed Dec 7 22:53:08 2011 @@ -0,0 +1,61 @@ +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.util.ResourceExtractor; + +import java.io.File; +import java.util.List; + +/** + * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-5206">MNG-5206</a>. + * + * @author Olivier Lamy + */ +public class MavenITmng5206PlexusLifecycleHonoured + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng5206PlexusLifecycleHonoured() + { + super( "[2.0.7,)" ); + } + + /** + * Verify that plexus lifecycle phases are honoured: contextualize, configure, dispose + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5206" ); + + Verifier verifier = newVerifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng5206" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + verifier.verifyTextInLog( "MojoWithPlexusLifecycle :: dispose" ); + verifier.verifyTextInLog( "MojoWithPlexusLifecycle :: contextualize" ); + } + +} Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5206PlexusLifecycleHonoured.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5206PlexusLifecycleHonoured.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5206/pom.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5206/pom.xml?rev=1211689&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5206/pom.xml (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5206/pom.xml Wed Dec 7 22:53:08 2011 @@ -0,0 +1,52 @@ +<?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.mng5206</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-5206</name> + <description> + Verify Plexus phases has honoured by Maven: Contextualizable, Disposable + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-plexus-lifecycle</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>do-nothing</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5206/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5206/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/pom.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/pom.xml?rev=1211689&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/pom.xml (added) +++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/pom.xml Wed Dec 7 22:53:08 2011 @@ -0,0 +1,50 @@ +<?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/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <artifactId>maven-it-plugins</artifactId> + <groupId>org.apache.maven.its.plugins</groupId> + <version>2.1-SNAPSHOT</version> + </parent> + + <artifactId>maven-it-plugin-plexus-lifecycle</artifactId> + <packaging>maven-plugin</packaging> + + <name>Maven IT Plugin :: Plexus Lifecycle</name> + + <dependencies> + + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>2.0</version> + </dependency> + <!-- plexus --> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-container-default</artifactId> + <version>1.0-alpha-9-stable-1</version> + </dependency> + </dependencies> +</project> Propchange: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/java/org/apache/maven/its/plugins/MojoWithPlexusLifecycle.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/java/org/apache/maven/its/plugins/MojoWithPlexusLifecycle.java?rev=1211689&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/java/org/apache/maven/its/plugins/MojoWithPlexusLifecycle.java (added) +++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/java/org/apache/maven/its/plugins/MojoWithPlexusLifecycle.java Wed Dec 7 22:53:08 2011 @@ -0,0 +1,59 @@ +package org.apache.maven.its.plugins; +/* + * 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.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.codehaus.plexus.configuration.PlexusConfiguration; +import org.codehaus.plexus.configuration.PlexusConfigurationException; +import org.codehaus.plexus.context.Context; +import org.codehaus.plexus.context.ContextException; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Configurable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable; + +/** + * @author Olivier Lamy + * @goal do-nothing + * @phase validate + */ +public class MojoWithPlexusLifecycle + extends AbstractMojo + implements Contextualizable, Disposable +{ + public void execute() + throws MojoExecutionException, MojoFailureException + { + getLog().info( "execute MojoWithPlexusLifecycle" ); + } + + public void dispose() + { + getLog().info( "MojoWithPlexusLifecycle :: dispose" ); + } + + public void contextualize( Context context ) + throws ContextException + { + getLog().info( "MojoWithPlexusLifecycle :: contextualize" ); + } + + +} Propchange: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/java/org/apache/maven/its/plugins/MojoWithPlexusLifecycle.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/java/org/apache/maven/its/plugins/MojoWithPlexusLifecycle.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/resources/template.vm URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/resources/template.vm?rev=1211689&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/resources/template.vm (added) +++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/resources/template.vm Wed Dec 7 22:53:08 2011 @@ -0,0 +1 @@ +Hello, World! Propchange: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/resources/template.vm ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-plexus-lifecycle/src/main/resources/template.vm ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/pom.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/pom.xml?rev=1211689&r1=1211688&r2=1211689&view=diff ============================================================================== --- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/pom.xml (original) +++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/pom.xml Wed Dec 7 22:53:08 2011 @@ -74,6 +74,7 @@ under the License. <module>maven-it-plugin-log4j</module> <module>maven-it-plugin-extension1</module> <module>maven-it-plugin-extension2</module> + <module>maven-it-plugin-plexus-lifecycle</module> </modules> <scm>