maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r382699 - /maven/plugins/branches/maven-surefire-plugin-testng/src/main/java/org/apache/maven/test/SurefirePlugin.java
Date Fri, 03 Mar 2006 07:09:47 GMT
Author: brett
Date: Thu Mar  2 23:09:40 2006
New Revision: 382699

URL: http://svn.apache.org/viewcvs?rev=382699&view=rev
Log:
[MSUREFIRE-23] exception handling cleanup

Modified:
    maven/plugins/branches/maven-surefire-plugin-testng/src/main/java/org/apache/maven/test/SurefirePlugin.java

Modified: maven/plugins/branches/maven-surefire-plugin-testng/src/main/java/org/apache/maven/test/SurefirePlugin.java
URL: http://svn.apache.org/viewcvs/maven/plugins/branches/maven-surefire-plugin-testng/src/main/java/org/apache/maven/test/SurefirePlugin.java?rev=382699&r1=382698&r2=382699&view=diff
==============================================================================
--- maven/plugins/branches/maven-surefire-plugin-testng/src/main/java/org/apache/maven/test/SurefirePlugin.java
(original)
+++ maven/plugins/branches/maven-surefire-plugin-testng/src/main/java/org/apache/maven/test/SurefirePlugin.java
Thu Mar  2 23:09:40 2006
@@ -30,6 +30,8 @@
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.surefire.booter.ForkConfiguration;
 import org.apache.maven.surefire.booter.SurefireBooter;
+import org.apache.maven.surefire.booter.SurefireBooterForkException;
+import org.apache.maven.surefire.booter.SurefireExecutionException;
 import org.apache.maven.surefire.report.BriefConsoleReporter;
 import org.apache.maven.surefire.report.BriefFileReporter;
 import org.apache.maven.surefire.report.ConsoleReporter;
@@ -338,17 +340,20 @@
         {
             SurefireBooter surefireBooter = constructSurefireBooter();
 
+            getLog().info( "Surefire report directory: " + reportsDirectory );
+
             boolean success;
             try
             {
-                getLog().info( "Surefire report directory: " + reportsDirectory );
-
                 success = surefireBooter.run();
             }
-            catch ( Exception e )
+            catch ( SurefireBooterForkException e )
+            {
+                throw new MojoExecutionException( e.getMessage(), e );
+            }
+            catch ( SurefireExecutionException e )
             {
-                // TODO: better handling
-                throw new MojoExecutionException( "Error executing surefire", e );
+                throw new MojoExecutionException( e.getMessage(), e );
             }
 
             if ( !success )
@@ -618,9 +623,9 @@
             systemProperties = new Properties();
         }
 
-        systemProperties.put( "basedir", basedir.getAbsolutePath() );
+        systemProperties.setProperty( "basedir", basedir.getAbsolutePath() );
 
-        systemProperties.put( "localRepository", localRepository.getBasedir() );
+        systemProperties.setProperty( "localRepository", localRepository.getBasedir() );
 
         if ( setInSystem )
         {
@@ -631,7 +636,7 @@
             {
                 String key = (String) iter.next();
 
-                String value = (String) systemProperties.get( key );
+                String value = systemProperties.getProperty( key );
 
                 System.setProperty( key, value );
             }



Mime
View raw message