geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r505634 - in /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild: config/projects/Geronimo_CTS/Controller.groovy config/projects/Geronimo_CTS/report/ReportGenerator.groovy system/util/IterationConfigurator.groovy
Date Sat, 10 Feb 2007 05:10:40 GMT
Author: jdillon
Date: Fri Feb  9 21:10:39 2007
New Revision: 505634

URL: http://svn.apache.org/viewvc?view=rev&rev=505634
Log:
Rewrote iter configurator to use xml as input

Modified:
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Controller.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/system/util/IterationConfigurator.groovy

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Controller.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Controller.groovy?view=diff&rev=505634&r1=505633&r2=505634
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Controller.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/Controller.groovy
Fri Feb  9 21:10:39 2007
@@ -229,18 +229,10 @@
         params.tests = '%'
         
         def cfg = new IterationConfigurator(context)
-        cfg.configFile = 'project/tck-testsuite/iteration.conf'
+        cfg.configFile = 'project/tck-testsuite/iterations.xml'
         cfg.iteration = params.iteration
         cfg.applyTo = [ 'tests' ]
         cfg.apply()
-        
-        //
-        // TODO: May want to include extra deals from the conf, like
-        //       a header/title for the iteration, so we can use
-        //       that when generating reports
-        //
-        //       Need to change config to xml before we do this though...
-        //
         
         runtests()
     }

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=505634&r1=505633&r2=505634
==============================================================================
--- 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
Fri Feb  9 21:10:39 2007
@@ -109,6 +109,10 @@
             return new URI('.')
         }
         
+        //
+        // TODO: Use URI.relativize() ?
+        //
+        
         baseDir = baseDir.canonicalFile
         targetFile = targetFile.canonicalFile
         
@@ -177,8 +181,9 @@
             //
             
             // Scan for result files
+            def resultsDir = new File(workDir, 'javatest')
             def scanner = ant.fileScanner {
-            fileset(dir: workDir) {
+            fileset(dir: resultsDir) {
                     include(name: '**/*.jtr')
                 }
             }
@@ -186,6 +191,13 @@
             // Process each result
             log.info 'Processing test results'
             scanner.each { file ->
+                //
+                // TODO: Need to handle some cases where the report uses a classname
+                //       that does not match the jtr, which happens for some jaxp tests
+                //       Need to use the .jtr relative to the work/javatest dir
+                //       to create a synthetic classname for it
+                //
+                
                 def testCase = TestCase.fromFile(file)
                 
                 //
@@ -200,6 +212,12 @@
                 }
                 
                 iterModel << testCase
+                
+                //
+                // FIXME: testCase.name *might* have '.' in it which will hose up the
+                //        safe-ness... might want to have *all* packages exist as
+                //        flat peers with . names, then use exact name from testCase.name
+                //        for report detail.
                 
                 // Render testcase detail
                 def renderer = createRenderer('testcase-detail.vm', "${testCase.name}.html")

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/IterationConfigurator.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/IterationConfigurator.groovy?view=diff&rev=505634&r1=505633&r2=505634
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/IterationConfigurator.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/util/IterationConfigurator.groovy
Fri Feb  9 21:10:39 2007
@@ -28,7 +28,8 @@
 import gbuild.system.Parameters
 
 /**
- * ???
+ * Helper to load interation configuration from an xml file and process
+ * parameter substitution.
  */
 class IterationConfigurator extends LogSupport
 {
@@ -74,30 +75,52 @@
         }
     }
     
-    def apply() {
+    def loadConfig() {
         log.info "Loading configuration from: ${configFile}"
         
-        def config = shell.evaluate(configFile)
+        def parser = new XmlParser()
+        def config = parser.parse(configFile)
         
-        assert config instanceof List
-        assert config.size() > 0
+        log.info "Configuration (${config.iteration.size()})"
+        int i = 1
+        config.iteration.each { iter ->
+            log.info "${i++}: " + iter.get('name').text()
+            
+            iter.tests.test.each { test ->
+                log.info "    ${test.text()}"
+            }
+            
+            if (iter.options) {
+                log.info "    Options: ${iter.options.text()}"
+            }
+        }
         
-        log.info "Configuration (${config.size()})"
-        for (i in 1 .. config.size()) {
-            log.info "    $i=${config[i - 1]}"
+        return config
+    }
+    
+    def getReplacement(config) {
+        assert config
+        
+        def iter = config.iteration[iteration]
+        def list = []
+        iter.tests.test.each { test ->
+            list << test.text()
+        }
+        if (iter.options) {
+            list << iter.options.text()
         }
         
-        assert iteration <= config.size() : "Iteration index is out of range"
+        return list.join(' ')
+    }
+    
+    def apply() {
+        def config = loadConfig()
+        
+        assert iteration <= config.iteration.size() : "Iteration index is out of range"
         
         log.info "Applying iteration $iteration configuration to $applyTo"
         
-        def replace = config[iteration - 1]
-        if (replace instanceof List) {
-            replace = replace.join(' ')
-        }
-        else {
-            replace = "$replace"
-        }
+        def replace = getReplacement(config)
         log.info "Replacment value: ${replace}"
         
         applyTo.each { name ->



Mime
View raw message