geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r505943 - /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/
Date Sun, 11 Feb 2007 12:44:34 GMT
Author: jdillon
Date: Sun Feb 11 04:44:33 2007
New Revision: 505943

URL: http://svn.apache.org/viewvc?view=rev&rev=505943
Log:
Cleaned up model, dropped unused fluff

Added:
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/FactoryGroupModel.groovy
  (with props)
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
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestCaseModel.groovy
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestModel.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=505943&r1=505942&r2=505943
==============================================================================
--- 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
Sun Feb 11 04:44:33 2007
@@ -30,7 +30,7 @@
  *
  *    test-model*
  */
-class ClassModel extends GroupModel
+class ClassModel extends FactoryGroupModel
 {
     def ClassModel(String name) {
         super(name, 'name', TestCaseModel)
@@ -47,12 +47,8 @@
         return children.values().sort()
     }
     
-    List getTestNames() {
-        return childNames
-    }
-    
     long getTestCount() {
-        return testNames.size()
+        return tests.size()
     }
     
     String getPackageName() {

Added: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/FactoryGroupModel.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/FactoryGroupModel.groovy?view=auto&rev=505943
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/FactoryGroupModel.groovy
(added)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/FactoryGroupModel.groovy
Sun Feb 11 04:44:33 2007
@@ -0,0 +1,79 @@
+/*
+ * 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
+
+import gbuild.config.projects.Geronimo_CTS.report.TestCase
+
+/**
+ * Support for models which represent groups of tests that have their
+ * children models created dynamically.
+ */
+abstract class FactoryGroupModel
+    extends GroupModel
+{
+    protected String childName
+    
+    protected Class childType
+    
+    protected FactoryGroupModel(String name, String childName, Class childType) {
+        super(name)
+        
+        assert childName
+        assert childType
+        
+        this.childName = childName
+        this.childType = childType
+    }
+    
+    def leftShift(TestCase testCase) {
+        assert testCase
+        
+        // Lookup the collection for the testCase
+        TestModel model = lookupModel(testCase)
+        
+        // If non-existant, create a new one
+        if (!model) {
+            model = createModel(testCase)
+            model.parent = this
+        }
+        
+        // Add the test case to the child collection
+        return model << testCase
+    }
+    
+    protected TestModel lookupModel(TestCase testCase) {
+        assert testCase
+        
+        return children[testCase[childName]]
+    }
+    
+    protected TestModel createModel(TestCase testCase) {
+        assert testCase
+        
+        def name = testCase[childName]
+        
+        return addChild(name, childType.newInstance(name))
+    }
+}
+

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

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

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

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=505943&r1=505942&r2=505943
==============================================================================
--- 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
Sun Feb 11 04:44:33 2007
@@ -34,60 +34,14 @@
  */
 abstract class GroupModel
     extends TestModel
+    implements TestModelStateListener
 {
     Map children = [:]
     
-    protected String childName
-    
-    protected Class childType
-    
-    protected GroupModel(String name, String childName, Class childType) {
-        super(name)
-        
-        assert childName
-        assert childType
-        
-        this.childName = childName
-        this.childType = childType
-    }
-    
-    //
-    // HACK: For SuiteModel
-    //
     protected GroupModel(String name) {
         super(name)
     }
     
-    def leftShift(TestCase testCase) {
-        assert testCase
-        
-        // Lookup the collection for the testCase
-        TestModel model = lookupModel(testCase)
-        
-        // If non-existant, create a new one
-        if (!model) {
-            model = createModel(testCase)
-            model.parent = this
-        }
-        
-        // Add the test case to the child collection
-        return model << testCase
-    }
-    
-    protected TestModel lookupModel(TestCase testCase) {
-        assert testCase
-        
-        return children[testCase[childName]]
-    }
-    
-    protected TestModel createModel(TestCase testCase) {
-        assert testCase
-        
-        def name = testCase[childName]
-        
-        return addChild(name, childType.newInstance(name))
-    }
-    
     protected TestModel addChild(String name, TestModel model) {
         assert model
         
@@ -100,52 +54,6 @@
         model << this
         
         return model
-    }
-    
-    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 aggregateChildModels() {
-        def list = []
-        
-        children.keySet().sort(Sorting.CASE_INSENSITIVE).each {
-            list << children[it]
-        }
-        
-        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() {

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=505943&r1=505942&r2=505943
==============================================================================
--- 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 11 04:44:33 2007
@@ -32,7 +32,7 @@
  *        class-model*
  *            test-model*
  */
-class IterationModel extends GroupModel
+class IterationModel extends FactoryGroupModel
 {
     Map runtestsProperties
     
@@ -58,12 +58,8 @@
         return children.values().sort()
     }
     
-    List getPackageNames() {
-        return childNames
-    }
-    
     long getPacakgeCount() {
-        return packageNames.size()
+        return packages.size()
     }
     
     Collection getClasses() {
@@ -76,20 +72,22 @@
         return list.sort()
     }
     
-    List getClassNames() {
-        return aggregateChildValues('classNames')
-    }
-    
     long getClassCount() {
-        return classNames.size()
+        return classes.size()
     }
     
-    List getTestNames() {
-        return aggregateChildValues('testNames')
+    Collection getTests() {
+        def list = []
+        
+        packages.each { pkg ->
+            list.addAll(pkg.tests)
+        }
+        
+        return list.sort()
     }
     
     long getTestCount() {
-        return testNames.size()
+        return tests.size()
     }
     
     String getHref() {

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=505943&r1=505942&r2=505943
==============================================================================
--- 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
Sun Feb 11 04:44:33 2007
@@ -31,22 +31,18 @@
  *    class-model*
  *        test-model*
  */
-class PackageModel extends GroupModel
+class PackageModel extends FactoryGroupModel
 {
     def PackageModel(String name) {
         super(name, 'className', ClassModel)
     }
     
     Collection getClasses() {
-        return aggregateChildModels()
-    }
-    
-    List getClassNames() {
-        return childNames
+        return children.values().sort()
     }
     
     long getClassCount() {
-        return childNames.size()
+        return classes.size()
     }
     
     Collection getTests() {
@@ -59,12 +55,8 @@
         return list.sort()
     }
     
-    List getTestNames() {
-        return aggregateChildValues('testNames')
-    }
-    
     long getTestCount() {
-        return testNames.size()
+        return tests.size()
     }
     
     String getHref() {

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=505943&r1=505942&r2=505943
==============================================================================
--- 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
Sun Feb 11 04:44:33 2007
@@ -76,10 +76,6 @@
         return list.sort()
     }
     
-    List getPackageNames() {
-        return aggregateChildValues('packageNames')
-    }
-    
     long getPackageCount() {
         return packages.size()
     }
@@ -94,10 +90,6 @@
         return list.sort()
     }
     
-    List getClassNames() {
-        return aggregateChildValues('classNames')
-    }
-    
     long getClassCount() {
         return classes.size()
     }
@@ -110,10 +102,6 @@
         }
         
         return list.sort()
-    }
-    
-    List getTestNames() {
-        return aggregateChildValues('testNames')
     }
     
     long getTestCount() {

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestCaseModel.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestCaseModel.groovy?view=diff&rev=505943&r1=505942&r2=505943
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestCaseModel.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestCaseModel.groovy
Sun Feb 11 04:44:33 2007
@@ -52,12 +52,12 @@
     def leftShift(TestCase testCase) {
         def model = super.leftShift(testCase)
         
-        testCaseAdded(testCase)
+        collectData(testCase)
         
         return model
     }
     
-    def testCaseAdded(TestCase testCase) {
+    def collectData(TestCase testCase) {
         this.className = testCase.className
         this.testName = testCase.testName
         this.started = testCase.started

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=505943&r1=505942&r2=505943
==============================================================================
--- 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 11 04:44:33 2007
@@ -29,7 +29,7 @@
  * Support for model implementations which handle test case data collection.
  */
 abstract class TestModel
-    implements TestModelStateListener, Comparable
+    implements Comparable
 {
     protected Set listeners = new TreeSet()
     



Mime
View raw message