geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r504803 - in /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model: GroupModel.groovy SuiteModel.groovy
Date Thu, 08 Feb 2007 06:27:04 GMT
Author: jdillon
Date: Wed Feb  7 22:27:03 2007
New Revision: 504803

URL: http://svn.apache.org/viewvc?view=rev&rev=504803
Log:
Added addChild() to allow more reuse

Modified:
    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/SuiteModel.groovy

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=504803&r1=504802&r2=504803
==============================================================================
--- 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 22:27:03 2007
@@ -61,10 +61,9 @@
         // Lookup the collection for the testCase
         TestModel model = lookupModel(testCase)
         
-        // If non-existant, create a new one, and register ourselves for events
+        // If non-existant, create a new one
         if (!model) {
             model = createModel(testCase)
-            model << this
         }
         
         // Add the test case to the child collection
@@ -80,11 +79,19 @@
     protected TestModel createModel(TestCase testCase) {
         assert testCase
         
+        return addChild(testCase[childName], childType.newInstance())
+    }
+    
+    protected TestModel addChild(Object id, TestModel model) {
+        assert model
+        
         // Make sure we don't clobber anything
-        assert !children[testCase[childName]]
+        assert !children[id]
+        
+        children[id] = model
         
-        def model = childType.newInstance()
-        children[testCase[childName]] = model
+        // Register ourselves for our childrens events
+        model << this
         
         return model
     }

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=504803&r1=504802&r2=504803
==============================================================================
--- 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 22:27:03 2007
@@ -39,18 +39,10 @@
  */
 class SuiteModel extends GroupModel
 {
-    IterationModel createIterationModel(iter) {
+    IterationModel createIteration(iter) {
         iter = String.valueOf(iter)
         
-        // Make sure we don't clobber anything
-        assert children[iter] == null
-        
-        def model = new IterationModel()
-        model << this
-        
-        children[iter] = model
-        
-        return model
+        return addChild(iter, new IterationModel())
     }
     
     def leftShift(TestCase testCase) {



Mime
View raw message