#DOCUMENTATION
authorClaus Gittinger <cg@exept.de>
Fri, 25 Mar 2016 16:29:35 +0100
changeset 640 b319a80a14e2
parent 639 ed6e926776b7
child 641 542aa9db84a0
#DOCUMENTATION class: TestRunner comment/format in: #defectMenu changed: #script #script:
TestRunner.st
--- a/TestRunner.st	Fri Mar 25 16:29:17 2016 +0100
+++ b/TestRunner.st	Fri Mar 25 16:29:35 2016 +0100
@@ -1,5 +1,7 @@
 "{ Package: 'stx:goodies/sunit' }"
 
+"{ NameSpace: Smalltalk }"
+
 ApplicationModel subclass:#TestRunner
 	instanceVariableNames:'result lastTestCase lastPass defect allDefects defectMenu details
 		mode scriptModel script numberOfTestsToRun testsWhichFailed
@@ -286,15 +288,9 @@
 !
 
 defectMenu
-    "automatically generated by UIPainter ..."
-
-    "*** the code below creates a default model when invoked."
-    "*** (which may not be the one you wanted)"
-    "*** Please change as required and accept it in the browser."
-
-    ^defectMenu isNil
-	ifTrue: [defectMenu := OrderedCollection new asValue]
-	ifFalse: [defectMenu]
+    ^ defectMenu isNil
+        ifTrue: [defectMenu := OrderedCollection new asValue]
+        ifFalse: [defectMenu]
 
     "Modified: / 4.4.2000 / 20:00:31 / Sames"
 !
@@ -343,13 +339,11 @@
 script
     "automatically generated by UIPainter ..."
 
-    "*** the code below creates a default model when invoked."
-    "*** (which may not be the one you wanted)"
-    "*** Please change as required and accept it in the browser."
+    <resource: #uiAspect>
 
     script isNil ifTrue:[
-	script := ValueHolder new.
-	script onChangeSend:#suiteSelectionChanged to:self.
+        script := ValueHolder new.
+        script onChangeSend:#suiteSelectionChanged to:self.
     ].
     ^ script.
 
@@ -357,21 +351,7 @@
 !
 
 script:something
-    "automatically generated by UIPainter ..."
-
-    "This method is used when I am embedded as subApplication,"
-    "and the mainApp wants to connect its aspects to mine."
-
-"/     |holder|
-
-"/     (holder := builder bindingAt:#script) notNil ifTrue:[
-"/         holder removeDependent:self.
-"/     ].
     builder aspectAt:#script put:something.
-"/     something notNil ifTrue:[
-"/         something addDependent:self.
-"/     ].
-    ^ self.
 
     "Created: / 21.6.2000 / 12:04:36 / Sames"
 !
@@ -424,28 +404,28 @@
 
     testCaseName := self selectedScript.
     testCaseName isNil ifTrue:[
-	testCaseName := self tests contents.
-	testCaseName notNil ifTrue:[
-	    testCaseName := testCaseName string
-	]
+        testCaseName := self tests contents.
+        testCaseName notNil ifTrue:[
+            testCaseName := testCaseName string
+        ]
     ].
     testCaseName notNil ifTrue:[
-	testCase := Smalltalk at:testCaseName asSymbol.
-	testCase notNil ifTrue:[
-	    browser := UserPreferences current systemBrowserClass openInClass:testCase.
-	    MessageNotUnderstood
-		handle:[:ex | ]
-		do:[
-		    (defect := self selection) notNil ifTrue:[
-			singleCase := allDefects at:defect ifAbsent: [nil].
-		    ].
-		    singleCase notNil ifTrue:[
-			browser switchToSelector:singleCase selector
-		    ] ifFalse:[
-			browser selectProtocolsMatching:'test*'
-		    ]
-		]
-	]
+        testCase := Smalltalk at:testCaseName asSymbol.
+        testCase notNil ifTrue:[
+            browser := testCase browserClass openInClass:testCase.
+            MessageNotUnderstood
+                handle:[:ex | ]
+                do:[
+                    (defect := self selection) notNil ifTrue:[
+                        singleCase := allDefects at:defect ifAbsent: [nil].
+                    ].
+                    singleCase notNil ifTrue:[
+                        browser switchToSelector:singleCase selector
+                    ] ifFalse:[
+                        browser selectProtocolsMatching:'test*'
+                    ]
+                ]
+        ]
     ]
 !
 
@@ -581,7 +561,7 @@
                 beforeEachDo:
                     [:eachCase :eachResult |
                     caseName := eachCase getTestName.
-                    caseName size == 0 ifTrue:[self halt].
+                    caseName size == 0 ifTrue:[self halt:'oops - className?'].
                     self displayDetails:(caseName , '...').
                     self testPassed:caseName]
                 afterEachDo:
@@ -886,14 +866,14 @@
 displayDefects: aCollection
     | failedTests|
     aCollection isEmpty ifTrue: [
-	self selectionHolder value:''.
-	self enableDefects value:false.
-	self enableDebugButton value:false.
-	^ self
+        self selectionHolder value:''.
+        self enableDefects value:false.
+        self enableDebugButton value:false.
+        ^ self
     ].
     allDefects := Dictionary new.
     aCollection do: [:each | allDefects at: each printString put: each].
-    failedTests := allDefects keys asOrderedCollection sort.
+    failedTests := allDefects keysSorted.
     self defectMenu value: failedTests.
 "/    self selectionHolder value: failedTests first withoutNotifying:self.
     self enableDefects value:true.
@@ -1056,14 +1036,14 @@
 !TestRunner class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestRunner.st,v 1.65 2013-04-28 13:46:23 cg Exp $'
+    ^ '$Header$'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestRunner.st,v 1.65 2013-04-28 13:46:23 cg Exp $'
+    ^ '$Header$'
 !
 
 version_SVN
-    ^ '§Id: TestRunner.st 182 2009-12-05 18:12:17Z vranyj1 §'
+    ^ '$Id$'
 ! !