Author: krosenvold
Date: Wed Mar  9 20:17:53 2011
New Revision: 1079970

URL: http://svn.apache.org/viewvc?rev=1079970&view=rev
Log:
o Added error handler to tempfile creation to see what's up in jenkins

Modified:
    
maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemPropertyManager.java

Modified: 
maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemPropertyManager.java
URL: 
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemPropertyManager.java?rev=1079970&r1=1079969&r2=1079970&view=diff
==============================================================================
--- 
maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemPropertyManager.java
 (original)
+++ 
maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemPropertyManager.java
 Wed Mar  9 20:17:53 2011
@@ -19,6 +19,8 @@ package org.apache.maven.surefire.booter
  * under the License.
  */
 
+import org.apache.maven.surefire.util.NestedRuntimeException;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
@@ -70,19 +72,26 @@ public class SystemPropertyManager
         p.setAsSystemProperties();
     }
 
-    public static File writePropertiesFile( Properties properties, File 
tempDirectory, String name,
-                                            boolean isDebug )
+    public static File writePropertiesFile( Properties properties, File 
tempDirectory, String name, boolean isDebug )
         throws IOException
     {
-        File file = File.createTempFile( name, "tmp", tempDirectory );
-        if ( !isDebug )
+        try
         {
-            file.deleteOnExit();
-        }
+            File file = File.createTempFile( name, "tmp", tempDirectory );
+            if ( !isDebug )
+            {
+                file.deleteOnExit();
+            }
 
-        writePropertiesFile( file, name, properties );
+            writePropertiesFile( file, name, properties );
 
-        return file;
+            return file;
+        }
+        catch ( IOException e )
+        {
+            throw new NestedRuntimeException(
+                "Unable to create temp file in " + tempDirectory + ", exists=" 
+ tempDirectory.exists(), e );
+        }
     }
 
     public static void writePropertiesFile( File file, String name, Properties 
properties )


Reply via email to