[MNG-4086] [regression] Explicitly using plugin metaversions crashes plugin manager

o Added IT

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@754665 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-03-15 13:42:09 +00:00
parent a76d5f9f81
commit 7a2b18cccb
11 changed files with 368 additions and 0 deletions

View File

@ -92,6 +92,7 @@ public class IntegrationTestSuite
// suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
suite.addTestSuite( MavenITmng4086ExplicitPluginMetaversionTest.class );
suite.addTestSuite( MavenITmng4072InactiveProfileReposTest.class );
suite.addTestSuite( MavenITmng4070WhitespaceTrimmingTest.class );
suite.addTestSuite( MavenITmng4068AuthenticatedMirrorTest.class );

View File

@ -0,0 +1,93 @@
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.Collections;
import java.util.List;
/**
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4086">MNG-4086</a>.
*
* @author Benjamin Bentmann
*/
public class MavenITmng4086ExplicitPluginMetaversionTest
extends AbstractMavenIntegrationTestCase
{
public MavenITmng4086ExplicitPluginMetaversionTest()
{
super( "[2.0.6,)" );
}
/**
* Verify that the plugin metaversion RELEASE can be explicitly used and especially is resolved
* to a proper version before the plugin manager creates the key for the plugin realm.
*/
public void testitRelease()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4086" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteArtifacts( "org.apache.maven.its.mng4086" );
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
verifier.getCliOptions().add( "--settings" );
verifier.getCliOptions().add( "settings.xml" );
verifier.setLogFileName( "log-release.txt" );
verifier.executeGoal( "org.apache.maven.its.mng4086:maven-it-plugin-a:RELEASE:touch" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertFileNotPresent( "target/touch-latest.txt" );
verifier.assertFilePresent( "target/touch-release.txt" );
}
/**
* Verify that the plugin metaversion LATEST can be explicitly used and especially is resolved
* to a proper version before the plugin manager creates the key for the plugin realm.
*/
public void testitLatest()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4086" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteArtifacts( "org.apache.maven.its.mng4086" );
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
verifier.getCliOptions().add( "--settings" );
verifier.getCliOptions().add( "settings.xml" );
verifier.setLogFileName( "log-latest.txt" );
verifier.executeGoal( "org.apache.maven.its.mng4086:maven-it-plugin-a:LATEST:touch" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertFileNotPresent( "target/touch-release.txt" );
verifier.assertFilePresent( "target/touch-latest.txt" );
}
}

View File

@ -0,0 +1,35 @@
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng04086</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: MNG-4086</name>
<description>
Verify that the plugin metaversions RELEASE and LATEST can be explicitly used and especially are resolved
to a proper version before the plugin manager creates the key for the plugin realm.
</description>
</project>

View File

@ -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 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng4086</groupId>
<artifactId>maven-it-plugin-a</artifactId>
<version>0.1</version>
<packaging>maven-plugin</packaging>
<name>Maven Integration Test Plugin :: Touch</name>
<description>
A test plugin that creates an empty file.
</description>
<inceptionYear>2009</inceptionYear>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>.</directory>
<includes>
<include>pom.xml</include>
<include>src/**</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
</project>

View File

@ -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 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng4086</groupId>
<artifactId>maven-it-plugin-a</artifactId>
<version>0.2-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>Maven Integration Test Plugin :: Touch</name>
<description>
A test plugin that creates an empty file.
</description>
<inceptionYear>2009</inceptionYear>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>.</directory>
<includes>
<include>pom.xml</include>
<include>src/**</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
</project>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>org.apache.maven.its.mng4086</groupId>
<artifactId>maven-it-plugin-a</artifactId>
<version>0.2-SNAPSHOT</version>
<versioning>
<snapshot>
<timestamp>20090315.124508</timestamp>
<buildNumber>1</buildNumber>
</snapshot>
<lastUpdated>20090315124508</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>org.apache.maven.its.mng4086</groupId>
<artifactId>maven-it-plugin-a</artifactId>
<version>0.1</version>
<versioning>
<latest>0.2-SNAPSHOT</latest>
<release>0.1</release>
<versions>
<version>0.1</version>
<version>0.2-SNAPSHOT</version>
</versions>
<lastUpdated>20090315124508</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<plugins>
<plugin>
<name>Maven Integration Test Plugin :: Touch</name>
<prefix>ita</prefix>
<artifactId>maven-it-plugin-a</artifactId>
</plugin>
</plugins>
</metadata>

View File

@ -0,0 +1,63 @@
<?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>
<mirrors>
<mirror>
<!-- make sure central isn't touched -->
<id>test-mirror</id>
<url>@baseurl@/repo-null</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>mng-4086</id>
<repositories>
<repository>
<id>maven-core-it</id>
<url>@baseurl@/repo</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>maven-core-it</id>
<url>@baseurl@/repo</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>mng-4086</activeProfile>
</activeProfiles>
</settings>