category rename
authorClaus Gittinger <cg@exept.de>
Tue, 26 Feb 2002 11:13:44 +0100
changeset 67 7861684195ec
parent 66 31ae5b8fc382
child 68 9fd111438d60
category rename
TestCase.st
--- a/TestCase.st	Tue Feb 26 11:13:18 2002 +0100
+++ b/TestCase.st	Tue Feb 26 11:13:44 2002 +0100
@@ -120,121 +120,6 @@
 	^true
 ! !
 
-!TestCase methodsFor:'Dependencies'!
-
-addDependentToHierachy: anObject 
-	"an empty method. for Composite compability with TestSuite"
-!
-
-removeDependentFromHierachy: anObject 
-	"an empty method. for Composite compability with TestSuite"
-! !
-
-!TestCase methodsFor:'Printing'!
-
-name
-        ^ self class name.
-!
-
-printOn: aStream
-	aStream nextPutAll: self class name.
-	aStream nextPutAll: '>>'.
-	aStream nextPutAll: testSelector
-
-    "Modified: / 4.4.2000 / 18:59:53 / Sames"
-! !
-
-!TestCase methodsFor:'Private'!
-
-executeShould: aBlock inScopeOf: anExceptionalEvent 
-	[[aBlock value]
-		on: anExceptionalEvent
-		do: [:ex | ^true]]
-			on: TestResult error
-			do: [:ex | ^false].
-	^false.
-
-    "Modified: / 21.6.2000 / 10:03:03 / Sames"
-!
-
-performTest
-        self perform: testSelector asSymbol
-!
-
-setTestSelector: aSymbol
-	testSelector := aSymbol
-! !
-
-!TestCase methodsFor:'Running'!
-
-debug
-        self debugUsing:#runCase.
-"/        (self class selector: testSelector) runCase
-!
-
-debugAsFailure
-        self debugUsing: #runCaseAsFailure
-"/        (self class selector: testSelector) runCaseAsFailure
-!
-
-debugUsing: aSymbol 
-        self areAllResourcesAvailable ifFalse: [^TestResult signalErrorWith: 'Resource could not be initialized'].
-        [(self class selector: testSelector) perform: aSymbol] ensure: [self resources do: [:each | each reset]]
-!
-
-openDebuggerOnFailingTestMethod
-	"SUnit has halted one step in front of the failing test method. 
-	Step over the 'self halt' and send into 'self perform: testSelector' 
-	to see the failure from the beginning"
-
-	"/ self halt.
-	self perform: testSelector asSymbol
-
-    "Modified: / 21.6.2000 / 10:03:37 / Sames"
-!
-
-run
-	| result |
-	result := TestResult new.
-	self run: result.
-	^result
-!
-
-run: aResult
-	aResult runCase: self
-!
-
-run: aResult afterEachDo:block2
-        aResult runCase: self.
-        block2 value:self value:aResult.
-!
-
-run: aResult beforeEachDo:block1 afterEachDo:block2
-        block1 value:self value:aResult.
-        aResult runCase: self.
-        block2 value:self value:aResult.
-!
-
-runCase
-        self setUp.
-        [self performTest "self perform: testSelector asSymbol"] ensure: [self tearDown]
-
-    "Modified: / 21.6.2000 / 10:04:18 / Sames"
-!
-
-runCaseAsFailure
-        self setUp.
-        [[self openDebuggerOnFailingTestMethod] ensure: [self tearDown]] fork
-
-    "Modified: / 21.6.2000 / 10:04:33 / Sames"
-!
-
-setUp
-!
-
-tearDown
-! !
-
 !TestCase methodsFor:'accessing'!
 
 assert: aBoolean
@@ -312,6 +197,121 @@
     "Modified: / 21.6.2000 / 10:01:34 / Sames"
 ! !
 
+!TestCase methodsFor:'dependencies'!
+
+addDependentToHierachy: anObject 
+	"an empty method. for Composite compability with TestSuite"
+!
+
+removeDependentFromHierachy: anObject 
+	"an empty method. for Composite compability with TestSuite"
+! !
+
+!TestCase methodsFor:'printing'!
+
+name
+        ^ self class name.
+!
+
+printOn: aStream
+	aStream nextPutAll: self class name.
+	aStream nextPutAll: '>>'.
+	aStream nextPutAll: testSelector
+
+    "Modified: / 4.4.2000 / 18:59:53 / Sames"
+! !
+
+!TestCase methodsFor:'private'!
+
+executeShould: aBlock inScopeOf: anExceptionalEvent 
+	[[aBlock value]
+		on: anExceptionalEvent
+		do: [:ex | ^true]]
+			on: TestResult error
+			do: [:ex | ^false].
+	^false.
+
+    "Modified: / 21.6.2000 / 10:03:03 / Sames"
+!
+
+performTest
+        self perform: testSelector asSymbol
+!
+
+setTestSelector: aSymbol
+	testSelector := aSymbol
+! !
+
+!TestCase methodsFor:'running'!
+
+debug
+        self debugUsing:#runCase.
+"/        (self class selector: testSelector) runCase
+!
+
+debugAsFailure
+        self debugUsing: #runCaseAsFailure
+"/        (self class selector: testSelector) runCaseAsFailure
+!
+
+debugUsing: aSymbol 
+        self areAllResourcesAvailable ifFalse: [^TestResult signalErrorWith: 'Resource could not be initialized'].
+        [(self class selector: testSelector) perform: aSymbol] ensure: [self resources do: [:each | each reset]]
+!
+
+openDebuggerOnFailingTestMethod
+	"SUnit has halted one step in front of the failing test method. 
+	Step over the 'self halt' and send into 'self perform: testSelector' 
+	to see the failure from the beginning"
+
+	"/ self halt.
+	self perform: testSelector asSymbol
+
+    "Modified: / 21.6.2000 / 10:03:37 / Sames"
+!
+
+run
+	| result |
+	result := TestResult new.
+	self run: result.
+	^result
+!
+
+run: aResult
+	aResult runCase: self
+!
+
+run: aResult afterEachDo:block2
+        aResult runCase: self.
+        block2 value:self value:aResult.
+!
+
+run: aResult beforeEachDo:block1 afterEachDo:block2
+        block1 value:self value:aResult.
+        aResult runCase: self.
+        block2 value:self value:aResult.
+!
+
+runCase
+        self setUp.
+        [self performTest "self perform: testSelector asSymbol"] ensure: [self tearDown]
+
+    "Modified: / 21.6.2000 / 10:04:18 / Sames"
+!
+
+runCaseAsFailure
+        self setUp.
+        [[self openDebuggerOnFailingTestMethod] ensure: [self tearDown]] fork
+
+    "Modified: / 21.6.2000 / 10:04:33 / Sames"
+!
+
+setUp
+!
+
+tearDown
+! !
+
 !TestCase methodsFor:'testing'!
 
 areAllResourcesAvailable
@@ -323,6 +323,6 @@
 !TestCase class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.20 2002-02-26 10:13:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.21 2002-02-26 10:13:44 cg Exp $'
 ! !
 TestCase initialize!