TestCase.st
author Claus Gittinger <cg@exept.de>
Mon, 26 Apr 2010 10:46:15 +0200
changeset 211 3a40b828ce9a
parent 209 cec4475f7138
child 216 0b7c8dc16ed4
permissions -rw-r--r--
comment/format in: #testSelectors
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
     1
"{ Package: 'stx:goodies/sunit' }"
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
Object subclass:#TestCase
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
	instanceVariableNames:'testSelector'
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
	classVariableNames:''
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
	poolDictionaries:''
6
78bb1397e43d added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents: 4
diff changeset
     7
	category:'SUnit-Base'
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
!
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
87
24e88e7f5d88 remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
    10
TestCase class instanceVariableNames:'lastTestRunResultOrNil lastTestRunsFailedTests'
81
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    11
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    12
"
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    13
 No other class instance variables are inherited by this class.
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    14
"
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    15
!
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    16
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    17
TestCase comment:'A TestCase is a Command representing the future running of a test case. Create one with the class method #selector: aSymbol, passing the name of the method to be run when the test case runs.
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    18
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    19
When you discover a new fixture, subclass TestCase, declare instance variables for the objects in the fixture, override #setUp to initialize the variables, and possibly override# tearDown to deallocate any external resources allocated in #setUp.
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    20
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    21
When you are writing a test case method, send #assert: aBoolean when you want to check for an expected value. For example, you might say "self assert: socket isOpen" to test whether or not a socket is open at a point in a test.'
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    22
!
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    23
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    24
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    25
!TestCase class methodsFor:'initialization'!
12
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    26
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    27
initialize
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    28
    ResumableTestFailure autoload
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    29
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    30
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    31
     self initialize
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    32
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    33
! !
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    34
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    35
!TestCase class methodsFor:'instance creation'!
2
6f450bf08bc0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
    36
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    37
debug: aSymbol
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    38
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    39
	^(self selector: aSymbol) debug
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    40
			
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    41
!
2
6f450bf08bc0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
    42
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    43
run: aSymbol
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    44
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    45
	^(self selector: aSymbol) run
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    46
			
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    47
!
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    48
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
selector: aSymbol
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    50
6
78bb1397e43d added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents: 4
diff changeset
    51
	^self new setTestSelector: aSymbol
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    52
			
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    53
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    54
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    55
suite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    56
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    57
	^self buildSuite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    58
			
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
! !
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    61
!TestCase class methodsFor:'accessing'!
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
    62
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    63
allTestSelectors
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    64
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    65
        ^ (self allSelectors select: [:each | self isTestSelector:each]) asOrderedCollection sort
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    66
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    67
    "Modified: / 06-08-2006 / 11:46:32 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    68
!
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
    69
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    70
forgetLastTestRunResult
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    71
    lastTestRunResultOrNil ~~ nil ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    72
        lastTestRunResultOrNil := nil.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    73
        Smalltalk changed:#lastTestRunResult with:(Array with:self with:nil).
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    74
        self changed:#lastTestRunResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    75
    ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    76
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    77
    "Modified: / 06-08-2006 / 11:40:07 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    78
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    79
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    80
isTestSelector:aSelector
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    81
200
bfceaad3c3cc patch from Jan Vrany
fm
parents: 197
diff changeset
    82
    ^aSelector ~= #testName 
bfceaad3c3cc patch from Jan Vrany
fm
parents: 197
diff changeset
    83
        and:[aSelector startsWith: 'test']
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    84
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    85
    "Created: / 06-08-2006 / 11:46:17 / cg"
200
bfceaad3c3cc patch from Jan Vrany
fm
parents: 197
diff changeset
    86
    "Modified: / 19-08-2009 / 14:42:58 / Jan Vrany <vranyj1@fel.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    87
!
81
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    88
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    89
lastTestRunResultOrNil
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    90
    ^ lastTestRunResultOrNil
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    91
!
87
24e88e7f5d88 remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
    92
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    93
rememberFailedTest:selector
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    94
    lastTestRunsFailedTests isNil ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    95
        lastTestRunsFailedTests := Set new.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    96
    ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    97
    
208
c32437e0f7b8 code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    98
    (lastTestRunsFailedTests includes:selector) ifFalse:[
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    99
        lastTestRunsFailedTests add:selector.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   100
        Smalltalk changed:#lastTestRunResult with:(Array with:self with:selector).
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   101
        self changed:#lastTestRunResult with:selector.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   102
    ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   103
    self rememberFailedTestRun
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   104
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   105
    "Modified: / 06-08-2006 / 11:01:08 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   106
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   107
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   108
rememberFailedTestRun
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   109
    lastTestRunResultOrNil ~~ false ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   110
        lastTestRunResultOrNil := false.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   111
        Smalltalk changed:#lastTestRunResult with:(Array with:self with:nil).
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   112
        self changed:#lastTestRunResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   113
    ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   114
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   115
    "Modified: / 06-08-2006 / 11:00:42 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   116
!
81
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
   117
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   118
rememberFailedTestRunWithResult:result
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   119
    self rememberFailedTestRun.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   120
    self rememberFailedTestsFromResult:result.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   121
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   122
    "Modified: / 05-08-2006 / 12:45:19 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   123
!
87
24e88e7f5d88 remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   124
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   125
rememberFailedTestsFromResult:result
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   126
    (result failures union:result errors) do:[:eachFailedTest |
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   127
        self rememberFailedTest:(eachFailedTest selector).
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   128
    ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   129
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   130
    "Created: / 05-08-2006 / 12:45:01 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   131
    "Modified: / 06-08-2006 / 10:54:31 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   132
!
87
24e88e7f5d88 remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   133
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   134
rememberPassedTest:selector
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   135
    lastTestRunsFailedTests notNil ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   136
        (lastTestRunsFailedTests includes:selector) ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   137
            lastTestRunsFailedTests remove:selector ifAbsent:nil.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   138
            Smalltalk changed:#lastTestRunResult with:(Array with:self with:selector).
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   139
            self changed:#lastTestRunResult with:selector.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   140
            lastTestRunsFailedTests isEmpty ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   141
                lastTestRunsFailedTests := nil.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   142
                self forgetLastTestRunResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   143
            ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   144
        ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   145
    ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   146
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   147
    "Modified: / 06-08-2006 / 11:40:16 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   148
!
87
24e88e7f5d88 remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   149
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   150
rememberPassedTestRun
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   151
    lastTestRunResultOrNil ~~ true ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   152
        lastTestRunResultOrNil := true.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   153
        lastTestRunsFailedTests := nil.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   154
        Smalltalk changed:#lastTestRunResult with:(Array with:self with:nil).
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   155
        self changed:#lastTestRunResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   156
    ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   157
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   158
    "Modified: / 06-08-2006 / 11:01:22 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   159
!
131
86ad122e57f6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   160
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   161
rememberPassedTestsFromResult:result
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   162
    (result passed) do:[:eachPassedTest |
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   163
        self rememberPassedTest:(eachPassedTest selector).
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   164
    ].
131
86ad122e57f6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   165
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   166
    "Created: / 06-08-2006 / 10:29:47 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   167
    "Modified: / 06-08-2006 / 11:42:01 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   168
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   169
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   170
resources
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   171
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   172
	^#()
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   173
			
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   174
!
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   175
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   176
sunitVersion
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   177
	^'3.1'
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   178
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   179
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   180
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   181
testSelectorFailed:selector
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   182
    ^ lastTestRunsFailedTests notNil and:[lastTestRunsFailedTests includes:selector]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   183
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   184
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   185
testSelectors
211
3a40b828ce9a comment/format in: #testSelectors
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   186
    "the default here is all methods in a test*-category;
3a40b828ce9a comment/format in: #testSelectors
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   187
     this can, of course, be redefined in a testCase-class, which knows better"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   188
211
3a40b828ce9a comment/format in: #testSelectors
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   189
    ^ (self selectors select: [:each | 'test*' match: each]) asOrderedCollection sort
3a40b828ce9a comment/format in: #testSelectors
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   190
3a40b828ce9a comment/format in: #testSelectors
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   191
    "Modified: / 24-04-2010 / 14:04:51 / cg"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   192
! !
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   193
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   194
!TestCase class methodsFor:'building suites'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   195
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   196
buildSuite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   197
	| suite |
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   198
	^self isAbstract
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   199
		ifTrue: 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   200
			[suite := self suiteClass named: self name asString.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   201
			self allSubclasses 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   202
				do: [:each | each isAbstract ifFalse: [suite addTest: each buildSuiteFromSelectors]].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   203
			suite]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   204
		ifFalse: [self buildSuiteFromSelectors]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   205
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   206
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   207
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   208
buildSuiteFromAllSelectors
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   209
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   210
	^self buildSuiteFromMethods: self allTestSelectors
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   211
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   212
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   213
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   214
buildSuiteFromLocalSelectors
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   215
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   216
	^self buildSuiteFromMethods: self testSelectors
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   217
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   218
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   219
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   220
buildSuiteFromMethods: testMethods
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   221
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   222
	^testMethods
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   223
		inject: (self suiteClass named: self name asString)
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   224
		into: [:suite :selector |
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   225
			suite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   226
				addTest: (self selector: selector);
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   227
				yourself]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   228
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   229
!
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
   230
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   231
buildSuiteFromSelectors
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   232
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   233
	^self shouldInheritSelectors
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   234
		ifTrue: [self buildSuiteFromAllSelectors]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   235
		ifFalse: [self buildSuiteFromLocalSelectors]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   236
			
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   237
!
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   238
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   239
suiteClass
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   240
	^TestSuite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   241
			
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   242
! !
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   243
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   244
!TestCase class methodsFor:'misc ui support'!
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   245
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   246
iconInBrowserSymbol
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   247
    <resource: #programImage>
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   248
205
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   249
    |lastResult|
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   250
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   251
    self theNonMetaclass isAbstract ifTrue:[^ super iconInBrowserSymbol].
205
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   252
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   253
    lastResult := self lastTestRunResultOrNil.
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   254
    lastResult == true ifTrue:[
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   255
        ^ #testCasePassedIcon
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   256
    ].
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   257
    lastResult == false ifTrue:[
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   258
        ^ #testCaseFailedIcon
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   259
    ].
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   260
    ^ #testCaseClassIcon
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   261
! !
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   262
197
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   263
!TestCase class methodsFor:'quick testing'!
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   264
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   265
assert: aBoolean
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   266
    ^ self new assert: aBoolean
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   267
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   268
    "
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   269
     TestCase assert: true
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   270
    "
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   271
!
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   272
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   273
should: aBlock raise: anError
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   274
    ^ self new should: aBlock raise: anError
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   275
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   276
    "
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   277
     TestCase should:[ self error ] raise: Error
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   278
    "
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   279
! !
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   280
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   281
!TestCase class methodsFor:'testing'!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   282
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   283
isAbstract
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   284
    "Override to true if a TestCase subclass is Abstract and should not have
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   285
     TestCase instances built from it"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   286
    
181
defd10047d9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   287
    ^ self == TestCase
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   288
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   289
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   290
rememberResult:result
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   291
    result hasPassed ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   292
        self rememberPassedTestRun
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   293
    ] ifFalse:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   294
        self rememberFailedTestRunWithResult:result
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   295
    ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   296
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   297
    "Created: / 05-08-2006 / 12:33:08 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   298
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   299
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   300
runTests
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   301
    |result|
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   302
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   303
    result := self suite run.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   304
    self rememberResult:result.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   305
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   306
    "Modified: / 05-08-2006 / 12:33:20 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   307
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   308
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   309
shouldInheritSelectors
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   310
	"I should inherit from an Abstract superclass but not from a concrete one by default, unless I have no testSelectors in which case I must be expecting to inherit them from my superclass.  If a test case with selectors wants to inherit selectors from a concrete superclass, override this to true in that subclass."
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   311
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   312
	^self superclass isAbstract
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   313
		or: [self testSelectors isEmpty]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   314
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   315
"$QA Ignore:Sends system method(superclass)$"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   316
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   317
! !
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   318
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   319
!TestCase methodsFor:'accessing'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   320
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   321
resources
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   322
	| allResources resourceQueue |
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   323
	allResources := Set new.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   324
	resourceQueue := OrderedCollection new.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   325
	resourceQueue addAll: self class resources.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   326
	[resourceQueue isEmpty] whileFalse: [
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   327
		| next |
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   328
		next := resourceQueue removeFirst.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   329
		allResources add: next.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   330
		resourceQueue addAll: next resources].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   331
	^allResources
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   332
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   333
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   334
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   335
selector
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   336
	^testSelector
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   337
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   338
! !
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   339
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   340
!TestCase methodsFor:'accessing & queries'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   341
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   342
unfinished
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   343
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   344
	"indicates an unfinished test"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   345
! !
97
1f7ff8664715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   346
1f7ff8664715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   347
!TestCase methodsFor:'assertions'!
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   348
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   349
assert: aBoolean
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   350
    "fail, if the argument is not true"
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   351
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   352
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   353
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   354
"/        aBoolean ifFalse: [self signalFailure: 'Assertion failed']
69
c5bff082e12f added #assert:message:
james
parents: 68
diff changeset
   355
c5bff082e12f added #assert:message:
james
parents: 68
diff changeset
   356
    self assert: aBoolean message:'Assertion failed'
c5bff082e12f added #assert:message:
james
parents: 68
diff changeset
   357
!
c5bff082e12f added #assert:message:
james
parents: 68
diff changeset
   358
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   359
assert:aBlock completesInSeconds:aNumber
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   360
    "fail, if aBlock does not finish its work in aNumber seconds"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   361
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   362
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   363
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   364
    |done process semaphore|
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   365
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   366
    done := false.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   367
    semaphore := Semaphore new.
174
3fff3dede568 #assert:completedInSeconds:
Stefan Vogel <sv@exept.de>
parents: 139
diff changeset
   368
    process := [
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   369
        aBlock value.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   370
        done := true.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   371
        semaphore signal
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   372
    ] fork.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   373
    semaphore waitWithTimeout: aNumber.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   374
    process terminate.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   375
    self assert: done       
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   376
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   377
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   378
     self new assert:[Delay waitForSeconds:2] completesInSeconds:1
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   379
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   380
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   381
     self new assert:[Delay waitForSeconds:1] completesInSeconds:2
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   382
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   383
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   384
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   385
assert:aBoolean description:aString 
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   386
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   387
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   388
    aBoolean ifFalse:[
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   389
        self logFailure:aString.
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   390
        self signalFailure:aString resumable:true
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   391
    ]
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   392
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   393
    "Modified: / 06-08-2006 / 22:56:27 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   394
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   395
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   396
assert:aBoolean description:aString resumable:resumableBoolean 
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   397
    <resource: #skipInDebuggersWalkBack>
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   398
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   399
    aBoolean ifFalse:[
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   400
        self logFailure:aString.
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   401
        self signalFailure:aString resumable:resumableBoolean
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   402
    ]
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   403
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   404
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   405
assert: aBoolean message:messageIfFailing
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   406
    "fail, if the argument is not true"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   407
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   408
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   409
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   410
    "check the testCase itself"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   411
    (aBoolean isBoolean) ifFalse:[ self error:'non boolean assertion' ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   412
    aBoolean ifFalse: [self signalFailure: messageIfFailing resumable:true]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   413
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   414
    "Modified: / 21-06-2000 / 10:00:05 / Sames"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   415
    "Modified: / 06-08-2006 / 22:56:21 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   416
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   417
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   418
assertFalse:aBoolean
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   419
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   420
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   421
    ^ self assert:aBoolean not
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   422
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   423
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   424
assertFalse:aBoolean named:testName
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   425
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   426
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   427
    ^ self assert:aBoolean not
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   428
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   429
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   430
assertTrue:aBoolean 
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   431
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   432
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   433
    ^ self assert:aBoolean
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   434
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   435
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   436
assertTrue:aBoolean named:testName
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   437
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   438
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   439
    ^ self assert:aBoolean
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   440
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   441
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   442
deny:aBoolean 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   443
    "fail, if the argument is not false"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   444
    
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   445
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   446
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   447
    self assert:aBoolean not
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   448
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   449
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   450
deny: aBoolean description: aString
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   451
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   452
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   453
    self assert: aBoolean not description: aString
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   454
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   455
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   456
deny: aBoolean description: aString resumable: resumableBoolean 
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   457
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   458
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   459
    self
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   460
            assert: aBoolean not
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   461
            description: aString
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   462
            resumable: resumableBoolean
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   463
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   464
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   465
should:aBlock 
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   466
    "fail, if the block does not evaluate to true"
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   467
    
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   468
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   469
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   470
    self assert:aBlock value
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   471
!
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   472
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   473
should: aBlock description: aString
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   474
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   475
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   476
    self assert: aBlock value description: aString
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   477
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   478
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   479
should:aBlock raise:anExceptionalEvent 
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   480
    "fail, if the block does not raise the given event"
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   481
    
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   482
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   483
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   484
    ^ self assert:(self executeShould:aBlock inScopeOf:anExceptionalEvent)
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   485
!
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   486
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   487
should: aBlock raise: anExceptionalEvent description: aString 
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   488
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   489
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   490
    ^self assert: (self executeShould: aBlock inScopeOf: anExceptionalEvent)
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   491
            description: aString
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   492
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   493
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   494
shouldnt:aBlock 
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   495
    "fail, if the block does evaluate to true"
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   496
    
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   497
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   498
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   499
    self deny:aBlock value
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   500
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   501
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   502
shouldnt: aBlock description: aString
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   503
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   504
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   505
    self deny: aBlock value description: aString
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   506
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   507
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   508
shouldnt:aBlock raise:anExceptionalEvent 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   509
    "fail, if the block does raise the given event"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   510
    
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   511
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   512
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   513
    ^ self 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   514
        assert:(self executeShould:aBlock inScopeOf:anExceptionalEvent) not
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   515
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   516
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   517
shouldnt: aBlock raise: anExceptionalEvent description: aString 
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   518
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   519
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   520
    ^self assert: (self executeShould: aBlock inScopeOf: anExceptionalEvent) not            description: aString
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   521
! !
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   522
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   523
!TestCase methodsFor:'dependencies'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   524
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   525
addDependentToHierachy: anObject 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   526
	"an empty method. for Composite compability with TestSuite"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   527
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   528
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   529
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   530
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   531
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   532
removeDependentFromHierachy: anObject 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   533
	"an empty method. for Composite compability with TestSuite"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   534
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   535
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   536
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   537
! !
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   538
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   539
!TestCase methodsFor:'printing'!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   540
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   541
name
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   542
        ^ self class name.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   543
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   544
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   545
printOn: aStream
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   546
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   547
"/        aStream
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   548
"/                nextPutAll: self class printString;
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   549
"/                nextPutAll: '>>#';
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   550
"/                nextPutAll: testSelector
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   551
                        
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   552
        aStream nextPutAll: self name.
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   553
        aStream nextPutAll: '>>'.
118
9464f408680f care for printing uninitialized testcases
Claus Gittinger <cg@exept.de>
parents: 103
diff changeset
   554
        testSelector printOn: aStream
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   555
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   556
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   557
testName
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   558
        ^ testSelector.
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   559
! !
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   560
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   561
!TestCase methodsFor:'private'!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   562
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   563
executeShould: aBlock inScopeOf: anExceptionalEvent 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   564
"/        ^[aBlock value.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   565
"/        false] sunitOn: anExceptionalEvent
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   566
"/                do: [:ex | ex sunitExitWith: true]
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   567
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   568
"/        [[aBlock value]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   569
"/                on: anExceptionalEvent
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   570
"/                do: [:ex | ^true]]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   571
"/                        on: TestResult exError
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   572
"/                        do: [:ex | ^false].
209
cec4475f7138 changed: #executeShould:inScopeOf:
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   573
        aBlock
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   574
                on: anExceptionalEvent
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   575
                do: [:ex | ^true].
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   576
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   577
        ^false.
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   578
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   579
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   580
performTest
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   581
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   582
        self perform: testSelector asSymbol
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   583
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   584
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   585
setTestSelector: aSymbol
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   586
	testSelector := aSymbol
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   587
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   588
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   589
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   590
signalFailure: aString
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   591
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   592
"/        TestResult failure sunitSignalWith: aString
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   593
    TestResult failure raiseErrorString:aString in:thisContext sender sender .
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   594
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   595
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   596
signalFailure:aString resumable:isResumable 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   597
    "/        TestResult failure sunitSignalWith: aString
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   598
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   599
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   600
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   601
    isResumable ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   602
        TestResult resumableFailure 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   603
            raiseRequestWith:nil
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   604
            errorString:aString
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   605
            in:thisContext sender sender
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   606
    ] ifFalse:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   607
        TestResult failure 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   608
            raiseErrorString:aString 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   609
            in:thisContext sender sender
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   610
    ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   611
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   612
    "Modified: / 06-08-2006 / 22:55:55 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   613
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   614
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   615
signalUnavailableResources
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   616
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   617
    self resources do:[:res | 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   618
        res isAvailable ifFalse:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   619
            ^ res signalInitializationError
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   620
        ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   621
    ].
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   622
! !
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   623
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   624
!TestCase methodsFor:'queries'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   625
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   626
isTestCase
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   627
    ^ true
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   628
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   629
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   630
isTestSuite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   631
    ^ false
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   632
! !
122
61e456491017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   633
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   634
!TestCase methodsFor:'running'!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   635
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   636
debug
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   637
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   638
"/        self signalUnavailableResources.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   639
"/        [(self class selector: testSelector) runCase] 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   640
"/                sunitEnsure: [self resources do: [:each | each reset]]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   641
        self debugUsing:#runCase.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   642
!
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   643
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   644
debugAsFailure
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   645
    |semaphore|
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   646
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   647
    self signalUnavailableResources.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   648
    semaphore := Semaphore new.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   649
    [
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   650
        semaphore wait.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   651
        self resources do:[:each | 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   652
            each reset
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   653
        ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   654
    ] fork.
194
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   655
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   656
    "/ used to be: 
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   657
    "/  (self class selector:testSelector) runCaseAsFailure:semaphore
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   658
    "/ which is bad for subclasses which need more arguments.
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   659
    "/ why not use:
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   660
    "/  self copy perform:aSymbol
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   661
    "/ or even
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   662
    "/  self perform:aSymbol
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   663
    "/ (self class selector:testSelector) runCaseAsFailure:semaphore.
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   664
    self runCaseAsFailure:semaphore
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   665
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   666
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   667
debugUsing:aSymbol 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   668
    self signalUnavailableResources.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   669
    [
194
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   670
        "/ used to be: 
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   671
        "/  (self class selector:testSelector) perform:aSymbol
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   672
        "/ which is bad for subclasses which need more arguments.
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   673
        "/ why not use:
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   674
        "/  self copy perform:aSymbol
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   675
        "/ or even
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   676
        "/  self perform:aSymbol
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   677
        "/ (self class selector:testSelector) perform:aSymbol
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   678
        self perform:aSymbol
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   679
    ] ensure:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   680
        self resources do:[:each | 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   681
            each reset
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   682
        ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   683
    ]
194
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   684
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   685
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   686
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   687
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   688
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   689
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   690
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   691
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   692
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   693
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   694
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   695
failureLog      
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   696
        ^SUnitNameResolver class >> #defaultLogDevice
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   697
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   698
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   699
isLogging
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   700
	"By default, we're not logging failures. If you override this in 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   701
	a subclass, make sure that you override #failureLog"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   702
	^false
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   703
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   704
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   705
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   706
logFailure: aString
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   707
	self isLogging ifTrue: [
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   708
		self failureLog 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   709
			cr; 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   710
			nextPutAll: aString; 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   711
			flush]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   712
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   713
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   714
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   715
openDebuggerOnFailingTestMethod
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   716
        "SUnit has halted one step in front of the failing test method. Step over the 'self halt' and 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   717
         send into 'self perform: testSelector' to see the failure from the beginning"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   718
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   719
        self
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   720
                "halt;"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   721
                performTest
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   722
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   723
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   724
run
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   725
	| result |
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   726
	result := TestResult new.
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   727
	self run: result.
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   728
	^result
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   729
			
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   730
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   731
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   732
run: aResult
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   733
	aResult runCase: self
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   734
			
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   735
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   736
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   737
run: aResult afterEachDo:block2
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   738
        aResult runCase: self.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   739
        block2 value:self value:aResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   740
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   741
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   742
run: aResult beforeEachDo:block1 afterEachDo:block2
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   743
        block1 value:self value:aResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   744
        aResult runCase: self.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   745
        block2 value:self value:aResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   746
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   747
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   748
run: aResult beforeEachTestCaseDo:block1 afterEachTestCaseDo:block2
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   749
        block1 value:self value:aResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   750
        aResult runCase: self.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   751
        block2 value:self value:aResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   752
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   753
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   754
runCase
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   755
    [
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   756
        self setUp.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   757
        self performTest
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   758
    ] ensure:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   759
        Error ,  AbortOperationRequest
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   760
            handle:[:ex |
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   761
                ex signal ~~ AbortOperationRequest ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   762
                    Transcript showCR:'Error during tearDown: "', ex description, '" - ignored'. 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   763
                ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   764
            ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   765
            do:[ self tearDown ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   766
    ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   767
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   768
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   769
runCaseAsFailure
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   770
        self setUp.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   771
        [[self openDebuggerOnFailingTestMethod] ensure: [self tearDown]] fork
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   772
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   773
    "Modified: / 21.6.2000 / 10:04:33 / Sames"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   774
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   775
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   776
runCaseAsFailure: aSemaphore
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   777
        [self setUp.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   778
        self openDebuggerOnFailingTestMethod] ensure: [
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   779
                self tearDown.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   780
                aSemaphore signal]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   781
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   782
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   783
setUp
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   784
			
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   785
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   786
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   787
tearDown
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   788
			
50
6db52a1a4543 updgraded to 3.0
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
   789
! !
6db52a1a4543 updgraded to 3.0
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
   790
12
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   791
!TestCase class methodsFor:'documentation'!
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   792
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   793
version
211
3a40b828ce9a comment/format in: #testSelectors
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   794
    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.55 2010-04-26 08:46:15 cg Exp $'
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   795
!
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   796
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   797
version_CVS
211
3a40b828ce9a comment/format in: #testSelectors
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   798
    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.55 2010-04-26 08:46:15 cg Exp $'
12
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   799
! !
81
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
   800
2
6f450bf08bc0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
   801
TestCase initialize!