Author: bentmann
Date: Fri Oct 30 21:56:56 2009
New Revision: 831465
URL:
http://svn.apache.org/viewvc?rev=831465&view=revLog:
[MNG-3607] Class loaders employed by Maven return invalid URLs to resources
o Added IT
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3607ClassLoadersUseValidUrlsTest.java (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3607/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3607/path with spaces/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3607/path with spaces/tools.jar (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3607/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=831465&r1=831464&r2=831465&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 Fri Oct 30 21:56:56 2009
@@ -284,6 +284,7 @@
suite.addTestSuite( MavenITmng3642DynamicResourcesTest.class );
suite.addTestSuite( MavenITmng3641ProfileActivationWarningTest.class );
suite.addTestSuite( MavenITmng3621UNCInheritedPathsTest.class );
+ suite.addTestSuite( MavenITmng3607ClassLoadersUseValidUrlsTest.class );
suite.addTestSuite( MavenITmng3600DeploymentModeDefaultsTest.class );
suite.addTestSuite( MavenITmng3599useHttpProxyForWebDAVTest.class );
suite.addTestSuite( MavenITmng3586SystemScopePluginDependencyTest.class );
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3607ClassLoadersUseValidUrlsTest.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3607ClassLoadersUseValidUrlsTest.java?rev=831465&view=auto==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3607ClassLoadersUseValidUrlsTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3607ClassLoadersUseValidUrlsTest.java Fri Oct 30 21:56:56 2009
@@ -0,0 +1,67 @@
+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.net.URI;
+import java.util.Properties;
+
+/**
+ * This is a test set for <a href="
http://jira.codehaus.org/browse/MNG-3607">MNG-3607</a>.
+ *
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class MavenITmng3607ClassLoadersUseValidUrlsTest
+ extends AbstractMavenIntegrationTestCase
+{
+
+ public MavenITmng3607ClassLoadersUseValidUrlsTest()
+ {
+ super( "[3.0-alpha-2,)" );
+ }
+
+ /**
+ * Test that class loaders created by Maven employ valid URLs, e.g. properly encode characters like spaces.
+ */
+ public void testit()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3607" );
+
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.deleteDirectory( "target" );
+ verifier.getSystemProperties().setProperty( "test.home", testDir.getAbsolutePath() );
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ Properties props = verifier.loadProperties( "target/pcl.properties" );
+ String url = props.getProperty( "maven-core-it.properties" );
+ assertNotNull( url );
+ assertNotNull( new URI( url ) );
+ assertTrue( url.indexOf( ' ' ) < 0 );
+ }
+
+}
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3607ClassLoadersUseValidUrlsTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3607ClassLoadersUseValidUrlsTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3607/path with spaces/tools.jar
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3607/path%20with%20spaces/tools.jar?rev=831465&view=auto==============================================================================
Binary file - no diff available.
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3607/path with spaces/tools.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3607/pom.xml
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3607/pom.xml?rev=831465&view=auto==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3607/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3607/pom.xml Fri Oct 30 21:56:56 2009
@@ -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.mng3607</groupId>
+ <artifactId>test</artifactId>
+ <version>1.0</version>
+
+ <name>Maven Integration Test :: MNG-3607</name>
+ <description>
+ Test that class loaders created by Maven employ valid URLs, e.g. properly encode characters like spaces.
+ </description>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-class-loader</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.its.mng3607</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.5.0</version>
+ <scope>system</scope>
+ <systemPath>${test.home}/path with spaces/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>load</id>
+ <phase>validate</phase>
+ <configuration>
+ <resourcePaths>maven-core-it.properties</resourcePaths>
+ <pluginClassLoaderOutput>target/pcl.properties</pluginClassLoaderOutput>
+ </configuration>
+ <goals>
+ <goal>load</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3607/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3607/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision