maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r1054648 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/ resources/mng-4955/ resources/mng-4955/dep/ resources/mng-4955/repo/ resources/mng-4955/repo/org/ resources/mng-4955/repo/org/apache/ reso...
Date Mon, 03 Jan 2011 15:23:23 GMT
Author: bentmann
Date: Mon Jan  3 15:23:22 2011
New Revision: 1054648

URL: http://svn.apache.org/viewvc?rev=1054648&view=rev
Log:
[MNG-4955] [regression] Outdated remote snapshots are preferred over locally installed snapshots

o Added IT

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4955LocalVsRemoteSnapshotResolutionTest.java
  (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/dep/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/dep/dep.jar
  (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/dep/pom.xml
  (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/pom.xml
  (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/dep-0.1-20110103.120652-1.jar
  (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/dep-0.1-20110103.120652-1.pom
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/maven-metadata.xml
  (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/settings-template.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=1054648&r1=1054647&r2=1054648&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
Mon Jan  3 15:23:22 2011
@@ -83,6 +83,7 @@ public class IntegrationTestSuite
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
+        suite.addTestSuite( MavenITmng4955LocalVsRemoteSnapshotResolutionTest.class );
         suite.addTestSuite( MavenITmng4936EventSpyTest.class );
         suite.addTestSuite( MavenITmng4925ContainerLookupRealmDuringMojoExecTest.class );
         suite.addTestSuite( MavenITmng4913UserPropertyVsDependencyPomPropertyTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4955LocalVsRemoteSnapshotResolutionTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4955LocalVsRemoteSnapshotResolutionTest.java?rev=1054648&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4955LocalVsRemoteSnapshotResolutionTest.java
(added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4955LocalVsRemoteSnapshotResolutionTest.java
Mon Jan  3 15:23:22 2011
@@ -0,0 +1,75 @@
+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-4955">MNG-4955</a>.
+ * 
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng4955LocalVsRemoteSnapshotResolutionTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng4955LocalVsRemoteSnapshotResolutionTest()
+    {
+        super( "[2.0.10,2.0.99),[2.1.0,3.0-alpha-1),[3.0.2,)" );
+    }
+
+    /**
+     * Verify that dependency resolution prefers newer local snapshots over outdated remote
snapshots that use the new
+     * metadata format.
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4955"
);
+
+        Verifier verifier = newVerifier( new File( testDir, "dep" ).getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.deleteArtifacts( "org.apache.maven.its.mng4955" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        verifier = newVerifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        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 classpath = verifier.loadLines( "target/classpath.txt", "UTF-8" );
+
+        File jarFile = new File( classpath.get( 1 ).toString() );
+        assertEquals( "eeff09b1b80e823eeb2a615b1d4b09e003e86fd3", ItUtils.calcHash( jarFile,
"SHA-1" ) );
+    }
+
+}

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4955LocalVsRemoteSnapshotResolutionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4955LocalVsRemoteSnapshotResolutionTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/dep/dep.jar
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/dep/dep.jar?rev=1054648&view=auto
==============================================================================
Binary file - no diff available.

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/dep/dep.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/dep/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/dep/pom.xml?rev=1054648&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/dep/pom.xml
(added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/dep/pom.xml
Mon Jan  3 15:23:22 2011
@@ -0,0 +1,59 @@
+<?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.mng4955</groupId>
+  <artifactId>dep</artifactId>
+  <version>0.1-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-4955 :: Dependency</name>
+  <description>
+    Verify that dependency resolution prefers newer local snapshots over outdated remote
snapshots that use the new
+    metadata format.
+  </description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-artifact</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <id>install</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>set</goal>
+              <goal>attach-pom</goal>
+              <goal>install</goal>
+            </goals>
+            <configuration>
+              <mainFile>dep.jar</mainFile>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/dep/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/dep/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/pom.xml?rev=1054648&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/pom.xml
(added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/pom.xml
Mon Jan  3 15:23:22 2011
@@ -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.mng4955</groupId>
+  <artifactId>test</artifactId>
+  <version>0.1</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-4955</name>
+  <description>
+    Verify that dependency resolution prefers newer local snapshots over outdated remote
snapshots that use the new
+    metadata format.
+  </description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.its.mng4955</groupId>
+      <artifactId>dep</artifactId>
+      <version>0.1-SNAPSHOT</version>
+    </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>
+          <compileClassPath>target/classpath.txt</compileClassPath>
+        </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-4955/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/dep-0.1-20110103.120652-1.jar
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/dep-0.1-20110103.120652-1.jar?rev=1054648&view=auto
==============================================================================
Binary file - no diff available.

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/dep-0.1-20110103.120652-1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/dep-0.1-20110103.120652-1.pom
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/dep-0.1-20110103.120652-1.pom?rev=1054648&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/dep-0.1-20110103.120652-1.pom
(added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/dep-0.1-20110103.120652-1.pom
Mon Jan  3 15:23:22 2011
@@ -0,0 +1,36 @@
+<?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.mng4955</groupId>
+  <artifactId>dep</artifactId>
+  <version>0.1-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <distributionManagement>
+    <repository>
+      <id>maven-core-it</id>
+      <url>file:///${basedir}/repo</url>
+    </repository>
+  </distributionManagement>
+</project>

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/maven-metadata.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/maven-metadata.xml?rev=1054648&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/maven-metadata.xml
(added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/maven-metadata.xml
Mon Jan  3 15:23:22 2011
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata modelVersion="1.1.0">
+  <groupId>org.apache.maven.its.mng4955</groupId>
+  <artifactId>dep</artifactId>
+  <version>0.1-SNAPSHOT</version>
+  <versioning>
+    <snapshot>
+      <timestamp>20110103.120652</timestamp>
+      <buildNumber>1</buildNumber>
+    </snapshot>
+    <lastUpdated>20110103120652</lastUpdated>
+    <snapshotVersions>
+      <snapshotVersion>
+        <extension>jar</extension>
+        <value>0.1-20110103.120652-1</value>
+        <updated>20110103120652</updated>
+      </snapshotVersion>
+      <snapshotVersion>
+        <extension>pom</extension>
+        <value>0.1-20110103.120652-1</value>
+        <updated>20110103120652</updated>
+      </snapshotVersion>
+    </snapshotVersions>
+  </versioning>
+</metadata>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/maven-metadata.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/repo/org/apache/maven/its/mng4955/dep/0.1-SNAPSHOT/maven-metadata.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/settings-template.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/settings-template.xml?rev=1054648&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/settings-template.xml
(added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/settings-template.xml
Mon Jan  3 15:23:22 2011
@@ -0,0 +1,45 @@
+<?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>
+            <enabled>false</enabled>
+          </releases>
+          <snapshots>
+            <checksumPolicy>ignore</checksumPolicy>
+            <!-- NOTE: Be sure to enforce metadata refresh to exhibit bug -->
+            <updatePolicy>always</updatePolicy>
+          </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-4955/settings-template.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4955/settings-template.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



Mime
View raw message