From 497c2faf6f6beb2f6042ccd4ac62637da2781e2f Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 15 Mar 2009 20:34:57 +0000 Subject: [PATCH] [MNG-4087] Percent encoded characters in file URLs are not decoded upon deployment o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@754746 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/it/IntegrationTestSuite.java | 1 + ...venITmng4087PercentEncodedFileUrlTest.java | 64 ++++++++++++++++++ .../test/resources/mng-4087/pom-template.xml | 66 +++++++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4087PercentEncodedFileUrlTest.java create mode 100644 its/core-it-suite/src/test/resources/mng-4087/pom-template.xml diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java index d5ba0b2735..95568cf490 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java @@ -92,6 +92,7 @@ public class IntegrationTestSuite // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class ); // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 + suite.addTestSuite( MavenITmng4087PercentEncodedFileUrlTest.class ); suite.addTestSuite( MavenITmng4086ExplicitPluginMetaversionTest.class ); suite.addTestSuite( MavenITmng4072InactiveProfileReposTest.class ); suite.addTestSuite( MavenITmng4070WhitespaceTrimmingTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4087PercentEncodedFileUrlTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4087PercentEncodedFileUrlTest.java new file mode 100644 index 0000000000..3522719be3 --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4087PercentEncodedFileUrlTest.java @@ -0,0 +1,64 @@ +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 MNG-4087. + * + * @author Benjamin Bentmann + */ +public class MavenITmng4087PercentEncodedFileUrlTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng4087PercentEncodedFileUrlTest() + { + super( "[2.1.0,)" ); + } + + /** + * Test that deployment to a file:// repository decodes percent-encoded characters. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4087" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng4087" ); + verifier.filterFile( "pom-template.xml", "pom.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + verifier.assertFileNotPresent( "target/%72%65%70%6F" ); + verifier.assertFilePresent( "target/repo" ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-4087/pom-template.xml b/its/core-it-suite/src/test/resources/mng-4087/pom-template.xml new file mode 100644 index 0000000000..e683c0be88 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4087/pom-template.xml @@ -0,0 +1,66 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4087 + test + 1.0-SNAPSHOT + jar + + Maven Integration Test :: MNG-4087 + + Test that deployment to a file:// repository decodes percent-encoded characters. + + + + + maven-core-it + + @baseurl@/target/%72%65%70%6F + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-artifact + 2.1-SNAPSHOT + + pom.xml + + + + test + validate + + set + install + deploy + + + + + + +