You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sn...@apache.org on 2006/12/27 12:12:08 UTC

svn commit: r490479 - /maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/AbstractEarPluginTestCase.java

Author: snicoll
Date: Wed Dec 27 03:12:04 2006
New Revision: 490479

URL: http://svn.apache.org/viewvc?view=rev&rev=490479
Log:
Fixed test failure on linux and macOSx when the build is expected to fail.

Modified:
    maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/AbstractEarPluginTestCase.java

Modified: maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/AbstractEarPluginTestCase.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/AbstractEarPluginTestCase.java?view=diff&rev=490479&r1=490478&r2=490479
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/AbstractEarPluginTestCase.java (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/AbstractEarPluginTestCase.java Wed Dec 27 03:12:04 2006
@@ -21,6 +21,7 @@
 
 import junit.framework.TestCase;
 import org.apache.maven.it.Verifier;
+import org.apache.maven.it.VerificationException;
 import org.apache.maven.it.util.ResourceExtractor;
 import org.custommonkey.xmlunit.XMLAssert;
 
@@ -76,7 +77,20 @@
         // Let's add alternate settings.xml setting so that the latest dependencies are used
         verifier.getCliOptions().add( "-s " + settingsFile.getAbsolutePath() );
         verifier.localRepo = localRepositoryDir.getAbsolutePath();
-        verifier.executeGoal( "package" );
+
+        // On linux and macOSX, an exception is thrown if a build failure occurs underneath
+        try
+        {
+            verifier.executeGoal( "package" );
+        }
+        catch ( VerificationException e )
+        {
+            //@TODO needs to be handled nicely in the verifier
+            if (expectNoError || e.getMessage().indexOf( "Exit code was non-zero") == -1) {
+                throw e;
+            }
+        }
+
         // If no error is expected make sure that error logs are free
         if ( expectNoError )
         {



Re: svn commit: r490479 - /maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/AbstractEarPluginTestCase.java

Posted by Stephane Nicoll <st...@gmail.com>.
On 12/27/06, Jason van Zyl <ja...@maven.org> wrote:
> On 27 Dec 06, at 6:15 AM 27 Dec 06, Stephane Nicoll wrote:
> > I have applied a little hack, let's make sure we fix this in the
> > verifier directly.
> >
>
> Can you stick something in JIRA or a TODO in the verifier code so
> that I don't forget. I still will attempt to merge the various
> verifiers and invokers.

Sure, MNG-2718. By the way it seems that MNG-658 is related to this problem.

Stéphane


>
> Jason.
>
> > Cheers,
> > Stpéhane
> >
> > On 12/27/06, snicoll@apache.org <sn...@apache.org> wrote:
> >> Author: snicoll
> >> Date: Wed Dec 27 03:12:04 2006
> >> New Revision: 490479
> >>
> >> URL: http://svn.apache.org/viewvc?view=rev&rev=490479
> >> Log:
> >> Fixed test failure on linux and macOSx when the build is expected
> >> to fail.
> >>
> >> Modified:
> >>     maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/
> >> maven/plugin/ear/AbstractEarPluginTestCase.java
> >>
> >> Modified: maven/plugins/trunk/maven-ear-plugin/src/test/java/org/
> >> apache/maven/plugin/ear/AbstractEarPluginTestCase.java
> >> URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-
> >> plugin/src/test/java/org/apache/maven/plugin/ear/
> >> AbstractEarPluginTestCase.java?
> >> view=diff&rev=490479&r1=490478&r2=490479
> >> =====================================================================
> >> =========
> >> --- maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/
> >> maven/plugin/ear/AbstractEarPluginTestCase.java (original)
> >> +++ maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/
> >> maven/plugin/ear/AbstractEarPluginTestCase.java Wed Dec 27
> >> 03:12:04 2006
> >> @@ -21,6 +21,7 @@
> >>
> >>  import junit.framework.TestCase;
> >>  import org.apache.maven.it.Verifier;
> >> +import org.apache.maven.it.VerificationException;
> >>  import org.apache.maven.it.util.ResourceExtractor;
> >>  import org.custommonkey.xmlunit.XMLAssert;
> >>
> >> @@ -76,7 +77,20 @@
> >>          // Let's add alternate settings.xml setting so that the
> >> latest dependencies are used
> >>          verifier.getCliOptions().add( "-s " +
> >> settingsFile.getAbsolutePath() );
> >>          verifier.localRepo = localRepositoryDir.getAbsolutePath();
> >> -        verifier.executeGoal( "package" );
> >> +
> >> +        // On linux and macOSX, an exception is thrown if a build
> >> failure occurs underneath
> >> +        try
> >> +        {
> >> +            verifier.executeGoal( "package" );
> >> +        }
> >> +        catch ( VerificationException e )
> >> +        {
> >> +            //@TODO needs to be handled nicely in the verifier
> >> +            if (expectNoError || e.getMessage().indexOf( "Exit
> >> code was non-zero") == -1) {
> >> +                throw e;
> >> +            }
> >> +        }
> >> +
> >>          // If no error is expected make sure that error logs are
> >> free
> >>          if ( expectNoError )
> >>          {
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

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


Re: svn commit: r490479 - /maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/AbstractEarPluginTestCase.java

Posted by Jason van Zyl <ja...@maven.org>.
On 27 Dec 06, at 6:15 AM 27 Dec 06, Stephane Nicoll wrote:

> Jason,
>
> The ear ITs are now fixed on linux. It's what I thought (the process
> exit code being different on linux and Windows).
>
> I have applied a little hack, let's make sure we fix this in the
> verifier directly.
>

Can you stick something in JIRA or a TODO in the verifier code so  
that I don't forget. I still will attempt to merge the various  
verifiers and invokers.

Jason.

> Cheers,
> Stpéhane
>
> On 12/27/06, snicoll@apache.org <sn...@apache.org> wrote:
>> Author: snicoll
>> Date: Wed Dec 27 03:12:04 2006
>> New Revision: 490479
>>
>> URL: http://svn.apache.org/viewvc?view=rev&rev=490479
>> Log:
>> Fixed test failure on linux and macOSx when the build is expected  
>> to fail.
>>
>> Modified:
>>     maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/ 
>> maven/plugin/ear/AbstractEarPluginTestCase.java
>>
>> Modified: maven/plugins/trunk/maven-ear-plugin/src/test/java/org/ 
>> apache/maven/plugin/ear/AbstractEarPluginTestCase.java
>> URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear- 
>> plugin/src/test/java/org/apache/maven/plugin/ear/ 
>> AbstractEarPluginTestCase.java? 
>> view=diff&rev=490479&r1=490478&r2=490479
>> ===================================================================== 
>> =========
>> --- maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/ 
>> maven/plugin/ear/AbstractEarPluginTestCase.java (original)
>> +++ maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/ 
>> maven/plugin/ear/AbstractEarPluginTestCase.java Wed Dec 27  
>> 03:12:04 2006
>> @@ -21,6 +21,7 @@
>>
>>  import junit.framework.TestCase;
>>  import org.apache.maven.it.Verifier;
>> +import org.apache.maven.it.VerificationException;
>>  import org.apache.maven.it.util.ResourceExtractor;
>>  import org.custommonkey.xmlunit.XMLAssert;
>>
>> @@ -76,7 +77,20 @@
>>          // Let's add alternate settings.xml setting so that the  
>> latest dependencies are used
>>          verifier.getCliOptions().add( "-s " +  
>> settingsFile.getAbsolutePath() );
>>          verifier.localRepo = localRepositoryDir.getAbsolutePath();
>> -        verifier.executeGoal( "package" );
>> +
>> +        // On linux and macOSX, an exception is thrown if a build  
>> failure occurs underneath
>> +        try
>> +        {
>> +            verifier.executeGoal( "package" );
>> +        }
>> +        catch ( VerificationException e )
>> +        {
>> +            //@TODO needs to be handled nicely in the verifier
>> +            if (expectNoError || e.getMessage().indexOf( "Exit  
>> code was non-zero") == -1) {
>> +                throw e;
>> +            }
>> +        }
>> +
>>          // If no error is expected make sure that error logs are  
>> free
>>          if ( expectNoError )
>>          {
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


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


Re: svn commit: r490479 - /maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/AbstractEarPluginTestCase.java

Posted by Stephane Nicoll <st...@gmail.com>.
Jason,

The ear ITs are now fixed on linux. It's what I thought (the process
exit code being different on linux and Windows).

I have applied a little hack, let's make sure we fix this in the
verifier directly.

Cheers,
Stpéhane

On 12/27/06, snicoll@apache.org <sn...@apache.org> wrote:
> Author: snicoll
> Date: Wed Dec 27 03:12:04 2006
> New Revision: 490479
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=490479
> Log:
> Fixed test failure on linux and macOSx when the build is expected to fail.
>
> Modified:
>     maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/AbstractEarPluginTestCase.java
>
> Modified: maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/AbstractEarPluginTestCase.java
> URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/AbstractEarPluginTestCase.java?view=diff&rev=490479&r1=490478&r2=490479
> ==============================================================================
> --- maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/AbstractEarPluginTestCase.java (original)
> +++ maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/AbstractEarPluginTestCase.java Wed Dec 27 03:12:04 2006
> @@ -21,6 +21,7 @@
>
>  import junit.framework.TestCase;
>  import org.apache.maven.it.Verifier;
> +import org.apache.maven.it.VerificationException;
>  import org.apache.maven.it.util.ResourceExtractor;
>  import org.custommonkey.xmlunit.XMLAssert;
>
> @@ -76,7 +77,20 @@
>          // Let's add alternate settings.xml setting so that the latest dependencies are used
>          verifier.getCliOptions().add( "-s " + settingsFile.getAbsolutePath() );
>          verifier.localRepo = localRepositoryDir.getAbsolutePath();
> -        verifier.executeGoal( "package" );
> +
> +        // On linux and macOSX, an exception is thrown if a build failure occurs underneath
> +        try
> +        {
> +            verifier.executeGoal( "package" );
> +        }
> +        catch ( VerificationException e )
> +        {
> +            //@TODO needs to be handled nicely in the verifier
> +            if (expectNoError || e.getMessage().indexOf( "Exit code was non-zero") == -1) {
> +                throw e;
> +            }
> +        }
> +
>          // If no error is expected make sure that error logs are free
>          if ( expectNoError )
>          {
>
>
>

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