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