You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2010/09/08 15:46:34 UTC
svn commit: r995056 - in
/maven/core-integration-testing/trunk/core-it-suite/src/test:
java/org/apache/maven/it/ resources/mng-4452/ resources/mng-4452/consumer/
resources/mng-4452/producer/
Author: bentmann
Date: Wed Sep 8 13:46:34 2010
New Revision: 995056
URL: http://svn.apache.org/viewvc?rev=995056&view=rev
Log:
[MNG-4452] Metadata for snapshots should include classifier
o Added IT
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4452ResolutionOfSnapshotWithClassifierTest.java (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/consumer/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/consumer/pom.xml (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/consumer/settings-template.xml (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/producer/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/producer/pom.xml (with props)
Modified:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=995056&r1=995055&r2=995056&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java Wed Sep 8 13:46:34 2010
@@ -141,6 +141,7 @@ public class IntegrationTestSuite
suite.addTestSuite( MavenITmng4461ArtifactUploadMonitorTest.class );
suite.addTestSuite( MavenITmng4459InMemorySettingsKeptEncryptedTest.class );
suite.addTestSuite( MavenITmng4453PluginVersionFromLifecycleMappingTest.class );
+ suite.addTestSuite( MavenITmng4452ResolutionOfSnapshotWithClassifierTest.class );
suite.addTestSuite( MavenITmng4450StubModelForMissingDependencyPomTest.class );
suite.addTestSuite( MavenITmng4436SingletonComponentLookupTest.class );
suite.addTestSuite( MavenITmng4433ForceParentSnapshotUpdateTest.class );
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4452ResolutionOfSnapshotWithClassifierTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4452ResolutionOfSnapshotWithClassifierTest.java?rev=995056&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4452ResolutionOfSnapshotWithClassifierTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4452ResolutionOfSnapshotWithClassifierTest.java Wed Sep 8 13:46:34 2010
@@ -0,0 +1,94 @@
+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-4452">MNG-4452</a>.
+ *
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng4452ResolutionOfSnapshotWithClassifierTest
+ extends AbstractMavenIntegrationTestCase
+{
+
+ public MavenITmng4452ResolutionOfSnapshotWithClassifierTest()
+ {
+ super( "[3.0-beta-4,)" );
+ }
+
+ /**
+ * Test that snapshot artifacts with classifiers can be successfully resolved from remote repos with (unique
+ * snapshots) when the last deployment to that repo didn't include that particular classifier. In other words,
+ * the metadata in the repository needs to properly keep track of all snapshots and not just the last deployed
+ * one. The same goes for snapshots that differ only by file extension.
+ */
+ public void testit()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4452" );
+
+ Verifier verifier = newVerifier( new File( testDir, "producer" ).getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.deleteDirectory( "target" );
+ verifier.deleteArtifacts( "org.apache.maven.its.mng4452" );
+ verifier.setSystemProperty( "mng4452.type", "jar" );
+ verifier.setSystemProperty( "mng4452.classifier", "unix" );
+ verifier.setLogFileName( "log-1.txt" );
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ verifier.setSystemProperty( "mng4452.type", "jar" );
+ verifier.setSystemProperty( "mng4452.classifier", "win" );
+ verifier.setLogFileName( "log-2.txt" );
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ verifier.setSystemProperty( "mng4452.type", "war" );
+ verifier.setSystemProperty( "mng4452.classifier", "win" );
+ verifier.setLogFileName( "log-3.txt" );
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ verifier = newVerifier( new File( testDir, "consumer" ).getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.deleteDirectory( "target" );
+ verifier.deleteArtifacts( "org.apache.maven.its.mng4452" );
+ verifier.getCliOptions().add( "-s" );
+ verifier.getCliOptions().add( "settings.xml" );
+ verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ List artifacts = verifier.loadLines( "target/artifacts.txt", "UTF-8" );
+ assertTrue( artifacts.toString(),
+ artifacts.contains( "org.apache.maven.its.mng4452:producer:jar:unix:0.1-SNAPSHOT" ) );
+ assertTrue( artifacts.toString(),
+ artifacts.contains( "org.apache.maven.its.mng4452:producer:jar:win:0.1-SNAPSHOT" ) );
+ assertTrue( artifacts.toString(),
+ artifacts.contains( "org.apache.maven.its.mng4452:producer:war:win:0.1-SNAPSHOT" ) );
+ }
+
+}
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4452ResolutionOfSnapshotWithClassifierTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4452ResolutionOfSnapshotWithClassifierTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/consumer/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/consumer/pom.xml?rev=995056&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/consumer/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/consumer/pom.xml Wed Sep 8 13:46:34 2010
@@ -0,0 +1,83 @@
+<?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.mng4452</groupId>
+ <artifactId>consumer</artifactId>
+ <version>0.1</version>
+ <packaging>jar</packaging>
+
+ <name>Maven Integration Test :: MNG-4452 :: Dependency Consumer</name>
+ <description>
+ Test that snapshot artifacts with classifiers can be successfully resolved from remote repos with (unique
+ snapshots) when the last deployment to that repo didn't include that particular classifier. In other words,
+ the metadata in the repository needs to properly keep track of all snapshots and not just the last deployed
+ one. The same goes for snapshots that differ only by file extension.
+ </description>
+
+ <dependencies>
+ <!-- those snapshots have been produced by independent builds and hence have different timestamps, yet must be resolvable -->
+ <dependency>
+ <groupId>org.apache.maven.its.mng4452</groupId>
+ <artifactId>producer</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <classifier>unix</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.its.mng4452</groupId>
+ <artifactId>producer</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <classifier>win</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.its.mng4452</groupId>
+ <artifactId>producer</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <classifier>win</classifier>
+ <type>war</type>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-dependency-resolution</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <configuration>
+ <projectArtifacts>target/artifacts.txt</projectArtifacts>
+ <significantPathLevels>1</significantPathLevels>
+ </configuration>
+ <executions>
+ <execution>
+ <id>resolve</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/consumer/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/consumer/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/consumer/settings-template.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/consumer/settings-template.xml?rev=995056&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/consumer/settings-template.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/consumer/settings-template.xml Wed Sep 8 13:46:34 2010
@@ -0,0 +1,43 @@
+<?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@/../producer/target/repo</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <checksumPolicy>ignore</checksumPolicy>
+ </snapshots>
+ </repository>
+ </repositories>
+ </profile>
+ </profiles>
+ <activeProfiles>
+ <activeProfile>maven-core-it-repo</activeProfile>
+ </activeProfiles>
+</settings>
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/consumer/settings-template.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/consumer/settings-template.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/producer/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/producer/pom.xml?rev=995056&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/producer/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/producer/pom.xml Wed Sep 8 13:46:34 2010
@@ -0,0 +1,73 @@
+<?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.mng4452</groupId>
+ <version>0.1-SNAPSHOT</version>
+ <artifactId>producer</artifactId>
+ <packaging>jar</packaging>
+
+ <name>Maven Integration Test :: MNG-4452 :: Dependency Producer</name>
+ <description>
+ Test that snapshot artifacts with classifiers can be successfully resolved from remote repos with (unique
+ snapshots) when the last deployment to that repo didn't include that particular classifier. In other words,
+ the metadata in the repository needs to properly keep track of all snapshots and not just the last deployed
+ one. The same goes for snapshots that differ only by file extension.
+ </description>
+
+ <distributionManagement>
+ <repository>
+ <id>maven-core-it</id>
+ <url>file:///${basedir}/target/repo</url>
+ </repository>
+ </distributionManagement>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-artifact</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>deploy</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>set</goal>
+ <goal>attach</goal>
+ <goal>attach-pom</goal>
+ <goal>install</goal>
+ <goal>deploy</goal>
+ </goals>
+ <configuration>
+ <mainFile>pom.xml</mainFile>
+ <attachedFile>pom.xml</attachedFile>
+ <artifactType>${mng4452.type}</artifactType>
+ <artifactClassifier>${mng4452.classifier}</artifactClassifier>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/producer/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4452/producer/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision