[MNG-4553] Plugins artifact filtering should use full Artifact identification instead only ArtifactId

o Added IT

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@917012 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-02-27 18:53:42 +00:00
parent 5aaec14151
commit b16fc8168b
6 changed files with 228 additions and 0 deletions

View File

@ -88,6 +88,7 @@ public class IntegrationTestSuite
suite.addTestSuite( MavenITmng4572ModelVersionSurroundedByWhitespaceTest.class );
suite.addTestSuite( MavenITmng4561MirroringOfPluginRepoTest.class );
suite.addTestSuite( MavenITmng4554PluginPrefixMappingUpdateTest.class );
suite.addTestSuite( MavenITmng4553CoreArtifactFilterConsidersGroupIdTest.class );
suite.addTestSuite( MavenITmng4544ActiveComponentCollectionThreadSafeTest.class );
suite.addTestSuite( MavenITmng4536RequiresNoProjectForkingMojoTest.class );
suite.addTestSuite( MavenITmng4528ExcludeWagonsFromMavenCoreArtifactsTest.class );

View File

@ -0,0 +1,66 @@
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.Properties;
/**
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4553">MNG-4553</a>.
*
* @author Benjamin Bentmann
*/
public class MavenITmng4553CoreArtifactFilterConsidersGroupIdTest
extends AbstractMavenIntegrationTestCase
{
public MavenITmng4553CoreArtifactFilterConsidersGroupIdTest()
{
super( "[3.0-alpha-7,)" );
}
/**
* Verify that the core artifact filter considers both artifact id and group id.
*/
public void testit()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4553" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteArtifacts( "org.apache.maven.its.mng4553" );
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
verifier.getCliOptions().add( "-s" );
verifier.getCliOptions().add( "settings.xml" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
Properties pclProps = verifier.loadProperties( "target/pcl.properties" );
assertNotNull( pclProps.getProperty( "mng4553.properties" ) );
assertEquals( "1", pclProps.getProperty( "mng4553.properties.count" ) );
}
}

View File

@ -0,0 +1,65 @@
<?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.mng4553</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
<name>Maven Integration Test :: MNG-4553</name>
<description>
Verify that the core artifact filter considers both artifact id and group id.
</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-class-loader</artifactId>
<version>2.1-SNAPSHOT</version>
<dependencies>
<dependency>
<!-- This has the same artifact id as org.apache.maven:maven-plugin-api but must not be excluded from the plugin realm -->
<groupId>org.apache.maven.its.mng4553</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>load</id>
<phase>validate</phase>
<configuration>
<resourcePaths>mng4553.properties</resourcePaths>
<pluginClassLoaderOutput>target/pcl.properties</pluginClassLoaderOutput>
<contextClassLoaderOutput>target/tccl.properties</contextClassLoaderOutput>
</configuration>
<goals>
<goal>load</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,41 @@
<?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.mng4553</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
<packaging>jar</packaging>
<name>Maven Integration Test :: MNG-4553</name>
<description>
Verify that the core artifact filter considers both artifact id and group id.
</description>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
</project>

View File

@ -0,0 +1,55 @@
<?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.
-->
<settings>
<profiles>
<profile>
<id>maven-core-it-repo</id>
<repositories>
<repository>
<id>maven-core-it</id>
<url>@baseurl@/repo</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>maven-core-it</id>
<url>@baseurl@/repo</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>maven-core-it-repo</activeProfile>
</activeProfiles>
</settings>