author | Jan Vrany <jan.vrany@labware.com> |
Fri, 07 Oct 2022 12:27:15 +0100 | |
branch | jv |
changeset 773 | 5e936bce7857 |
parent 724 | 4dae63fce9f9 |
permissions | -rw-r--r-- |
724
4dae63fce9f9
vIssue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
664
diff
changeset
|
1 |
"{ Encoding: utf8 }" |
4dae63fce9f9
vIssue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
664
diff
changeset
|
2 |
|
222 | 3 |
"{ Package: 'stx:goodies/sunit' }" |
4 |
||
664
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
5 |
"{ NameSpace: Smalltalk }" |
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
6 |
|
222 | 7 |
SimpleTestResourceTestCase subclass:#ManyTestResourceTestCase |
8 |
instanceVariableNames:'' |
|
9 |
classVariableNames:'' |
|
10 |
poolDictionaries:'' |
|
11 |
category:'SUnit-Tests' |
|
12 |
! |
|
13 |
||
14 |
||
15 |
!ManyTestResourceTestCase class methodsFor:'accessing'! |
|
16 |
||
17 |
resources |
|
18 |
^super resources, (Array with: SimpleTestResourceA with: SimpleTestResourceB) |
|
19 |
! ! |
|
20 |
||
21 |
!ManyTestResourceTestCase class methodsFor:'testing'! |
|
22 |
||
23 |
shouldInheritSelectors |
|
24 |
^true |
|
25 |
! ! |
|
26 |
||
27 |
!ManyTestResourceTestCase methodsFor:'running'! |
|
28 |
||
29 |
testTearDownOrder |
|
30 |
| myResourceSetUpOrder myResourceReverseTearDownOrder | |
|
31 |
myResourceReverseTearDownOrder := OrderedCollection new: 7. |
|
32 |
myResourceSetUpOrder := (OrderedCollection new: 7) |
|
33 |
add: SimpleTestResource; |
|
34 |
add: SimpleTestResourceA1; |
|
35 |
add: SimpleTestResourceA2; |
|
36 |
add: SimpleTestResourceA; |
|
37 |
add: SimpleTestResourceB1; |
|
38 |
add: SimpleTestResourceB; |
|
39 |
yourself. |
|
40 |
self assert: (myResourceSetUpOrder allSatisfy: [:each | each isAvailable]) |
|
41 |
description: 'At test start, not all my resources were set up'. |
|
42 |
self class resources do: |
|
43 |
[:each | each resetOrAddResourcesTo: myResourceReverseTearDownOrder]. |
|
44 |
self assert: myResourceReverseTearDownOrder = myResourceSetUpOrder |
|
45 |
description: 'Wrong order for tearDown'. |
|
46 |
self assert: (myResourceSetUpOrder allSatisfy: [:each | each isAvailable]) |
|
47 |
description: 'At test start, not all my resources were set up'. |
|
48 |
! ! |
|
49 |
||
50 |
!ManyTestResourceTestCase methodsFor:'utility'! |
|
51 |
||
52 |
clearOuterResourceStateDuring: aBlock |
|
53 |
"This self-testing test must clear the outer state of its resources before starting and after finishing, so that it can construct test cases and suites of itself and test them." |
|
54 |
||
55 |
self assert: SimpleTestResourceA1 isAlreadyAvailable |
|
56 |
description: 'The resource was not set up for the test'. |
|
57 |
SimpleTestResourceA reset. |
|
58 |
SimpleTestResourceB reset. |
|
59 |
SimpleTestResourceA1 reset. |
|
60 |
self deny: SimpleTestResourceA1 isAlreadyAvailable |
|
61 |
description: 'The resource was still set up before we began the run'. |
|
62 |
^[super clearOuterResourceStateDuring: aBlock] sunitEnsure: |
|
63 |
[self deny: SimpleTestResourceA1 isAlreadyAvailable |
|
64 |
description: 'The resource was still set up after we finished the run'. |
|
65 |
self deny: SimpleTestResourceB1 isAlreadyAvailable |
|
66 |
description: 'The resource was still set up after we finished the run'. |
|
67 |
SimpleTestResourceA isAvailable. |
|
68 |
self assert: SimpleTestResourceA1 isAlreadyAvailable |
|
69 |
description: 'The resource was not set up again after the test'. |
|
70 |
SimpleTestResourceB isAvailable. |
|
71 |
self assert: SimpleTestResourceB1 isAlreadyAvailable |
|
72 |
description: 'The resource was not set up again after the test'.]. |
|
73 |
||
74 |
"Modified: / 11-09-2010 / 16:44:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
75 |
! ! |
|
76 |
||
77 |
!ManyTestResourceTestCase class methodsFor:'documentation'! |
|
78 |
||
79 |
version_SVN |
|
724
4dae63fce9f9
vIssue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
664
diff
changeset
|
80 |
^ '§Id: ManyTestResourceTestCase.st 214 2011-03-14 12:22:21Z vranyj1 §' |
222 | 81 |
! ! |
664
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
82 |