#REFACTORING by cg default
authorClaus Gittinger <cg@exept.de>
Sat, 02 May 2020 19:50:41 +0200
changeset 19587 4b63b1c153e1
parent 19586 99be90215538
#REFACTORING by cg class: TestRunner2::ResultList changed: #makeClassEntryFor:result:tests: (send #label: instead of #labeled:) #makeResultEntryFor: (send #label: instead of #labeled:) #makeRootEntry (send #label: instead of #labeled:) #makeTestEntryFor:result: (send #label: instead of #labeled:) class: TestRunner2::ResultList::ListEntry changed: #label class: TestRunner2::ResultList::ListEntry class added: #label: changed: #labeled:
Tools__TestRunner2.st
--- a/Tools__TestRunner2.st	Sat May 02 12:33:22 2020 +0200
+++ b/Tools__TestRunner2.st	Sat May 02 19:50:41 2020 +0200
@@ -59,7 +59,7 @@
 
 HierarchicalItem subclass:#ListEntry
 	instanceVariableNames:'label realLabel test result'
-	classVariableNames:'PassedText FailedText ErrorText'
+	classVariableNames:'ErrorText FailedText PassedText'
 	poolDictionaries:''
 	privateIn:TestRunner2::ResultList
 !
@@ -2336,7 +2336,7 @@
 makeClassEntryFor: class result: result tests: tests
 
     | entry children |
-    entry := ListEntry labeled: (class perform:#sunitName ifNotUnderstood:[class name]).
+    entry := ListEntry label: (class perform:#sunitName ifNotUnderstood:[class name]).
     children := (tests asSortedCollection: [:a :b|a selector < b selector])
         collect:[:test|self makeTestEntryFor: test result: result].
     entry setChildren: children.
@@ -2344,6 +2344,7 @@
     ^entry
 
     "Created: / 19-03-2010 / 08:41:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 02-05-2020 / 19:47:29 / cg"
 !
 
 makeResultEntryFor: result
@@ -2353,7 +2354,7 @@
     result timestamp notNil ifTrue:[
         label := label , (result timestamp printStringFormat: timestampFormat)
     ].
-    entry := ListEntry labeled: label.
+    entry := ListEntry label: label.
     classes := Dictionary new.
     result tests do: [:test|
         (classes at: test class ifAbsentPut:[OrderedCollection new])
@@ -2367,13 +2368,13 @@
     ^entry.
 
     "Created: / 19-03-2010 / 08:36:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 30-07-2013 / 19:29:10 / cg"
+    "Modified: / 02-05-2020 / 19:47:34 / cg"
 !
 
 makeRootEntry
 
     | entry children |
-    entry := ListEntry labeled: 'Test Results'.
+    entry := ListEntry label: 'Test Results'.
     results isEmptyOrNil ifTrue:[^entry].
     children := results size == 1 
                     ifTrue:
@@ -2385,13 +2386,13 @@
 
     "Created: / 07-02-2010 / 13:39:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 19-03-2010 / 08:39:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 04-08-2011 / 19:05:55 / cg"
+    "Modified: / 02-05-2020 / 19:47:38 / cg"
 !
 
 makeTestEntryFor:test result: result
     | entry |
     
-    entry := ListEntry labeled: test selector.
+    entry := ListEntry label: test selector.
     entry test: test.
     (result errors includes: test) ifTrue:[
         entry result: #error
@@ -2406,6 +2407,7 @@
 
     "Created: / 19-03-2010 / 08:41:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified (format): / 28-03-2019 / 11:47:01 / Claus Gittinger"
+    "Modified: / 02-05-2020 / 19:47:49 / cg"
 ! !
 
 !TestRunner2::ResultList::ListEntry class methodsFor:'initialization'!
@@ -2439,7 +2441,15 @@
 
 !TestRunner2::ResultList::ListEntry class methodsFor:'instance creation'!
 
+label: aStringOrText
+
+    ^self new label: aStringOrText
+
+    "Created: / 02-05-2020 / 19:47:14 / cg"
+!
+
 labeled: aStringOrText
+    <resource: #obsolete>
 
     ^self new label: aStringOrText
 
@@ -2462,13 +2472,13 @@
     | result |
 
     result := self result.
-    realLabel ifNil:[
+    realLabel isNil ifTrue:[
         realLabel := label.
-        test ifNotNil:[
+        test notNil ifTrue:[
             result == #passed ifTrue:[realLabel := realLabel , self class passedText].
             result == #error ifTrue:[realLabel := realLabel , self class errorText].
             result == #failed ifTrue:[realLabel := realLabel , self class failedText].
-        ] ifNil: [
+        ] ifFalse: [
             realLabel := realLabel , self summary.
         ]        
     ].
@@ -2477,7 +2487,7 @@
 
     "Modified: / 07-02-2010 / 18:28:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 08-02-2010 / 10:15:35 / Jan Vrany <jan,vrany@fit.cvut.cz>"
-    "Modified (format): / 06-06-2016 / 14:43:01 / cg"
+    "Modified: / 02-05-2020 / 19:49:26 / cg"
 !
 
 label:aText