877
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
1152
|
3 |
|
|
4 |
New code and modification done at SWING Research Group [1]:
|
|
5 |
|
877
|
6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
7 |
SWING Research Group, Czech Technical University in Prague
|
|
8 |
|
|
9 |
Parts of the code written by Claus Gittinger are under following
|
|
10 |
license:
|
|
11 |
|
|
12 |
This software is furnished under a license and may be used
|
|
13 |
only in accordance with the terms of that license and with the
|
|
14 |
inclusion of the above copyright notice. This software may not
|
|
15 |
be provided or otherwise made available to, or used by, any
|
|
16 |
other person. No title to or ownership of the software is
|
|
17 |
hereby transferred.
|
|
18 |
|
|
19 |
[1] Code written at SWING Research Group contain a signature
|
1152
|
20 |
of one of the above copright owners. For exact set of such code
|
|
21 |
see the differences between this version and version stx:lib
|
|
22 |
as of 1.9.2010
|
877
|
23 |
"
|
752
|
24 |
"{ Package: 'stx:libjava' }"
|
|
25 |
|
|
26 |
TestCase subclass:#JavaJUnitTests
|
|
27 |
instanceVariableNames:''
|
|
28 |
classVariableNames:''
|
|
29 |
poolDictionaries:''
|
|
30 |
category:'Languages-Java-Tests'
|
|
31 |
!
|
|
32 |
|
|
33 |
!JavaJUnitTests class methodsFor:'documentation'!
|
|
34 |
|
877
|
35 |
copyright
|
|
36 |
"
|
|
37 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
1152
|
38 |
|
|
39 |
New code and modification done at SWING Research Group [1]:
|
|
40 |
|
877
|
41 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
42 |
SWING Research Group, Czech Technical University in Prague
|
|
43 |
|
|
44 |
Parts of the code written by Claus Gittinger are under following
|
|
45 |
license:
|
|
46 |
|
|
47 |
This software is furnished under a license and may be used
|
|
48 |
only in accordance with the terms of that license and with the
|
|
49 |
inclusion of the above copyright notice. This software may not
|
|
50 |
be provided or otherwise made available to, or used by, any
|
|
51 |
other person. No title to or ownership of the software is
|
|
52 |
hereby transferred.
|
|
53 |
|
|
54 |
[1] Code written at SWING Research Group contain a signature
|
1152
|
55 |
of one of the above copright owners. For exact set of such code
|
|
56 |
see the differences between this version and version stx:lib
|
|
57 |
as of 1.9.2010
|
877
|
58 |
|
|
59 |
"
|
|
60 |
!
|
|
61 |
|
752
|
62 |
documentation
|
|
63 |
"
|
|
64 |
A test case that tests whether JUnit 3.x works under
|
|
65 |
stx:libjava.
|
|
66 |
|
|
67 |
[author:]
|
|
68 |
Jan Vrany <jan.vrany@fit.cvut.cz>
|
|
69 |
|
|
70 |
[instance variables:]
|
|
71 |
|
|
72 |
[class variables:]
|
|
73 |
|
|
74 |
[see also:]
|
|
75 |
|
|
76 |
"
|
|
77 |
! !
|
|
78 |
|
|
79 |
!JavaJUnitTests class methodsFor:'resource'!
|
|
80 |
|
|
81 |
resources
|
|
82 |
|
756
|
83 |
^ Array
|
|
84 |
with: JavaInitializedResource
|
|
85 |
with: JavaLibrariesResource
|
|
86 |
with: JavaTestsResource
|
752
|
87 |
|
|
88 |
"Created: / 28-02-2011 / 15:28:52 / Marcel Hlopko <hlopik@gmail.com>"
|
756
|
89 |
"Modified: / 08-04-2011 / 17:03:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
752
|
90 |
! !
|
|
91 |
|
|
92 |
!JavaJUnitTests methodsFor:'running'!
|
|
93 |
|
|
94 |
setUp
|
|
95 |
|
|
96 |
super setUp.
|
|
97 |
Java addToClassPath: '/usr/share/java/junit4.jar'.
|
|
98 |
|
|
99 |
"Created: / 16-03-2011 / 15:28:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
100 |
! !
|
|
101 |
|
|
102 |
!JavaJUnitTests methodsFor:'tests - jUnit 3.x'!
|
|
103 |
|
|
104 |
test_junit3x_01
|
1015
|
105 |
| runner junit3testcase result |
|
752
|
106 |
|
|
107 |
"/ Java effectiveClassPath
|
|
108 |
runner := Java classForName: 'org.junit.runner.JUnitCore'.
|
|
109 |
self assert: runner notNil.
|
|
110 |
junit3testcase := Java classForName: 'stx.libjava.tests.JUnit3Tests'.
|
|
111 |
self assert: junit3testcase notNil.
|
1015
|
112 |
"signature: Result runClass(java.lang.Class[] classes)"
|
752
|
113 |
result := runner
|
1015
|
114 |
perform: #'runClasses([Ljava/lang/Class;)Lorg/junit/runner/Result;'
|
752
|
115 |
with: (Array with: (JavaVM javaClassObjectForClass: junit3testcase)).
|
1015
|
116 |
"
|
|
117 |
result getFailures
|
752
|
118 |
"
|
|
119 |
self assert: result getRunCount = 4.
|
|
120 |
self assert: result getFailureCount = 2.
|
1015
|
121 |
self assert: result wasSuccessful not.
|
752
|
122 |
|
|
123 |
"Created: / 06-02-2011 / 12:14:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
124 |
"Modified: / 07-04-2011 / 23:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
1015
|
125 |
"Modified: / 09-10-2011 / 16:56:54 / m"
|
752
|
126 |
! !
|
|
127 |
|
|
128 |
!JavaJUnitTests methodsFor:'tests - jUnit 4.x'!
|
|
129 |
|
|
130 |
test_junit4x_01
|
|
131 |
| runner junit4testcase result |
|
|
132 |
|
|
133 |
"/ Java effectiveClassPath
|
1015
|
134 |
runner := Java classForName: 'org.junit.runner.JUnitCore'.
|
|
135 |
self assert: runner notNil.
|
|
136 |
junit4testcase := Java classForName: 'stx.libjava.tests.JUnit4Tests'.
|
|
137 |
self assert: junit4testcase notNil.
|
752
|
138 |
"signature: Result runClass(java.lang.Class[] classes)"
|
|
139 |
result := runner
|
1015
|
140 |
perform: #'runClasses([Ljava/lang/Class;)Lorg/junit/runner/Result;'
|
|
141 |
with: (Array with: (JavaVM javaClassObjectForClass: junit4testcase)).
|
752
|
142 |
"
|
|
143 |
result getFailures
|
|
144 |
"
|
1015
|
145 |
self assert: result getRunCount = 3.
|
|
146 |
self assert: result getFailureCount = 1.
|
|
147 |
self assert: result wasSuccessful not.
|
752
|
148 |
|
|
149 |
"Created: / 06-02-2011 / 12:14:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
150 |
"Modified: / 28-02-2011 / 17:27:16 / Marcel Hlopko <hlopik@gmail.com>"
|
|
151 |
"Modified: / 07-04-2011 / 23:02:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
1015
|
152 |
"Modified: / 09-10-2011 / 16:57:01 / m"
|
752
|
153 |
! !
|
|
154 |
|
|
155 |
!JavaJUnitTests class methodsFor:'documentation'!
|
|
156 |
|
|
157 |
version_SVN
|
|
158 |
^ '$Id$'
|
|
159 |
! !
|