geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r509033 - in /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report: ./ model/ resources/
Date Mon, 19 Feb 2007 00:01:33 GMT
Author: jdillon
Date: Sun Feb 18 16:01:31 2007
New Revision: 509033

URL: http://svn.apache.org/viewvc?view=rev&rev=509033
Log:
Added model bits for iter logs
Including ri server log in report

Added:
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationLog.groovy
  (with props)
Modified:
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/PageRenderer.groovy
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ReportGenerator.groovy
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationModel.groovy
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestModel.groovy
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/iteration-detail.vm
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/iteration-log.vm

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/PageRenderer.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/PageRenderer.groovy?view=diff&rev=509033&r1=509032&r2=509033
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/PageRenderer.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/PageRenderer.groovy
Sun Feb 18 16:01:31 2007
@@ -70,27 +70,5 @@
         
         return shell.evaluate(expr)
     }
-    
-    private static final long KILOBYTES = 1024
-    private static final long MEGABYTES = KILOBYTES * 1024
-    
-    String logFileSize(filename) {
-        assert filename
-        
-        def file = new File("${params.workDir}/logs/$filename")
-        assert file.exists()
-        
-        long size = file.length() / MEGABYTES
-        if (size > 0) {
-            return "${size} mb"
-        }
-        
-        size = file.length() / KILOBYTES
-        if (size > 0) {
-            return "${size} kb"
-        }
-        
-        return "${file.length()} b"
-    }
 }
 

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ReportGenerator.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ReportGenerator.groovy?view=diff&rev=509033&r1=509032&r2=509033
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ReportGenerator.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ReportGenerator.groovy
Sun Feb 18 16:01:31 2007
@@ -151,13 +151,9 @@
         }
         
         // Render an interation log
-        def renderIterationLog = { model, logFile ->
-            logFile = new File("$logFile")
-            assert logFile.exists()
-            
-            def file = "logs/${logFile.name}-${model.iterationIndex}.html"
-            def renderer = createRenderer('iteration-log.vm', file)
-            renderer.params.model = model
+        def renderIterationLog = { logFile ->
+            def renderer = createRenderer('iteration-log.vm', logFile.href)
+            renderer.params.model = logFile.parent
             renderer.params.logFile = logFile
             renderer.render()
         }
@@ -225,19 +221,17 @@
                 renderWithModel(model, 'package-summary.vm', model.href)
             }
             
-            log.info 'Rendering iteration bits'
-            renderWithModel(iterModel, 'iteration-detail.vm', iterModel.href)
-            renderWithModel(iterModel, 'iteration-frame.vm', iterModel.frameHref)
-            
             log.info 'Rendering iteration logs'
-            renderIterationLog(iterModel, "${workDir}/logs/server.log")
+            iterModel.addLog("$workDir/logs/server.log", 'Geronimo server console log')
+            iterModel.addLog("$workDir/logs/javatest.log", 'Full JavaTest log')
+            iterModel.addLog("$workDir/rilogs/server.log", 'RI server log')
+            iterModel.logFiles.each {
+                renderIterationLog(it)
+            }
             
-            //
-            // NOTE: These files get big, so might need to split them up by test or something
-            //       Since the names don't really match can't include on the testcase detail
-            //       But, could provide an index and render each test's logs to a file
-            //
-            renderIterationLog(iterModel, "${workDir}/logs/javatest.log")
+            log.info 'Rendering iteration detail'
+            renderWithModel(iterModel, 'iteration-detail.vm', iterModel.href)
+            renderWithModel(iterModel, 'iteration-frame.vm', iterModel.frameHref)
             
             // Clean up for the next iteration
             ant.delete(dir: workDir)

Added: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationLog.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationLog.groovy?view=auto&rev=509033
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationLog.groovy
(added)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationLog.groovy
Sun Feb 18 16:01:31 2007
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// $Id$
+//
+
+package gbuild.config.projects.Geronimo_CTS.report.model
+
+/**
+ * Container for iteration log detail
+ */
+class IterationLog
+{
+    IterationModel parent
+    
+    File file
+    
+    String description
+    
+    private UUID uuid = UUID.randomUUID()
+    
+    def IterationLog(IterationModel parent, File file, String description) {
+        assert parent
+        assert file
+        assert file.exists()
+        assert description
+        
+        this.parent = parent
+        this.file = file
+        this.description = description
+    }
+    
+    private static final long KILOBYTES = 1024
+    private static final long MEGABYTES = KILOBYTES * 1024
+    
+    def getSize() {
+        long size = file.length() / MEGABYTES
+        if (size > 0) {
+            return "${size} mb"
+        }
+        
+        size = file.length() / KILOBYTES
+        if (size > 0) {
+            return "${size} kb"
+        }
+        
+        return "${file.length()} b"
+    }
+    
+    def getName() {
+        return file.name
+    }
+    
+    def getTitle() {
+        return "${parent.title} - $name"
+    }
+    
+    def getHref() {
+        return "logs/${uuid}.html"
+    }
+    
+    Iterator getContent() {
+        return file.iterator()
+    }
+}
+

Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationLog.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationLog.groovy
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationLog.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationModel.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationModel.groovy?view=diff&rev=509033&r1=509032&r2=509033
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationModel.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationModel.groovy
Sun Feb 18 16:01:31 2007
@@ -38,6 +38,8 @@
     
     Node iterationConfig
     
+    List logFiles = []
+    
     def IterationModel(String name) {
         super(name, 'packageName', PackageModel)
     }
@@ -127,6 +129,18 @@
     
     String getTitle() {
         return "Iteration: $name"
+    }
+    
+    def addLog(String filename, String desc) {
+        def file = new File(filename)
+        if (file.exists()) {
+            log.info "Adding log: $file"
+            def ilog = new IterationLog(this, file, desc)
+            logFiles << ilog
+        }
+        else {
+            log.warn "Missing log file: $file; ignoring"
+        }
     }
 }
 

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestModel.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestModel.groovy?view=diff&rev=509033&r1=509032&r2=509033
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestModel.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestModel.groovy
Sun Feb 18 16:01:31 2007
@@ -23,12 +23,15 @@
 
 package gbuild.config.projects.Geronimo_CTS.report.model
 
+import gbuild.system.LogSupport
+
 import gbuild.config.projects.Geronimo_CTS.report.TestCase
 
 /**
  * Support for model implementations which handle test case data collection.
  */
 abstract class TestModel
+    extends LogSupport
     implements Comparable
 {
     protected Set listeners = new TreeSet()

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/iteration-detail.vm
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/iteration-detail.vm?view=diff&rev=509033&r1=509032&r2=509033
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/iteration-detail.vm
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/iteration-detail.vm
Sun Feb 18 16:01:31 2007
@@ -73,17 +73,18 @@
         
         #tableHeader(['Log File', 'Size', 'Description'])
         
-        #macro (logFileLink $model $file $desc)
-            <tr>
-                <td class="logFilesTableFilenameCell"><a href="$baseURI/logs/${file}-${model.iterationIndex}.html">$file</a></td>
-                <td class="logFilesTableSizeCell">$helper.logFileSize("$file")</td>
-                <td class="logFilesTableDescCell">$desc</td>
-            </tr>
-        #end
+        <!--
+        $model.class
+        -->
         
         <tbody>
-            #logFileLink($model 'server.log' 'Geronimo server console log')
-            #logFileLink($model 'javatest.log' 'Full JavaTest log')
+            #foreach ($logFile in $model.logFiles)
+                <tr>
+                    <td class="logFilesTableFilenameCell"><a href="$baseURI/${logFile.href}">${logFile.file.name}</a></td>
+                    <td class="logFilesTableSizeCell">${logFile.size}</td>
+                    <td class="logFilesTableDescCell">${logFile.description}</td>
+                </tr>
+            #end
         <tbody>
     </table>
     

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/iteration-log.vm
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/iteration-log.vm?view=diff&rev=509033&r1=509032&r2=509033
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/iteration-log.vm
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/iteration-log.vm
Sun Feb 18 16:01:31 2007
@@ -22,17 +22,11 @@
 ##
 
 <html>
-#pageHeader("$model.title - $logFile.name")
+#pageHeader($logFile.title)
 <body onload="windowTitle();">
     #topNavBar()
     
-    <h2><a href="$baseURI/$model.href">$model.title</a> - $logFile.name</h2>
-    
-    ##
-    ## NOTE: Load as iter to have a prayer of handling huge files
-    ##
-    
-    #set ($content = $helper.eval("new File('$logFile').iterator()"))
+    <h2><a href="$baseURI/$model.href">$model.title</a> - $logFile.name
(${logFile.size}) ${logFile.description}</h2>
     
     ##
     ## TODO: Escape each line so it will display propertly reguardless of content in the
<pre>
@@ -42,7 +36,7 @@
     ## NOTE: Whacky line placement to get newlines correct
     ##
     
-    <pre class="logContents">#foreach ($line in $content)$line
+    <pre class="logContents">#foreach ($line in ${logFile.content})$line
 #end</pre>
 
 </body>



Mime
View raw message