ExampleTestResource.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sun, 26 Nov 2017 20:40:34 +0000
branchjv
changeset 696 268bf2c60556
parent 664 e31b2e7b658d
child 724 4dae63fce9f9
permissions -rw-r--r--
UI testing: wait until event queue empties ...when `#do:`ing an user action. This is necessary for widget/tools that pushes more work back onto an even queue (in order to make the system more responsive).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"{ Package: 'stx:goodies/sunit' }"
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
664
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 222
diff changeset
     3
"{ NameSpace: Smalltalk }"
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 222
diff changeset
     4
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
TestResource subclass:#ExampleTestResource
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
	instanceVariableNames:'runningState'
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
	classVariableNames:''
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	poolDictionaries:''
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
	category:'SUnit-Tests'
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
!
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
    13
!ExampleTestResource class methodsFor:'testing'!
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
isAvailable
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	^super isAvailable and: [self current isStarted]
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
! !
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
    20
!ExampleTestResource methodsFor:'accessing'!
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
runningState
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
	^runningState
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
!
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
runningState: aSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
	runningState := aSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
! !
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
    32
!ExampleTestResource methodsFor:'constants'!
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
startedStateSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
	^#started
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
stoppedStateSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
	^#stopped
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
! !
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
    44
!ExampleTestResource methodsFor:'running'!
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
setUp
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    47
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
	self runningState: self startedStateSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
!
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
tearDown
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
	self runningState: self stoppedStateSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
! !
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
    56
!ExampleTestResource methodsFor:'testing'!
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
isAvailable
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    59
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
	^self runningState == self startedStateSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
!
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
isStarted
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    64
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
	^self runningState == self startedStateSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
!
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
isStopped
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    69
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
	^self runningState == self stoppedStateSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
! !
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
!ExampleTestResource class methodsFor:'documentation'!
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
version
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    76
    ^ '$Header: /cvs/stx/stx/goodies/sunit/ExampleTestResource.st,v 1.3 2011-06-29 19:15:49 cg Exp $'
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    77
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    78
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    79
version_SVN
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    80
    ^ '§Id: ExampleTestResource.st 182 2009-12-05 18:12:17Z vranyj1 §'
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
! !
664
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 222
diff changeset
    82