You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2008/02/05 18:33:42 UTC

svn commit: r618710 - in /maven/core-integration-testing/trunk/core-integration-tests/src/test: java/org/apache/maven/integrationtests/ resources/mng-3331-modulePathNormalization/ resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/ ...

Author: jdcasey
Date: Tue Feb  5 09:33:35 2008
New Revision: 618710

URL: http://svn.apache.org/viewvc?rev=618710&view=rev
Log:
[MNG-3331] tests for module-paths with spaces and relative directory references.

Added:
    maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3331ModulePathNormalization.java   (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/mng3331-child/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/mng3331-child/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/parent/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/parent/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/readme.txt   (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/mng3331 child/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/mng3331 child/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/readme.txt   (with props)
Modified:
    maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java

Modified: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java?rev=618710&r1=618709&r2=618710&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java (original)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java Tue Feb  5 09:33:35 2008
@@ -188,6 +188,7 @@
         suite.addTestSuite( MavenIT0119PluginPrefixOrder.class );
 		suite.addTestSuite( MavenITmng3372DirectInvocationOfPlugins.class );
 		suite.addTestSuite( MavenITmng3099SettingsProfilesWithNoPOM.class );
+		suite.addTestSuite( MavenITmng3331ModulePathNormalization.class );
         // suite.addTestSuite( MavenIT0120EjbClientDependency.class ); -- not passing for 2.0.7 either, looks to be 2.1+ ?
         return suite;
     }

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3331ModulePathNormalization.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3331ModulePathNormalization.java?rev=618710&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3331ModulePathNormalization.java (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3331ModulePathNormalization.java Tue Feb  5 09:33:35 2008
@@ -0,0 +1,85 @@
+package org.apache.maven.integrationtests;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.integrationtests.AbstractMavenIntegrationTestCase;
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a sample integration test. The IT tests typically
+ * operate by having a sample project in the
+ * /src/test/resources folder along with a junit test like
+ * this one. The junit test uses the verifier (which uses
+ * the invoker) to invoke a new instance of Maven on the
+ * project in the resources folder. It then checks the
+ * results. This is a non-trivial example that shows two
+ * phases. See more information inline in the code.
+ * 
+ * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
+ * 
+ */
+public class MavenITmng3331ModulePathNormalization
+    extends AbstractMavenIntegrationTestCase
+{
+    public void testMNG3331ModuleWithSpaces ()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3331-modulePathNormalization/with-spaces" );
+
+        Verifier verifier;
+
+        verifier = new Verifier( testDir.getAbsolutePath() );
+
+        verifier.executeGoal( "initialize" );
+
+        /*
+         * This is the simplest way to check a build
+         * succeeded. It is also the simplest way to create
+         * an IT test: make the build pass when the test
+         * should pass, and make the build fail when the
+         * test should fail. There are other methods
+         * supported by the verifier. They can be seen here:
+         * http://maven.apache.org/shared/maven-verifier/apidocs/index.html
+         */
+        verifier.verifyErrorFreeLog();
+
+        /*
+         * Reset the streams before executing the verifier
+         * again.
+         */
+        verifier.resetStreams();
+    }
+
+    public void testMNG3331ModuleWithRelativeParentDirRef ()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3331-modulePathNormalization/with-relative-parentDir-ref/parent" );
+
+        Verifier verifier;
+
+        verifier = new Verifier( testDir.getAbsolutePath() );
+
+        verifier.executeGoal( "initialize" );
+
+        /*
+         * This is the simplest way to check a build
+         * succeeded. It is also the simplest way to create
+         * an IT test: make the build pass when the test
+         * should pass, and make the build fail when the
+         * test should fail. There are other methods
+         * supported by the verifier. They can be seen here:
+         * http://maven.apache.org/shared/maven-verifier/apidocs/index.html
+         */
+        verifier.verifyErrorFreeLog();
+
+        /*
+         * Reset the streams before executing the verifier
+         * again.
+         */
+        verifier.resetStreams();
+    }
+
+}

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3331ModulePathNormalization.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3331ModulePathNormalization.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/mng3331-child/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/mng3331-child/pom.xml?rev=618710&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/mng3331-child/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/mng3331-child/pom.xml Tue Feb  5 09:33:35 2008
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+  <parent>
+    <artifactId>parent</artifactId>
+    <groupId>org.apache.maven.its.mng3331</groupId>
+    <version>1</version>
+    <relativePath>../parent/pom.xml</relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng3331</groupId>
+  <artifactId>mng3331-child</artifactId>
+  <name>mng3331-child</name>
+  <version>1</version>
+  <packaging>pom</packaging>
+</project>
\ No newline at end of file

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/mng3331-child/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/mng3331-child/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/parent/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/parent/pom.xml?rev=618710&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/parent/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/parent/pom.xml Tue Feb  5 09:33:35 2008
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng3331</groupId>
+  <artifactId>parent</artifactId>
+  <packaging>pom</packaging>
+  <version>1</version>
+  <name>MNG-3331 Parent</name>
+  
+  <modules>
+    <module>../mng3331-child</module>
+  </modules>
+</project>
\ No newline at end of file

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/parent/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/parent/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/readme.txt
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/readme.txt?rev=618710&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/readme.txt (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/readme.txt Tue Feb  5 09:33:35 2008
@@ -0,0 +1,3 @@
+This is a sample IT based on a real one. This test first installs a jar containing some checkstyle rules. The second invocation uses that jar as an extension
+so that checkstyle finds the resources. If Maven behaves properly, the build succeeds, if not, the build fails. This is the simplest way to structure an IT when
+possible as it's cut and dry and is very easy to check with the verifier.
\ No newline at end of file

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/readme.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-relative-parentDir-ref/readme.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/mng3331 child/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/mng3331%20child/pom.xml?rev=618710&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/mng3331 child/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/mng3331 child/pom.xml Tue Feb  5 09:33:35 2008
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+  <parent>
+    <artifactId>parent</artifactId>
+    <groupId>org.apache.maven.its.mng3331</groupId>
+    <version>1</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng3331</groupId>
+  <artifactId>mng3331-child</artifactId>
+  <name>mng3331-child</name>
+  <version>1</version>
+  <packaging>pom</packaging>
+</project>
\ No newline at end of file

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/mng3331 child/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/mng3331 child/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/pom.xml?rev=618710&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/pom.xml Tue Feb  5 09:33:35 2008
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng3331</groupId>
+  <artifactId>parent</artifactId>
+  <packaging>pom</packaging>
+  <version>1</version>
+  <name>MNG-3331 Parent</name>
+  
+  <modules>
+    <module>mng3331 child</module>
+  </modules>
+</project>
\ No newline at end of file

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/readme.txt
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/readme.txt?rev=618710&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/readme.txt (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/readme.txt Tue Feb  5 09:33:35 2008
@@ -0,0 +1,3 @@
+This is a sample IT based on a real one. This test first installs a jar containing some checkstyle rules. The second invocation uses that jar as an extension
+so that checkstyle finds the resources. If Maven behaves properly, the build succeeds, if not, the build fails. This is the simplest way to structure an IT when
+possible as it's cut and dry and is very easy to check with the verifier.
\ No newline at end of file

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/readme.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3331-modulePathNormalization/with-spaces/readme.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"