You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by jk...@apache.org on 2006/12/22 22:00:36 UTC

svn commit: r489763 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java

Author: jkf
Date: Fri Dec 22 13:00:35 2006
New Revision: 489763

URL: http://svn.apache.org/viewvc?view=rev&rev=489763
Log:
improved handling of non-existent vmwatcher file.

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java?view=diff&rev=489763&r1=489762&r2=489763
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java Fri Dec 22 13:00:35 2006
@@ -1025,13 +1025,20 @@
             String vmCrashString = "unknown";
             BufferedReader br = null;
             try {
-                br = new BufferedReader(new FileReader(vmWatcher));
-                vmCrashString = br.readLine();
+                if (vmWatcher.exists()) {
+                    br = new BufferedReader(new FileReader(vmWatcher));
+                    vmCrashString = br.readLine();
+                } else {
+                    vmCrashString = "Monitor file ("+vmWatcher.getAbsolutePath()+") missing, location writable? Alternatively testcase not started!";
+                }
             } catch (Exception e) {
                 e.printStackTrace();
                 // ignored.
             } finally {
                 FileUtils.close(br);
+                if (vmWatcher.exists()) {
+                    vmWatcher.delete();
+                }
             }
             if (watchdog != null && watchdog.killedProcess()) {
                 result.timedOut = true;
@@ -1040,7 +1047,6 @@
                 result.crashed = true;
                 logVmCrash(feArray, test, vmCrashString);
             }
-            vmWatcher.delete();
 
             if (!propsFile.delete()) {
                 throw new BuildException("Could not delete temporary "



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