geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r503929 - in /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report: ReportGenerator.groovy resources/ resources/macros.vm resources/testcase.vm
Date Tue, 06 Feb 2007 00:15:52 GMT
Author: jdillon
Date: Mon Feb  5 16:15:51 2007
New Revision: 503929

URL: http://svn.apache.org/viewvc?view=rev&rev=503929
Log:
Hooked up primitive generation of testcase details

Added:
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/macros.vm
  (with props)
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/testcase.vm
  (with props)
Modified:
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ReportGenerator.groovy

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=503929&r1=503928&r2=503929
==============================================================================
--- 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
Mon Feb  5 16:15:51 2007
@@ -28,11 +28,12 @@
 import gbuild.system.LogSupport
 import gbuild.system.util.LazyProxy
 import gbuild.system.util.Sorting
+import gbuild.system.util.TemplateEngine
 
 import org.apache.commons.lang.time.StopWatch
 
 /**
- * ???
+ * Generates an HTML report for the collected TCK results.
  */
 class ReportGenerator extends LogSupport
 {
@@ -72,7 +73,14 @@
         ant.mkdir(dir: targetDir)
         
         def workDir = new File('target/work').canonicalFile
+        
+        // Make sure we start out with a clean slate
         ant.delete(dir: workDir)
+        ant.delete(dir: targetDir)
+        
+        // Setup the template engine
+        def engine = new TemplateEngine('gbuild/config/projects/Geronimo_CTS/report/resources')
+        engine.libraries = [ 'macros.vm' ]
         
         // Process each result archive
         archives.each { archive ->
@@ -84,13 +92,6 @@
             // Load runtests.properties, so we can see webcontainer and iteration (and others)
             def props = loadProperties("$workDir/runtests.properties")
             
-            //
-            // HACK: Show me the props for now
-            //
-            props.each {
-                println it
-            }
-            
             def scanner = ant.fileScanner {
             fileset(dir: workDir) {
                     include(name: '**/*.jtr')
@@ -113,42 +114,43 @@
             
             log.info "Testsuite loaded in $watch"
             
-            /*
-            testSuite.testCases.keySet().sort(Sorting.CASE_INSENSITIVE).each {
-                println it
-            }
+            //
+            // TODO: Collect all packages, classes, tests
+            //
             
-            println "Summary"
+            //
+            // TODO: Collect global stats (passed, failed, errors, time)
+            //
             
-            println testSuite.passCount
-            println testSuite.failureCount
-            println testSuite.duration
-            println testSuite.successRate
-            println testSuite.passed
-            */
+            //
+            // TODO: May want to add some sanity checks to make sure that iterations
+            //       do not have weird matching of stats for packages?
+            //
+            
+            //
+            // TODO: First thing is to generate the test detail pages
+            //
+            
+            def renderTestCase = { testCase ->
+                log.info "Processing testcase: $testCase.name"
+                
+                def template = engine.getTemplate('testcase.vm')
+                template.params.testCase = testCase
+                
+                def basedir = new File(targetDir, testCase.name.replace('.', '/').replace('#',
'_'))
+                ant.mkdir(dir: basedir)
+                
+                def file = new File(basedir, 'index.html')
+                template.render(file)
+            }
+            
+            testSuite.testCases.each { name, testCase ->
+                renderTestCase(testCase)
+            }
             
             // Clean up
             log.info "Cleaning up"
             ant.delete(dir: workDir)
-        }
-        
-        //
-        // HACK: Just to make sure current AH config will soak up the output dir
-        //
-        
-        def writer = new File("$targetDir/index.html").newWriter()
-        def doc = new MarkupBuilder(writer)
-        
-        try {
-            doc.html() {
-                head() {
-                    title('testing')
-                }
-                body('testing')
-            }
-        }
-        finally {
-            writer.close()
         }
     }
 }

Added: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/macros.vm
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/macros.vm?view=auto&rev=503929
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/macros.vm
(added)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/macros.vm
Mon Feb  5 16:15:51 2007
@@ -0,0 +1,26 @@
+##
+## 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.
+##
+
+##
+## $Rev$ $Date$
+##
+
+#macro(test $test)
+    Testing $test
+#end

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

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

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

Added: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/testcase.vm
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/testcase.vm?view=auto&rev=503929
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/testcase.vm
(added)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/resources/testcase.vm
Mon Feb  5 16:15:51 2007
@@ -0,0 +1,104 @@
+##
+## 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.
+##
+
+##
+## $Rev$ $Date$
+##
+
+<html>
+<head>
+    <title>$testCase.name</title>
+</head>
+<body>
+    <div class="testcase">
+        <h1>TestCase: $testCase.name</h1>
+        
+        <!-- TODO: Include links to iteration -->
+        
+        <div class="testcase-summary">
+            <h2>Summary</h2>
+            
+            <table>
+                <tr>
+                    <td>Name:</td>
+                    <td>$testCase.name</td>
+                </tr>
+                
+                <tr>
+                    <td>Class:</td>
+                    <td>$testCase.className</td>
+                </tr>
+                
+                <tr>
+                    <td>Test:</td>
+                    <td>$testCase.testName</td>
+                </tr>
+                
+                <tr>
+                    <td>Started:</td>
+                    <td>$testCase.started</td>
+                </tr>
+                
+                <tr>
+                    <td>Ended:</td>
+                    <td>$testCase.ended</td>
+                </tr>
+                
+                <tr>
+                    <td>Duration:</td>
+                    <td>$testCase.duration</td>
+                </tr>
+                
+                <!--
+                NOTE: 'status' is an Expando which does not behave as desired in Velocity
:-(
+                -->
+                
+                <tr>
+                    <td>Status:</td>
+                    <td>$testCase.status.getProperty('text')</td>
+                </tr>
+                
+                <tr>
+                    <td>Passed:</td>
+                    <td>$testCase.status.getProperty('passed')</td>
+                </tr>
+            </table>
+        </div>
+        
+        <div class="testcase-details">
+            <h2>Details</h2>
+            
+            <!-- TODO: Include testcase details (full properties, full sections + streams)
-->
+            
+            <!--
+            <h3>Test Description</h3>
+            
+            <table>
+                #foreach ($entry in $testCase.result.testdescription)
+                <tr>
+                    <td>$entry.key</td>
+                    <td>$entry.value</td>
+                </tr>
+                #end
+            </table>
+            -->
+        </div>
+    </div>
+</body>
+</html>

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

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

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



Mime
View raw message