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, [EMAIL PROTECTED] <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to