geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r502252 - /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestResult.groovy
Date Thu, 01 Feb 2007 15:54:11 GMT
Author: jdillon
Date: Thu Feb  1 07:54:10 2007
New Revision: 502252

URL: http://svn.apache.org/viewvc?view=rev&rev=502252
Log:
Only attempt to get stream data if there are lines of data to be gotten

Modified:
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestResult.groovy

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestResult.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestResult.groovy?view=diff&rev=502252&r1=502251&r2=502252
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestResult.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestResult.groovy
Thu Feb  1 07:54:10 2007
@@ -122,22 +122,30 @@
             
             while (line = readLine()) {
                 def matcher = STREAM_HEADER_PATTERN.matcher(line)
+                
+                // Find the stream header
                 if (matcher.matches()) {
                     def stream = new Expando()
                     
                     stream.name = matcher[0][1]
-                    stream.lines = matcher[0][2]
+                    stream.lines = matcher[0][2].toInteger()
                     stream.chars = matcher[0][3].toInteger()
                     
-                    log.info "Loading stream: '$stream.name', $stream.lines lines, $stream.chars
characters"
-                    
-                    char[] buff = new char[stream.chars]
-                    int c = input.read(buff)
-                    assert c == stream.chars
-                    
-                    stream.data = new String(buff)
-                    if (debug) {
-                        log.debug 'Stream data:\n' + ('-' * 80) + "\n$stream.data" + ('-'
* 80)
+                    if (stream.lines < 1) {
+                        log.info("Skipping stream: '$stream.name'; contains no data")
+                    }
+                    else {
+                        log.info "Loading stream: '$stream.name', $stream.lines lines, $stream.chars
characters"
+                        
+                        // Suck off the content of the stream trusting the char size
+                        char[] buff = new char[stream.chars]
+                        int c = input.read(buff)
+                        assert c == stream.chars
+                        
+                        stream.data = new String(buff)
+                        if (debug) {
+                            log.debug 'Stream data:\n' + ('-' * 80) + "\n$stream.data" +
('-' * 80)
+                        }
                     }
                     
                     streams[stream.name] = stream



Mime
View raw message