You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2007/02/02 04:05:02 UTC
svn commit: r502456 -
/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/TestResult.groovy
Author: jdillon
Date: Thu Feb 1 19:05:01 2007
New Revision: 502456
URL: http://svn.apache.org/viewvc?view=rev&rev=502456
Log:
Turn all logs to debug, add some sanity asserts
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=502456&r1=502455&r2=502456
==============================================================================
--- 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 19:05:01 2007
@@ -53,12 +53,13 @@
def load(file) {
assert file
- file = new File("$file")
+ file = new File("$file").canonicalFile
assert file.exists()
boolean debug = log.debugEnabled
-
- log.info "Loading test result from: $file"
+ if (debug) {
+ log.deubg "Loading test result from: $file"
+ }
def input = file.newReader()
@@ -73,6 +74,8 @@
}
def scan = { text ->
+ assert text
+
if (debug) {
log.debug "Scanning for: $text"
}
@@ -93,6 +96,8 @@
}
def loadProperties = { title ->
+ assert title
+
scan("#-----${title}-----")
// keep things in the same order as the jtr file
@@ -107,16 +112,18 @@
props[parts[0]] = parts[1]
}
- log.info "Properties '${title}':"
- props.each {
- log.info " $it"
+ if (debug) {
+ log.debug "Properties '${title}':"
+ props.each {
+ log.debug " $it"
+ }
}
return props
}
def loadStreams = {
- log.info "Loading streams..."
+ log.debug "Loading streams..."
def streams = new LinkedHashMap()
@@ -134,10 +141,14 @@
stream.chars = matcher[0][3].toInteger()
if (stream.lines < 1) {
- log.info("Skipping stream: '$stream.name'; contains no data")
+ if (debug) {
+ log.debug("Skipping stream: '$stream.name'; contains no data")
+ }
}
else {
- log.info "Loading stream: '$stream.name', $stream.lines lines, $stream.chars characters"
+ if (debug) {
+ log.debug "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]
@@ -158,7 +169,11 @@
}
def loadSection = { name ->
- log.info "Loading section: $name"
+ assert name
+
+ if (debug) {
+ log.debug "Loading section: $name"
+ }
def section = new Expando()
section.name = name
@@ -168,7 +183,7 @@
}
def loadSections = {
- log.info "Loading sections..."
+ log.debug "Loading sections..."
def sections = new LinkedHashMap()
@@ -192,11 +207,6 @@
testresult = loadProperties('testresult')
sections = loadSections()
-
- //
- // NOTE: The next line is probably empty, so we have to check for null
- // Not sure if we can expect input.readLine() == '' always here :-\
- //
status = scan('test result: ').split(' ', 3)[2]
}