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

svn commit: r697144 - /maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0103Test.java

Author: sisbell
Date: Fri Sep 19 09:33:53 2008
New Revision: 697144

URL: http://svn.apache.org/viewvc?rev=697144&view=rev
Log:
IT0103: Change in behavior for Maven 3.0 - build should fail if it can't find a child pom's parent pom within build or repo.

Modified:
    maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0103Test.java

Modified: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0103Test.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0103Test.java?rev=697144&r1=697143&r2=697144&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0103Test.java (original)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0103Test.java Fri Sep 19 09:33:53 2008
@@ -1,6 +1,7 @@
 package org.apache.maven.integrationtests;
 
 import org.apache.maven.it.Verifier;
+import org.apache.maven.it.VerificationException;
 import org.apache.maven.it.util.ResourceExtractor;
 
 import java.io.File;
@@ -19,10 +20,28 @@
     {
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0103" );
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        verifier.executeGoal( "package" );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
 
+        
+        if ( matchesVersionRange( "(2.0.9, 2.99.99)" ) )
+        {
+            verifier.executeGoal( "package" );
+            verifier.verifyErrorFreeLog();
+            verifier.resetStreams();
+        }
+        else
+        {
+            try
+            {
+                verifier.executeGoal( "package" );
+            }
+            catch ( VerificationException e )
+            {
+                verifier.verifyTextInLog( "java.io.IOException" );
+                verifier.resetStreams();
+                return;
+            }
+            throw new VerificationException( "Build should have failed with java.io.IOException" );           
+        }
     }
 }
 



Re: svn commit: r697144 - /maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0103Test.java

Posted by Brett Porter <br...@apache.org>.
Please add that comment in the test or it'll get lost in time...

On 20/09/2008, at 2:33 AM, sisbell@apache.org wrote:

> Author: sisbell
> Date: Fri Sep 19 09:33:53 2008
> New Revision: 697144
>
> URL: http://svn.apache.org/viewvc?rev=697144&view=rev
> Log:
> IT0103: Change in behavior for Maven 3.0 - build should fail if it  
> can't find a child pom's parent pom within build or repo.
>
> Modified:
>    maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/java/org/apache/maven/integrationtests/MavenIT0103Test.java
>
> Modified: maven/core-integration-testing/trunk/core-integration- 
> tests/src/test/java/org/apache/maven/integrationtests/ 
> MavenIT0103Test.java
> URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0103Test.java?rev=697144&r1=697143&r2=697144&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/java/org/apache/maven/integrationtests/MavenIT0103Test.java  
> (original)
> +++ maven/core-integration-testing/trunk/core-integration-tests/src/ 
> test/java/org/apache/maven/integrationtests/MavenIT0103Test.java Fri  
> Sep 19 09:33:53 2008
> @@ -1,6 +1,7 @@
> package org.apache.maven.integrationtests;
>
> import org.apache.maven.it.Verifier;
> +import org.apache.maven.it.VerificationException;
> import org.apache.maven.it.util.ResourceExtractor;
>
> import java.io.File;
> @@ -19,10 +20,28 @@
>     {
>         File testDir =  
> ResourceExtractor.simpleExtractResources( getClass(), "/it0103" );
>         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
> -        verifier.executeGoal( "package" );
> -        verifier.verifyErrorFreeLog();
> -        verifier.resetStreams();
>
> +
> +        if ( matchesVersionRange( "(2.0.9, 2.99.99)" ) )
> +        {
> +            verifier.executeGoal( "package" );
> +            verifier.verifyErrorFreeLog();
> +            verifier.resetStreams();
> +        }
> +        else
> +        {
> +            try
> +            {
> +                verifier.executeGoal( "package" );
> +            }
> +            catch ( VerificationException e )
> +            {
> +                verifier.verifyTextInLog( "java.io.IOException" );
> +                verifier.resetStreams();
> +                return;
> +            }
> +            throw new VerificationException( "Build should have  
> failed with java.io.IOException" );
> +        }
>     }
> }
>
>
>

--
Brett Porter
brett@apache.org
http://blogs.exist.com/bporter/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org