mirror of https://github.com/apache/maven.git
[MNG-3873] Execution goals not treated as collection
o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@722529 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3015a143c7
commit
318a849b58
|
@ -89,6 +89,7 @@ public class IntegrationTestSuite
|
||||||
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
|
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
|
||||||
|
|
||||||
suite.addTestSuite( MavenITmng3877BasedirAlignedModelTest.class );
|
suite.addTestSuite( MavenITmng3877BasedirAlignedModelTest.class );
|
||||||
|
suite.addTestSuite( MavenITmng3873MultipleExecutionGoalsTest.class );
|
||||||
suite.addTestSuite( MavenITmng3866PluginConfigInheritanceTest.class );
|
suite.addTestSuite( MavenITmng3866PluginConfigInheritanceTest.class );
|
||||||
suite.addTestSuite( MavenITmng3864PerExecPluginConfigTest.class );
|
suite.addTestSuite( MavenITmng3864PerExecPluginConfigTest.class );
|
||||||
suite.addTestSuite( MavenITmng3863AutoPluginGroupIdTest.class );
|
suite.addTestSuite( MavenITmng3863AutoPluginGroupIdTest.class );
|
||||||
|
|
|
@ -0,0 +1,90 @@
|
||||||
|
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.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-3873">MNG-3873</a>.
|
||||||
|
*
|
||||||
|
* @author Benjamin Bentmann
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
public class MavenITmng3873MultipleExecutionGoalsTest
|
||||||
|
extends AbstractMavenIntegrationTestCase
|
||||||
|
{
|
||||||
|
|
||||||
|
public MavenITmng3873MultipleExecutionGoalsTest()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that all goals from a plugin execution are actually executed and not only one when no <pluginManagement>
|
||||||
|
* is involved.
|
||||||
|
*/
|
||||||
|
public void testitWithoutPluginManagement()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3873" );
|
||||||
|
|
||||||
|
Verifier verifier = new Verifier( new File( testDir, "test-1" ).getAbsolutePath() );
|
||||||
|
verifier.setAutoclean( false );
|
||||||
|
verifier.deleteDirectory( "target" );
|
||||||
|
verifier.executeGoal( "validate" );
|
||||||
|
verifier.verifyErrorFreeLog();
|
||||||
|
verifier.resetStreams();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE: We deliberately don't check the exact order here, that's another issue.
|
||||||
|
*/
|
||||||
|
List lines = verifier.loadLines( "target/it.log", "UTF-8" );
|
||||||
|
assertTrue( lines.toString(), lines.contains( "test" ) );
|
||||||
|
assertTrue( lines.toString(), lines.contains( "----" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that all goals from a plugin execution are actually executed and not only one when <pluginManagement>
|
||||||
|
* is involved.
|
||||||
|
*/
|
||||||
|
public void testitWithPluginManagement()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3873" );
|
||||||
|
|
||||||
|
Verifier verifier = new Verifier( new File( testDir, "test-2" ).getAbsolutePath() );
|
||||||
|
verifier.setAutoclean( false );
|
||||||
|
verifier.deleteDirectory( "target" );
|
||||||
|
verifier.executeGoal( "validate" );
|
||||||
|
verifier.verifyErrorFreeLog();
|
||||||
|
verifier.resetStreams();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE: We deliberately don't check the exact order here, that's another issue.
|
||||||
|
*/
|
||||||
|
List lines = verifier.loadLines( "target/it.log", "UTF-8" );
|
||||||
|
assertTrue( lines.toString(), lines.contains( "test" ) );
|
||||||
|
assertTrue( lines.toString(), lines.contains( "----" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -119,6 +119,12 @@ under the License.
|
||||||
<version>${itPluginVersion}</version>
|
<version>${itPluginVersion}</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.maven.its.plugins</groupId>
|
||||||
|
<artifactId>maven-it-plugin-log-file</artifactId>
|
||||||
|
<version>${itPluginVersion}</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.maven.its.plugins</groupId>
|
<groupId>org.apache.maven.its.plugins</groupId>
|
||||||
<artifactId>maven-it-plugin-no-project</artifactId>
|
<artifactId>maven-it-plugin-no-project</artifactId>
|
||||||
|
|
|
@ -0,0 +1,60 @@
|
||||||
|
<?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.mng3873</groupId>
|
||||||
|
<artifactId>test-1</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
<name>Maven Integration Test :: MNG-3873</name>
|
||||||
|
<description>
|
||||||
|
Test that all goals from a plugin execution are actually executed and not only one.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<!-- This project does not use plugin management for the test plugin -->
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.its.plugins</groupId>
|
||||||
|
<artifactId>maven-it-plugin-log-file</artifactId>
|
||||||
|
<version>2.1-SNAPSHOT</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>test</id>
|
||||||
|
<phase>validate</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>log-separator</goal>
|
||||||
|
<goal>log-string</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<logFile>target/it.log</logFile>
|
||||||
|
<string>test</string>
|
||||||
|
<length>4</length>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
|
@ -0,0 +1,69 @@
|
||||||
|
<?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.mng3873</groupId>
|
||||||
|
<artifactId>test-2</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
<name>Maven Integration Test :: MNG-3873</name>
|
||||||
|
<description>
|
||||||
|
Test that all goals from a plugin execution are actually executed and not only one.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<!-- This project uses plugin management for the test plugin -->
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.its.plugins</groupId>
|
||||||
|
<artifactId>maven-it-plugin-log-file</artifactId>
|
||||||
|
<version>2.1-SNAPSHOT</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.its.plugins</groupId>
|
||||||
|
<artifactId>maven-it-plugin-log-file</artifactId>
|
||||||
|
<version>2.1-SNAPSHOT</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>test</id>
|
||||||
|
<phase>validate</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>log-separator</goal>
|
||||||
|
<goal>log-string</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<logFile>target/it.log</logFile>
|
||||||
|
<string>test</string>
|
||||||
|
<length>4</length>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
Loading…
Reference in New Issue