334
|
1 |
"{ Package: 'stx:goodies/sunit' }"
|
|
2 |
|
346
|
3 |
Object subclass:#TestCaseOutcome
|
|
4 |
instanceVariableNames:'testCase result properties'
|
334
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'SUnit-Base'
|
|
8 |
!
|
|
9 |
|
346
|
10 |
!TestCaseOutcome class methodsFor:'documentation'!
|
335
|
11 |
|
|
12 |
documentation
|
|
13 |
"
|
|
14 |
will keep additional info for a testCase run:
|
|
15 |
startTime, endTime,
|
|
16 |
backtrace (if fail or error)
|
|
17 |
and collectedStdout
|
|
18 |
"
|
|
19 |
! !
|
334
|
20 |
|
346
|
21 |
!TestCaseOutcome class methodsFor:'instance creation'!
|
|
22 |
|
|
23 |
forCase: aTestCase
|
|
24 |
|
|
25 |
^self new testCase: aTestCase; yourself
|
|
26 |
|
|
27 |
"Created: / 16-08-2011 / 15:24:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
28 |
! !
|
334
|
29 |
|
346
|
30 |
!TestCaseOutcome methodsFor:'accessing'!
|
|
31 |
|
|
32 |
collectedOutput
|
|
33 |
|
|
34 |
^self propertyAt: #collectedOutput
|
|
35 |
|
|
36 |
"Modified: / 16-08-2011 / 15:27:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
37 |
"Created: / 16-08-2011 / 18:19:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
334
|
38 |
!
|
|
39 |
|
346
|
40 |
collectedOutput: aString
|
|
41 |
|
|
42 |
^self propertyAt: #collectedOutput put: aString
|
|
43 |
|
|
44 |
"Modified: / 16-08-2011 / 15:28:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
45 |
"Created: / 16-08-2011 / 18:19:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
334
|
46 |
!
|
|
47 |
|
|
48 |
endTime
|
346
|
49 |
|
|
50 |
^self propertyAt: #endTime
|
|
51 |
|
|
52 |
"Modified: / 16-08-2011 / 15:28:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
334
|
53 |
!
|
|
54 |
|
346
|
55 |
endTime: anObject
|
|
56 |
|
|
57 |
^self propertyAt: #endTime put: anObject
|
|
58 |
|
|
59 |
"Modified: / 16-08-2011 / 15:28:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
334
|
60 |
!
|
|
61 |
|
|
62 |
exceptionDetail
|
346
|
63 |
|
|
64 |
^self propertyAt: #exceptionDetail
|
|
65 |
|
|
66 |
"Modified: / 16-08-2011 / 15:29:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
67 |
!
|
|
68 |
|
|
69 |
exceptionDetail: anObject
|
|
70 |
|
|
71 |
^self propertyAt: #exceptionDetail put: anObject
|
|
72 |
|
|
73 |
"Modified: / 16-08-2011 / 15:29:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
74 |
!
|
|
75 |
|
|
76 |
propertyAt: aSymbol
|
|
77 |
|
|
78 |
self propertyAt: aSymbol ifAbsent: [nil]
|
|
79 |
|
|
80 |
"Created: / 16-08-2011 / 15:26:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
334
|
81 |
!
|
|
82 |
|
346
|
83 |
propertyAt: aSymbol ifAbsent: aBlock
|
|
84 |
|
|
85 |
properties isNil ifTrue: [^aBlock value].
|
|
86 |
^properties at: aSymbol ifAbsent:aBlock.
|
|
87 |
|
|
88 |
"Created: / 16-08-2011 / 15:27:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
89 |
!
|
|
90 |
|
|
91 |
propertyAt: aSymbol put: anObject
|
|
92 |
|
|
93 |
properties isNil ifTrue: [properties := Dictionary new].
|
|
94 |
properties at: aSymbol put: anObject.
|
|
95 |
|
|
96 |
"Created: / 16-08-2011 / 15:28:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
97 |
!
|
|
98 |
|
|
99 |
result
|
|
100 |
^ result
|
|
101 |
!
|
|
102 |
|
|
103 |
result:something
|
|
104 |
result := something.
|
|
105 |
!
|
|
106 |
|
|
107 |
selector
|
|
108 |
|
|
109 |
^testCase selector
|
|
110 |
|
|
111 |
"Created: / 16-08-2011 / 15:38:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
334
|
112 |
!
|
|
113 |
|
|
114 |
startTime
|
346
|
115 |
|
|
116 |
^self propertyAt: #startTime
|
|
117 |
|
|
118 |
"Modified: / 16-08-2011 / 15:29:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
119 |
!
|
|
120 |
|
|
121 |
startTime: anObject
|
|
122 |
|
|
123 |
^self propertyAt: #startTime put: anObject
|
|
124 |
|
|
125 |
"Modified: / 16-08-2011 / 15:29:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
334
|
126 |
!
|
|
127 |
|
346
|
128 |
testCase
|
|
129 |
^ testCase
|
|
130 |
!
|
|
131 |
|
|
132 |
testCase:something
|
|
133 |
testCase := something.
|
334
|
134 |
! !
|
|
135 |
|
346
|
136 |
!TestCaseOutcome class methodsFor:'documentation'!
|
334
|
137 |
|
|
138 |
version_CVS
|
359
|
139 |
^ '$Header: /cvs/stx/stx/goodies/sunit/TestRunInfo.st,v 1.5 2011-08-16 18:17:40 vrany Exp $'
|
334
|
140 |
! !
|