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/04/01 16:13:05 UTC
svn commit: r929984 - in
/maven/core-integration-testing/trunk/core-it-suite/src/test:
java/org/apache/maven/it/ resources/mng-3470/ resources/mng-3470/repo/
resources/mng-3470/repo/org/ resources/mng-3470/repo/org/apache/
resources/mng-3470/repo/org/a...
Author: bentmann
Date: Thu Apr 1 14:13:04 2010
New Revision: 929984
URL: http://svn.apache.org/viewvc?rev=929984&view=rev
Log:
[MNG-3470] Build does not fail on corrupted POM even with checksumPolicy=fail
o Added IT
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3470StrictCheckumVerificationOfDependencyPomTest.java (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/pom.xml (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.jar (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.jar.sha1
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.pom
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.pom.sha1
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/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=929984&r1=929983&r2=929984&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 Thu Apr 1 14:13:04 2010
@@ -344,6 +344,7 @@ public class IntegrationTestSuite
suite.addTestSuite( MavenITmng3482DependencyPomInterpolationTest.class );
suite.addTestSuite( MavenITmng3477DependencyResolutionErrorMessageTest.class );
suite.addTestSuite( MavenITmng3475BaseAlignedDirTest.class );
+ suite.addTestSuite( MavenITmng3470StrictCheckumVerificationOfDependencyPomTest.class );
suite.addTestSuite( MavenITmng3461MirrorMatchingTest.class );
suite.addTestSuite( MavenITmng3441MetadataUpdatedFromDeploymentRepositoryTest.class );
suite.addTestSuite( MavenITmng3428PluginDescriptorArtifactsIncompleteTest.class );
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3470StrictCheckumVerificationOfDependencyPomTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3470StrictCheckumVerificationOfDependencyPomTest.java?rev=929984&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3470StrictCheckumVerificationOfDependencyPomTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3470StrictCheckumVerificationOfDependencyPomTest.java Thu Apr 1 14:13:04 2010
@@ -0,0 +1,89 @@
+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;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-3740">MNG-3740</a>.
+ *
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng3470StrictCheckumVerificationOfDependencyPomTest
+ extends AbstractMavenIntegrationTestCase
+{
+
+ public MavenITmng3470StrictCheckumVerificationOfDependencyPomTest()
+ {
+ super( "[2.0.3,2.0.4],[3.0-beta-1,)" );
+ }
+
+ /**
+ * Verify that strict checksum verification fails the build in case a dependency POM is corrupt.
+ */
+ public void testit()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3470" );
+
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.deleteDirectory( "target" );
+ verifier.deleteArtifacts( "org.apache.maven.its.mng3470" );
+ verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
+ verifier.getCliOptions().add( "--settings" );
+ verifier.getCliOptions().add( "settings.xml" );
+ try
+ {
+ try
+ {
+ verifier.setLogFileName( "log-1.txt" );
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ fail( "Build did not fail despite broken checksum of dependency POM." );
+ }
+ catch ( VerificationException e )
+ {
+ // expected
+ }
+
+ // NOTE: This second try is to make sure the state caching in the local repo properly replays the error
+ try
+ {
+ verifier.setLogFileName( "log-2.txt" );
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ fail( "Build did not fail despite broken checksum of dependency POM." );
+ }
+ catch ( VerificationException e )
+ {
+ // expected
+ }
+ }
+ finally
+ {
+ verifier.resetStreams();
+ }
+ }
+
+}
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3470StrictCheckumVerificationOfDependencyPomTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3470StrictCheckumVerificationOfDependencyPomTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/pom.xml?rev=929984&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/pom.xml Thu Apr 1 14:13:04 2010
@@ -0,0 +1,64 @@
+<?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.mng3470</groupId>
+ <artifactId>test</artifactId>
+ <version>0.1</version>
+
+ <name>Maven Integration Test :: MNG-3470</name>
+ <description>
+ Verify that strict checksum verification fails the build in case a dependency POM is corrupt.
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.its.mng3470</groupId>
+ <artifactId>dep</artifactId>
+ <version>0.1</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>
+ <significantPathLevels>1</significantPathLevels>
+ </configuration>
+ <executions>
+ <execution>
+ <id>test</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-3470/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.jar
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.jar?rev=929984&view=auto
==============================================================================
Binary file - no diff available.
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.jar.sha1
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.jar.sha1?rev=929984&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.jar.sha1 (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.jar.sha1 Thu Apr 1 14:13:04 2010
@@ -0,0 +1 @@
+2dd43812c73b4dd33bccac63fb20dec824410256
\ No newline at end of file
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.pom
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.pom?rev=929984&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.pom (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.pom Thu Apr 1 14:13:04 2010
@@ -0,0 +1,40 @@
+<?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.
+-->
+
+<!-- NOTE: It's crucial part of the test that the checksums don't match this POM -->
+
+<project>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.its.mng3470</groupId>
+ <artifactId>dep</artifactId>
+ <version>0.1</version>
+ <packaging>jar</packaging>
+
+ <name>Maven Integration Test :: MNG-3470</name>
+
+ <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-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.pom.sha1
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.pom.sha1?rev=929984&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.pom.sha1 (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/repo/org/apache/maven/its/mng3470/dep/0.1/dep-0.1.pom.sha1 Thu Apr 1 14:13:04 2010
@@ -0,0 +1 @@
+fc738b424671ac1d66f8fbc9b9dd8ac89612cb94
\ No newline at end of file
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/settings-template.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/settings-template.xml?rev=929984&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/settings-template.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/settings-template.xml Thu Apr 1 14:13:04 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@/repo</url>
+ <releases>
+ <checksumPolicy>fail</checksumPolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </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-3470/settings-template.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3470/settings-template.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision