servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lh...@apache.org
Subject svn commit: r704798 - /servicemix/scripts/builds/webapps/builds/status.jsp
Date Wed, 15 Oct 2008 07:17:03 GMT
Author: lhein
Date: Wed Oct 15 00:17:03 2008
New Revision: 704798

URL: http://svn.apache.org/viewvc?rev=704798&view=rev
Log:
the logs are read until end and the last recognized status wins

Modified:
    servicemix/scripts/builds/webapps/builds/status.jsp

Modified: servicemix/scripts/builds/webapps/builds/status.jsp
URL: http://svn.apache.org/viewvc/servicemix/scripts/builds/webapps/builds/status.jsp?rev=704798&r1=704797&r2=704798&view=diff
==============================================================================
--- servicemix/scripts/builds/webapps/builds/status.jsp (original)
+++ servicemix/scripts/builds/webapps/builds/status.jsp Wed Oct 15 00:17:03 2008
@@ -176,6 +176,7 @@
           }
       }          
       
+      String result = null;
       reader = new BufferedReader(new FileReader(file));
       while (true) {
         String line = reader.readLine();
@@ -187,18 +188,9 @@
           } else if (line.contains(errorTest) ||
         		     line.contains(otherErrorsTest) ||
                      line.contains(fatalErrorTest)) {
-            String result = "<td class='failure' width='60%'><a href='logs/" + uri
+ "' class='failure'>FAILURE " + durationText + "</a></td>";
-            saveResult(session, f.lastModified(), uri, result);
-            return result;
+            result = "FAILURE";
           } else if (line.contains(successTest)) {
-            if (failedTests) {
-              String result = "<td class='success_with_failed_tests' width='60%'><a
href='logs/" + uri + "' class='success_with_failed_tests'>SUCCESS (with failures) " + durationText
+ "</a></td>";
-              saveResult(session, f.lastModified(), uri, result);
-              return result;
-            } else {
-              String result = "<td class='success' width='60%'><a href='logs/" +
uri + "' class='success'>SUCCESS " + durationText + "</a></td>";
-              saveResult(session, f.lastModified(), uri, result);
-              return result;
+            result = "SUCCESS";
             }
           }
         }
@@ -215,8 +207,22 @@
         }
       }
     }
+    
+    if (result == null) {
+        // UNKNOWN STATUS
+        result = "<td class='unknown' width='60%'><a href='logs/" + uri + "' class='unknown'>UNKNOWN
" + durationText + "</a></td>";
+    } else if (result.equalsIgnoreCase("SUCCESS")) {
+        // SUCCESS WITH OR WITHOUT TEST FAILURES
+        if (failedTests) {
+            result = "<td class='success_with_failed_tests' width='60%'><a href='logs/"
+ uri + "' class='success_with_failed_tests'>SUCCESS (with failures) " + durationText +
"</a></td>";
+        } else {
+            result = "<td class='success' width='60%'><a href='logs/" + uri + "'
class='success'>SUCCESS " + durationText + "</a></td>";
+        }
+    } else if (result.equalsIgnoreCase("FAILURE")) {
+        // FAILURE
+        result = "<td class='failure' width='60%'><a href='logs/" + uri + "' class='failure'>FAILURE
" + durationText + "</a></td>";
+    }
 
-    String result = "<td class='unknown' width='60%'><a href='logs/" + uri + "'
class='unknown'>UNKNOWN " + durationText + "</a></td>";
     saveResult(session, f.lastModified(), uri, result);
     return result;
   }



Mime
View raw message