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/01/31 01:23:31 UTC

svn commit: r904928 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/ resources/mng-4464/ resources/mng-4464/aggregator/ resources/mng-4464/parent/ resources/mng-4464/sub/

Author: bentmann
Date: Sun Jan 31 00:23:31 2010
New Revision: 904928

URL: http://svn.apache.org/viewvc?rev=904928&view=rev
Log:
[MNG-4464] Improve handling of relative paths with backslashes

o Added IT

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4464PlatformIndependentFileSeparatorTest.java   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/aggregator/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/aggregator/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/parent/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/parent/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/sub/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/sub/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=904928&r1=904927&r2=904928&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 Sun Jan 31 00:23:31 2010
@@ -99,6 +99,7 @@
         suite.addTestSuite( MavenITmng4470AuthenticatedDeploymentToProxyTest.class );
         suite.addTestSuite( MavenITmng4469AuthenticatedDeploymentToCustomRepoTest.class );
         suite.addTestSuite( MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest.class );
+        suite.addTestSuite( MavenITmng4464PlatformIndependentFileSeparatorTest.class );
         suite.addTestSuite( MavenITmng4461ArtifactUploadMonitorTest.class );
         suite.addTestSuite( MavenITmng4459InMemorySettingsKeptEncryptedTest.class );
         suite.addTestSuite( MavenITmng4453PluginVersionFromLifecycleMappingTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4464PlatformIndependentFileSeparatorTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4464PlatformIndependentFileSeparatorTest.java?rev=904928&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4464PlatformIndependentFileSeparatorTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4464PlatformIndependentFileSeparatorTest.java Sun Jan 31 00:23:31 2010
@@ -0,0 +1,76 @@
+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.Properties;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4464">MNG-4464</a>.
+ * 
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng4464PlatformIndependentFileSeparatorTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng4464PlatformIndependentFileSeparatorTest()
+    {
+        super( "[3.0-alpha-7,)" );
+    }
+
+    /**
+     * Test that Maven recognizes both the forward and the backward slash as file separators, regardless of the
+     * underlying filesystem (i.e. even on Unix).
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4464" );
+
+        Verifier verifier = new Verifier( new File( testDir, "aggregator" ).getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "../sub/target" );
+        verifier.deleteArtifacts( "org.apache.maven.its.mng4464" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        verifier.assertFilePresent( "../sub/target/path.properties" );
+        Properties props = verifier.loadProperties( "../sub/target/path.properties" );
+        assertPath( props, "project.build.resources.0.directory", "src/main/res" );
+        assertPath( props, "project.build.testResources.0.directory", "src/test/res" );
+        assertPath( props, "project.build.sourceDirectory", "src/main/j" );
+        assertPath( props, "project.build.testSourceDirectory", "src/test/j" );
+        assertPath( props, "project.build.directory", "target/it" );
+        assertPath( props, "project.build.outputDirectory", "target/it/classes" );
+        assertPath( props, "project.build.testOutputDirectory", "target/it/test-classes" );
+    }
+
+    private void assertPath( Properties props, String key, String path )
+    {
+        String actual = props.getProperty( key, "" );
+        assertTrue( actual, actual.endsWith( path.replace( '/', File.separatorChar ) ) );
+    }
+
+}

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/aggregator/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/aggregator/pom.xml?rev=904928&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/aggregator/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/aggregator/pom.xml Sun Jan 31 00:23:31 2010
@@ -0,0 +1,48 @@
+<?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>
+
+  <parent>
+    <groupId>org.apache.maven.its.mng4464</groupId>
+    <artifactId>parent</artifactId>
+    <version>0.1</version>
+    <!-- NOTE: This deliberately uses the backward slash -->
+    <relativePath>..\parent</relativePath>
+  </parent>
+
+  <groupId>org.apache.maven.its.mng4464</groupId>
+  <artifactId>aggregator</artifactId>
+  <version>0.1</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-4464 :: Aggregator</name>
+  <description>
+    Test that Maven recognizes both the forward and the backward slash as file separators, regardless of the
+    underlying filesystem (i.e. even on Unix).
+  </description>
+
+  <modules>
+    <!-- NOTE: This deliberately uses the backward slash -->
+    <module>..\sub</module>
+  </modules>
+</project>

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/parent/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/parent/pom.xml?rev=904928&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/parent/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/parent/pom.xml Sun Jan 31 00:23:31 2010
@@ -0,0 +1,35 @@
+<?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.mng4464</groupId>
+  <artifactId>parent</artifactId>
+  <version>0.1</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-4464</name>
+  <description>
+    Test that Maven recognizes both the forward and the backward slash as file separators, regardless of the
+    underlying filesystem (i.e. even on Unix).
+  </description>
+</project>

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/sub/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/sub/pom.xml?rev=904928&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/sub/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4464/sub/pom.xml Sun Jan 31 00:23:31 2010
@@ -0,0 +1,90 @@
+<?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>
+
+  <parent>
+    <groupId>org.apache.maven.its.mng4464</groupId>
+    <artifactId>parent</artifactId>
+    <version>0.1</version>
+    <relativePath>../parent</relativePath>
+  </parent>
+
+  <groupId>org.apache.maven.its.mng4464</groupId>
+  <artifactId>sub</artifactId>
+  <version>0.1</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-4464 :: Sub</name>
+  <description>
+    Test that Maven recognizes both the forward and the backward slash as file separators, regardless of the
+    underlying filesystem (i.e. even on Unix).
+  </description>
+
+  <build>
+    <!-- NOTE: The paths deliberately uses the backward slash -->
+    <sourceDirectory>src\main\j</sourceDirectory>
+    <testSourceDirectory>src\test\j</testSourceDirectory>
+    <directory>target\it</directory>
+    <outputDirectory>target\it\classes</outputDirectory>
+    <testOutputDirectory>target\it\test-classes</testOutputDirectory>
+    <resources>
+      <resource>
+        <directory>src\main\res</directory>
+      </resource>
+    </resources>
+    <testResources>
+      <testResource>
+        <directory>src\test\res</directory>
+      </testResource>
+    </testResources>
+
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-expression</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <phase>validate</phase>
+            <goals>
+              <goal>eval</goal>
+            </goals>
+            <configuration>
+              <!-- NOTE: This deliberately uses the backward slash -->
+              <outputFile>target\path.properties</outputFile>
+              <expressions>
+                <expression>project/build/sourceDirectory</expression>
+                <expression>project/build/testSourceDirectory</expression>
+                <expression>project/build/directory</expression>
+                <expression>project/build/outputDirectory</expression>
+                <expression>project/build/testOutputDirectory</expression>
+                <expression>project/build/resources/0/directory</expression>
+                <expression>project/build/testResources/0/directory</expression>
+              </expressions>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

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

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