AbstractJavaTestCase.st
author Claus Gittinger <cg@exept.de>
Thu, 24 Nov 2011 13:02:13 +0100
branchinitialV
changeset 2333 b1a55b7337c9
parent 2152 1cbdfbcc685c
permissions -rw-r--r--
checkin from stx browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     1
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     3
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     4
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     6
 Parts of the code written by Claus Gittinger are under following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     7
 license:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     8
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     9
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    10
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    12
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    13
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    14
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    15
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    16
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    17
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    18
 Permission is hereby granted, free of charge, to any person
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    19
 obtaining a copy of this software and associated documentation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    20
 files (the 'Software'), to deal in the Software without
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    21
 restriction, including without limitation the rights to use,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    22
 copy, modify, merge, publish, distribute, sublicense, and/or sell
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    23
 copies of the Software, and to permit persons to whom the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    24
 Software is furnished to do so, subject to the following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    25
 conditions:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    26
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    27
 The above copyright notice and this permission notice shall be
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    28
 included in all copies or substantial portions of the Software.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    29
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    30
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    31
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    32
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    33
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    34
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    35
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    36
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    37
 OTHER DEALINGS IN THE SOFTWARE.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    38
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    39
 [1] Code written at SWING Research Group contain a signature
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    40
     of one of the above copright owners.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    41
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    42
"{ Package: 'stx:libjava' }"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    43
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    44
TestCase subclass:#AbstractJavaTestCase
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    45
	instanceVariableNames:'exceptionThrowerBackup'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    46
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    47
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    48
	category:'Languages-Java-Tests-RuntimeConstantPool'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    49
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    50
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    51
!AbstractJavaTestCase class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    52
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    53
copyright
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    54
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    55
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    56
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    57
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    58
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    59
 Parts of the code written by Claus Gittinger are under following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    60
 license:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    61
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    62
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    63
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    64
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    65
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    66
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    67
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    68
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    69
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    70
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    71
 Permission is hereby granted, free of charge, to any person
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    72
 obtaining a copy of this software and associated documentation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    73
 files (the 'Software'), to deal in the Software without
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    74
 restriction, including without limitation the rights to use,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    75
 copy, modify, merge, publish, distribute, sublicense, and/or sell
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    76
 copies of the Software, and to permit persons to whom the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    77
 Software is furnished to do so, subject to the following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    78
 conditions:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    79
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    80
 The above copyright notice and this permission notice shall be
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    81
 included in all copies or substantial portions of the Software.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    82
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    83
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    84
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    85
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    86
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    87
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    88
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    89
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    90
 OTHER DEALINGS IN THE SOFTWARE.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    91
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    92
 [1] Code written at SWING Research Group contain a signature
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    93
     of one of the above copright owners.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    94
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    95
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    96
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    97
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    98
!AbstractJavaTestCase class methodsFor:'resources'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    99
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   100
resources
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   101
    ^ Array with: JavaInitializedResource with: JavaTestsResource.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   102
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   103
    "Created: / 26-04-2011 / 13:03:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   104
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   105
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   106
!AbstractJavaTestCase methodsFor:'cp creation helpers'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   107
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   108
getClassRefNamed: name 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   109
    "creates classRef with correctly prepared constant pool"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   110
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   111
    | cp |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   112
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   113
    cp := JavaConstantPool new:2.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   114
    cp at: 1 put: (self getClassRefIn: cp withNameAt: 2).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   115
    cp at: 2 put: name.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   116
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   117
    ^ cp at: 1.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   118
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   119
    "Created: / 23-05-2011 / 16:17:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   120
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   121
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   122
getFieldRefNamed: name typed: type inClass: classString
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   123
    "creates fieldRef with correctly prepared constant pool"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   124
    | cp |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   125
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   126
    cp := JavaConstantPool new: 6.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   127
    cp at: 1 put: (self getClassRefIn: cp withNameAt: 2).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   128
    cp at: 2 put: classString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   129
    cp at: 3 put: name.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   130
    cp at: 4 put: type.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   131
    cp at: 5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   132
        put: (self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   133
                getFieldRefIn: cp
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   134
                withNameAndTypeAt: 6 andClassAt: 1).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   135
    cp at: 6 put: (self getNameAndTypeIn: cp withNameAt: 3 andTypeAt: 4).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   136
    ^ cp at: 5.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   137
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   138
    "Created: / 23-05-2011 / 15:56:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   139
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   140
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   141
getInterfaceMethodRefNamed: name typed: type inClass: classString 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   142
   "creates interfaceMethodRef with correctly prepared constant pool"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   143
    | cp |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   144
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   145
    cp := JavaConstantPool new: 6.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   146
    cp at: 1 put: (self getClassRefIn: cp withNameAt: 2).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   147
    cp at: 2 put: classString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   148
    cp at: 3 put: name.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   149
    cp at: 4 put: type.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   150
    cp at: 5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   151
        put: (self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   152
                getInterfaceMethodRefIn: cp
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   153
                withNameAndTypeAt: 6
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   154
                andClassAt: 1).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   155
    cp at: 6
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   156
        put: (self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   157
                getNameAndTypeIn: cp
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   158
                withNameAt: 3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   159
                andTypeAt: 4).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   160
    ^ cp at: 5.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   161
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   162
    "Created: / 23-05-2011 / 16:15:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   163
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   164
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   165
getMethodRefNamed: name typed: type inClass: classString 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   166
   "creates methodRef with correctly prepared constant pool"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   167
    | cp |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   168
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   169
    cp := JavaConstantPool new: 6.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   170
    cp at: 1 put: (self getClassRefIn: cp withNameAt: 2).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   171
    cp at: 2 put: classString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   172
    cp at: 3 put: name.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   173
    cp at: 4 put: type.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   174
    cp at: 5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   175
        put: (self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   176
                getMethodRefIn: cp
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   177
                withNameAndTypeAt: 6
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   178
                andClassAt: 1).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   179
    cp at: 6
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   180
        put: (self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   181
                getNameAndTypeIn: cp
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   182
                withNameAt: 3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   183
                andTypeAt: 4).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   184
    ^ cp at: 5.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   185
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   186
    "Created: / 23-05-2011 / 16:00:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   187
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   188
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   189
!AbstractJavaTestCase methodsFor:'helpers'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   190
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   191
disableMockedExceptionThrowing
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   192
    JavaResolver uniqueInstance exceptionThrower: exceptionThrowerBackup.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   193
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   194
    "Created: / 13-04-2011 / 14:11:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   195
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   196
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   197
enableMockedExceptionThrowing
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   198
    exceptionThrowerBackup := JavaResolver uniqueInstance exceptionThrower.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   199
    JavaResolver uniqueInstance exceptionThrower: JavaExceptionThrowerMock new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   200
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   201
    "Created: / 13-04-2011 / 14:11:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   202
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   203
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   204
getCrateClassReadStream
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   205
    ^ ((Filename named: UserPreferences current javaTestsDirectory) 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   206
        / 'libjava' / 'bin' 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   207
        / 'stx' / 'libjava' 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   208
        / 'tests' / 'mocks' 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   209
        / 'Crate.class') readStream.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   210
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   211
    "Created: / 10-05-2011 / 12:13:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   212
    "Modified: / 12-05-2011 / 16:26:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   213
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   214
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   215
getPrettyBigConstantPool
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   216
    | cp |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   217
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   218
    cp := JavaConstantPool new: 20.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   219
    cp at: 1 put: 6.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   220
    cp at: 2 put: 'Ljava/lang/Object;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   221
    cp at: 3 putClassRefWithNameAt: 2.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   222
    cp 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   223
        at: 4
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   224
        putMethodRefWithClassAt: 3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   225
        andNameAndTypeAt: 5.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   226
    cp 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   227
        at: 5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   228
        putNameAndTypeWithNameAt: 6
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   229
        andDescriptorAt: 7.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   230
    cp at: 6 put: '<init>'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   231
    cp at: 7 put: '()V'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   232
    cp at: 8 put: 'Ljava/lang/String;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   233
    cp at: 9 putClassRefWithNameAt: 8.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   234
    cp 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   235
        at: 10
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   236
        putMethodRefWithClassAt: 9
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   237
        andNameAndTypeAt: 13.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   238
    cp at: 11 put: 'length'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   239
    cp at: 12 put: '()I'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   240
    cp 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   241
        at: 13
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   242
        putNameAndTypeWithNameAt: 11
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   243
        andDescriptorAt: 12.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   244
    cp at: 14 putClassRefWithNameAt: 15.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   245
    cp at: 15 put: 'Ljava/lang/Runnable;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   246
    cp at: 16 put: 'run'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   247
    cp at: 17 put: '()V'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   248
    cp 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   249
        at: 18
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   250
        putNameAndTypeWithNameAt: 16
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   251
        andDescriptorAt: 17.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   252
    cp at: 19 putClassRefWithNameAt: 15.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   253
    cp 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   254
        at: 20
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   255
        putInterfaceMethodRefWithClassAt: 19
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   256
        andNameAndTypeAt: 18.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   257
    ^ cp
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   258
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   259
    "Modified: / 23-05-2011 / 15:16:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   260
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   261
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   262
javaLangObject
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   263
^Java classForName:'java.lang.Object'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   264
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   265
    "Created: / 12-05-2011 / 19:09:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   266
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   267
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   268
!AbstractJavaTestCase methodsFor:'refs creation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   269
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   270
getClassRefIn: aJavaConstantPool withNameAt: nameCPIndex 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   271
    | result |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   272
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   273
    result := JavaClassRef2 in: aJavaConstantPool withNameAt: nameCPIndex.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   274
    result owner: self javaLangObject.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   275
    ^ result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   276
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   277
    "Created: / 12-05-2011 / 19:14:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   278
    "Modified: / 23-05-2011 / 16:24:32 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   279
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   280
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   281
getFieldRefIn: cp withNameAndTypeAt: nmIndex andClassAt: classIndex 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   282
    |result|
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   283
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   284
    result := JavaFieldRef2 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   285
        in: cp
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   286
        withNameAndTypeAt: nmIndex
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   287
        andClassAt: classIndex.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   288
result owner: self javaLangObject.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   289
    ^ result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   290
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   291
    "Created: / 23-05-2011 / 16:01:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   292
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   293
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   294
getInterfaceMethodRefIn: cp withNameAndTypeAt: nmIndex andClassAt: classIndex 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   295
    |result|
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   296
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   297
    result:= JavaInterfaceMethodRef2 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   298
        in: cp
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   299
        withNameAndTypeAt: nmIndex
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   300
        andClassAt: classIndex.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   301
 result owner: self javaLangObject.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   302
    ^ result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   303
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   304
    "Created: / 23-05-2011 / 15:58:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   305
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   306
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   307
getMethodRefIn: cp withNameAndTypeAt: nmIndex andClassAt: classIndex 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   308
    |result|
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   309
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   310
    result := JavaMethodRef2 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   311
        in: cp
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   312
        withNameAndTypeAt: nmIndex
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   313
        andClassAt: classIndex.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   314
 result owner: self javaLangObject.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   315
    ^ result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   316
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   317
    "Created: / 23-05-2011 / 15:58:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   318
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   319
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   320
getNameAndTypeIn: cp withNameAt: nameIndex andTypeAt: typeIndex 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   321
    |result|
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   322
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   323
    result := JavaNameAndType2 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   324
        in: cp
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   325
        withNameAt: nameIndex
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   326
        andDescriptorAt: typeIndex.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   327
 result owner: self javaLangObject.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   328
    ^ result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   329
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   330
    "Created: / 23-05-2011 / 16:00:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   331
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   332
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   333
!AbstractJavaTestCase methodsFor:'running'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   334
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   335
setUp
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   336
    self enableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   337
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   338
    "Created: / 12-05-2011 / 17:30:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   339
    "Modified: / 23-05-2011 / 18:02:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   340
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   341
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   342
tearDown
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   343
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   344
    self disableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   345
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   346
    "Created: / 12-05-2011 / 17:30:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   347
    "Modified: / 08-08-2011 / 17:24:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   348
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   349
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   350
!AbstractJavaTestCase class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   351
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   352
version_SVN
2152
1cbdfbcc685c Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 749
diff changeset
   353
    ^ '$Id: AbstractJavaTestCase.st,v 1.1 2011-08-18 19:06:53 vrany Exp $'
1cbdfbcc685c Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 749
diff changeset
   354
! !