877
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
3 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
4 |
SWING Research Group, Czech Technical University in Prague
|
|
5 |
|
|
6 |
Parts of the code written by Claus Gittinger are under following
|
|
7 |
license:
|
|
8 |
|
|
9 |
This software is furnished under a license and may be used
|
|
10 |
only in accordance with the terms of that license and with the
|
|
11 |
inclusion of the above copyright notice. This software may not
|
|
12 |
be provided or otherwise made available to, or used by, any
|
|
13 |
other person. No title to or ownership of the software is
|
|
14 |
hereby transferred.
|
|
15 |
|
|
16 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
|
|
17 |
|
|
18 |
Permission is hereby granted, free of charge, to any person
|
|
19 |
obtaining a copy of this software and associated documentation
|
|
20 |
files (the 'Software'), to deal in the Software without
|
|
21 |
restriction, including without limitation the rights to use,
|
|
22 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
23 |
copies of the Software, and to permit persons to whom the
|
|
24 |
Software is furnished to do so, subject to the following
|
|
25 |
conditions:
|
|
26 |
|
|
27 |
The above copyright notice and this permission notice shall be
|
|
28 |
included in all copies or substantial portions of the Software.
|
|
29 |
|
|
30 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
31 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
32 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
33 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
34 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
35 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
36 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
37 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
38 |
|
|
39 |
[1] Code written at SWING Research Group contain a signature
|
|
40 |
of one of the above copright owners.
|
|
41 |
"
|
752
|
42 |
"{ Package: 'stx:libjava' }"
|
|
43 |
|
|
44 |
TestCase subclass:#JavaJUnitTests
|
|
45 |
instanceVariableNames:''
|
|
46 |
classVariableNames:''
|
|
47 |
poolDictionaries:''
|
|
48 |
category:'Languages-Java-Tests'
|
|
49 |
!
|
|
50 |
|
|
51 |
!JavaJUnitTests class methodsFor:'documentation'!
|
|
52 |
|
877
|
53 |
copyright
|
|
54 |
"
|
|
55 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
56 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
57 |
SWING Research Group, Czech Technical University in Prague
|
|
58 |
|
|
59 |
Parts of the code written by Claus Gittinger are under following
|
|
60 |
license:
|
|
61 |
|
|
62 |
This software is furnished under a license and may be used
|
|
63 |
only in accordance with the terms of that license and with the
|
|
64 |
inclusion of the above copyright notice. This software may not
|
|
65 |
be provided or otherwise made available to, or used by, any
|
|
66 |
other person. No title to or ownership of the software is
|
|
67 |
hereby transferred.
|
|
68 |
|
|
69 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
|
|
70 |
|
|
71 |
Permission is hereby granted, free of charge, to any person
|
|
72 |
obtaining a copy of this software and associated documentation
|
|
73 |
files (the 'Software'), to deal in the Software without
|
|
74 |
restriction, including without limitation the rights to use,
|
|
75 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
76 |
copies of the Software, and to permit persons to whom the
|
|
77 |
Software is furnished to do so, subject to the following
|
|
78 |
conditions:
|
|
79 |
|
|
80 |
The above copyright notice and this permission notice shall be
|
|
81 |
included in all copies or substantial portions of the Software.
|
|
82 |
|
|
83 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
84 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
85 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
86 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
87 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
88 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
89 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
90 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
91 |
|
|
92 |
[1] Code written at SWING Research Group contain a signature
|
|
93 |
of one of the above copright owners.
|
|
94 |
|
|
95 |
"
|
|
96 |
!
|
|
97 |
|
752
|
98 |
documentation
|
|
99 |
"
|
|
100 |
A test case that tests whether JUnit 3.x works under
|
|
101 |
stx:libjava.
|
|
102 |
|
|
103 |
[author:]
|
|
104 |
Jan Vrany <jan.vrany@fit.cvut.cz>
|
|
105 |
|
|
106 |
[instance variables:]
|
|
107 |
|
|
108 |
[class variables:]
|
|
109 |
|
|
110 |
[see also:]
|
|
111 |
|
|
112 |
"
|
|
113 |
! !
|
|
114 |
|
|
115 |
!JavaJUnitTests class methodsFor:'resource'!
|
|
116 |
|
|
117 |
resources
|
|
118 |
|
756
|
119 |
^ Array
|
|
120 |
with: JavaInitializedResource
|
|
121 |
with: JavaLibrariesResource
|
|
122 |
with: JavaTestsResource
|
752
|
123 |
|
|
124 |
"Created: / 28-02-2011 / 15:28:52 / Marcel Hlopko <hlopik@gmail.com>"
|
756
|
125 |
"Modified: / 08-04-2011 / 17:03:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
752
|
126 |
! !
|
|
127 |
|
|
128 |
!JavaJUnitTests methodsFor:'running'!
|
|
129 |
|
|
130 |
setUp
|
|
131 |
|
|
132 |
super setUp.
|
|
133 |
Java addToClassPath: '/usr/share/java/junit4.jar'.
|
|
134 |
|
|
135 |
"Created: / 16-03-2011 / 15:28:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
136 |
! !
|
|
137 |
|
|
138 |
!JavaJUnitTests methodsFor:'tests - jUnit 3.x'!
|
|
139 |
|
|
140 |
test_junit3x_01
|
1015
|
141 |
| runner junit3testcase result |
|
752
|
142 |
|
|
143 |
"/ Java effectiveClassPath
|
|
144 |
runner := Java classForName: 'org.junit.runner.JUnitCore'.
|
|
145 |
self assert: runner notNil.
|
|
146 |
junit3testcase := Java classForName: 'stx.libjava.tests.JUnit3Tests'.
|
|
147 |
self assert: junit3testcase notNil.
|
1015
|
148 |
"signature: Result runClass(java.lang.Class[] classes)"
|
752
|
149 |
result := runner
|
1015
|
150 |
perform: #'runClasses([Ljava/lang/Class;)Lorg/junit/runner/Result;'
|
752
|
151 |
with: (Array with: (JavaVM javaClassObjectForClass: junit3testcase)).
|
1015
|
152 |
"
|
|
153 |
result getFailures
|
752
|
154 |
"
|
|
155 |
self assert: result getRunCount = 4.
|
|
156 |
self assert: result getFailureCount = 2.
|
1015
|
157 |
self assert: result wasSuccessful not.
|
752
|
158 |
|
|
159 |
"Created: / 06-02-2011 / 12:14:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
160 |
"Modified: / 07-04-2011 / 23:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
1015
|
161 |
"Modified: / 09-10-2011 / 16:56:54 / m"
|
752
|
162 |
! !
|
|
163 |
|
|
164 |
!JavaJUnitTests methodsFor:'tests - jUnit 4.x'!
|
|
165 |
|
|
166 |
test_junit4x_01
|
|
167 |
| runner junit4testcase result |
|
|
168 |
|
|
169 |
"/ Java effectiveClassPath
|
1015
|
170 |
runner := Java classForName: 'org.junit.runner.JUnitCore'.
|
|
171 |
self assert: runner notNil.
|
|
172 |
junit4testcase := Java classForName: 'stx.libjava.tests.JUnit4Tests'.
|
|
173 |
self assert: junit4testcase notNil.
|
752
|
174 |
"signature: Result runClass(java.lang.Class[] classes)"
|
|
175 |
result := runner
|
1015
|
176 |
perform: #'runClasses([Ljava/lang/Class;)Lorg/junit/runner/Result;'
|
|
177 |
with: (Array with: (JavaVM javaClassObjectForClass: junit4testcase)).
|
752
|
178 |
"
|
|
179 |
result getFailures
|
|
180 |
"
|
1015
|
181 |
self assert: result getRunCount = 3.
|
|
182 |
self assert: result getFailureCount = 1.
|
|
183 |
self assert: result wasSuccessful not.
|
752
|
184 |
|
|
185 |
"Created: / 06-02-2011 / 12:14:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
186 |
"Modified: / 28-02-2011 / 17:27:16 / Marcel Hlopko <hlopik@gmail.com>"
|
|
187 |
"Modified: / 07-04-2011 / 23:02:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
1015
|
188 |
"Modified: / 09-10-2011 / 16:57:01 / m"
|
752
|
189 |
! !
|
|
190 |
|
|
191 |
!JavaJUnitTests class methodsFor:'documentation'!
|
|
192 |
|
|
193 |
version_SVN
|
|
194 |
^ '$Id$'
|
|
195 |
! !
|