geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r504806 - in /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model: ClassModel.groovy GroupModel.groovy IterationModel.groovy PackageModel.groovy SuiteModel.groovy
Date Thu, 08 Feb 2007 07:11:31 GMT
Author: jdillon
Date: Wed Feb  7 23:11:31 2007
New Revision: 504806

URL: http://svn.apache.org/viewvc?view=rev&rev=504806
Log:
Hook up basic aggregation

Modified:
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/ClassModel.groovy
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/GroupModel.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/PackageModel.groovy
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/SuiteModel.groovy

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/ClassModel.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/ClassModel.groovy?view=diff&rev=504806&r1=504805&r2=504806
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/ClassModel.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/ClassModel.groovy
Wed Feb  7 23:11:31 2007
@@ -33,11 +33,15 @@
 class ClassModel extends GroupModel
 {
     def ClassModel() {
-        super('testName', TestCaseModel)
+        super('name', TestCaseModel)
     }
     
     List getTestNames() {
         return childNames
+    }
+    
+    long getTestCount() {
+        return testNames.size()
     }
 }
 

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/GroupModel.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/GroupModel.groovy?view=diff&rev=504806&r1=504805&r2=504806
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/GroupModel.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/GroupModel.groovy
Wed Feb  7 23:11:31 2007
@@ -96,8 +96,44 @@
         return model
     }
     
-    List getChildNames() {
+    protected List getChildNames() {
         return children.keySet().sort(Sorting.CASE_INSENSITIVE)
+    }
+    
+    protected List aggregateChildValues(String fieldName, boolean sorted) {
+        assert fieldName
+        
+        def list = []
+        
+        children.each { key, value ->
+            list.addAll(value[fieldName])
+        }
+        
+        if (sorted) {
+            list = list.sort(Sorting.CASE_INSENSITIVE)
+        }
+        
+        return list
+    }
+    
+    protected List aggregateChildValues(String fieldName) {
+        return aggregateChildValues(fieldName, true)
+    }
+    
+    protected long sumChildValues(String fieldName) {
+        assert fieldName
+        
+        def sum = 0
+        
+        children.each { key, value ->
+            sum += value[fieldName]
+        }
+        
+        return sum
+    }
+    
+    long size() {
+        return children.size()
     }
     
     //

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=504806&r1=504805&r2=504806
==============================================================================
--- 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
Wed Feb  7 23:11:31 2007
@@ -41,5 +41,25 @@
     List getPackageNames() {
         return childNames
     }
+    
+    long getPacakgeCount() {
+        return packageNames.size()
+    }
+    
+    List getClassNames() {
+        return aggregateChildValues('classNames')
+    }
+    
+    long getClassCount() {
+        return classNames.size()
+    }
+    
+    List getTestNames() {
+        return aggregateChildValues('testNames')
+    }
+    
+    long getTestCount() {
+        return testNames.size()
+    }
 }
 

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/PackageModel.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/PackageModel.groovy?view=diff&rev=504806&r1=504805&r2=504806
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/PackageModel.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/PackageModel.groovy
Wed Feb  7 23:11:31 2007
@@ -40,5 +40,17 @@
     List getClassNames() {
         return childNames
     }
+    
+    long getClassCount() {
+        return childNames.size()
+    }
+    
+    List getTestNames() {
+        return aggregateChildValues('testNames')
+    }
+    
+    long getTestCount() {
+        return testNames.size()
+    }
 }
 

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/SuiteModel.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/SuiteModel.groovy?view=diff&rev=504806&r1=504805&r2=504806
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/SuiteModel.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/SuiteModel.groovy
Wed Feb  7 23:11:31 2007
@@ -40,27 +40,39 @@
 class SuiteModel extends GroupModel
 {
     IterationModel createIteration(iter) {
-        iter = String.valueOf(iter)
-        
-        return addChild(iter, new IterationModel())
+        return addChild(String.valueOf(iter), new IterationModel())
     }
     
     def leftShift(TestCase testCase) {
         throw new Exception('Use iteration model to add test cases')
     }
     
-    int getIterations() {
+    int getIterationCount() {
         return children.size()
     }
     
     List getPackageNames() {
-        def list = []
-        
-        children.each { key, value ->
-            list.addAll(value.packageNames)
-        }
-        
-        return list.sort(Sorting.CASE_INSENSITIVE)
+        return aggregateChildValues('packageNames')
+    }
+    
+    long getPackageCount() {
+        return packageNames.size()
+    }
+    
+    List getClassNames() {
+        return aggregateChildValues('classNames')
+    }
+    
+    long getClassCount() {
+        return classNames.size()
+    }
+    
+    List getTestNames() {
+        return aggregateChildValues('testNames')
+    }
+    
+    long getTestCount() {
+        return testNames.size()
     }
 }
 



Mime
View raw message