JavaRefsAndConstantPoolTestCase.st
author vranyj1
Mon, 03 Dec 2012 22:09:19 +0000
branchdevelopment
changeset 1859 4d42d0099c74
parent 1818 2e5ed72e7dfd
child 1864 60a8dc26c8c6
permissions -rw-r--r--
Ignore tests in MemberVisibilityTests (package-private methods not yet supported)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
     1
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 891
diff changeset
     3
1155
vranyj1
parents: 1152
diff changeset
     4
 New code and modifications done at SWING Research Group [1]:
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 891
diff changeset
     5
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
     6
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
     7
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
     8
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
     9
 This software is furnished under a license and may be used
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    10
 only in accordance with the terms of that license and with the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    12
 be provided or otherwise made available to, or used by, any
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    13
 other person.  No title to or ownership of the software is
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    14
 hereby transferred.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    15
1155
vranyj1
parents: 1152
diff changeset
    16
 [1] Code written at SWING Research Group contains a signature
vranyj1
parents: 1152
diff changeset
    17
     of one of the above copright owners. For exact set of such code,
vranyj1
parents: 1152
diff changeset
    18
     see the differences between this version and version stx:libjava
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 891
diff changeset
    19
     as of 1.9.2010
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    20
"
773
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    21
"{ Package: 'stx:libjava' }"
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    22
1515
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    23
TestCase subclass:#JavaRefsAndConstantPoolTestCase
773
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    24
	instanceVariableNames:'exceptionThrowerBackup'
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    25
	classVariableNames:''
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    26
	poolDictionaries:''
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    27
	category:'Languages-Java-Tests-RuntimeConstantPool'
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    28
!
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    29
1515
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    30
Object subclass:#JavaExceptionThrowerMock
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    31
	instanceVariableNames:''
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    32
	classVariableNames:''
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    33
	poolDictionaries:''
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    34
	privateIn:JavaRefsAndConstantPoolTestCase
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    35
!
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    36
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    37
!JavaRefsAndConstantPoolTestCase class methodsFor:'documentation'!
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    38
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    39
copyright
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    40
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    41
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 891
diff changeset
    42
1155
vranyj1
parents: 1152
diff changeset
    43
 New code and modifications done at SWING Research Group [1]:
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 891
diff changeset
    44
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    45
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    46
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    47
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    48
 This software is furnished under a license and may be used
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    49
 only in accordance with the terms of that license and with the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    50
 inclusion of the above copyright notice.   This software may not
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    51
 be provided or otherwise made available to, or used by, any
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    52
 other person.  No title to or ownership of the software is
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    53
 hereby transferred.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    54
1155
vranyj1
parents: 1152
diff changeset
    55
 [1] Code written at SWING Research Group contains a signature
vranyj1
parents: 1152
diff changeset
    56
     of one of the above copright owners. For exact set of such code,
vranyj1
parents: 1152
diff changeset
    57
     see the differences between this version and version stx:libjava
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 891
diff changeset
    58
     as of 1.9.2010
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    59
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    60
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 816
diff changeset
    61
! !
773
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    62
1515
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    63
!JavaRefsAndConstantPoolTestCase class methodsFor:'resources'!
773
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    64
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    65
resources
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    66
    ^ Array with: JavaInitializedResource with: JavaTestsResource.
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    67
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    68
    "Created: / 26-04-2011 / 13:03:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    69
! !
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    70
1515
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    71
!JavaRefsAndConstantPoolTestCase class methodsFor:'testing'!
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    72
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    73
isAbstract
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    74
    ^self == JavaRefsAndConstantPoolTestCase
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    75
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    76
    "Created: / 06-07-2012 / 21:53:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    77
! !
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    78
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
    79
!JavaRefsAndConstantPoolTestCase methodsFor:'cp creation helpers'!
814
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    80
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    81
getClassRefNamed: name 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    82
    "creates classRef with correctly prepared constant pool"
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    83
    
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    84
    | cp |
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    85
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    86
    cp := JavaConstantPool new:2.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    87
    cp at: 1 put: (self getClassRefIn: cp withNameAt: 2).
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    88
    cp at: 2 put: name.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    89
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    90
    ^ cp at: 1.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    91
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    92
    "Created: / 23-05-2011 / 16:17:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    93
!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    94
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    95
getFieldRefNamed: name typed: type inClass: classString
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    96
    "creates fieldRef with correctly prepared constant pool"
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    97
    | cp |
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    98
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    99
    cp := JavaConstantPool new: 6.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   100
    cp at: 1 put: (self getClassRefIn: cp withNameAt: 2).
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   101
    cp at: 2 put: classString.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   102
    cp at: 3 put: name.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   103
    cp at: 4 put: type.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   104
    cp at: 5
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   105
        put: (self 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   106
                getFieldRefIn: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   107
                withNameAndTypeAt: 6 andClassAt: 1).
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   108
    cp at: 6 put: (self getNameAndTypeIn: cp withNameAt: 3 andTypeAt: 4).
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   109
    ^ cp at: 5.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   110
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   111
    "Created: / 23-05-2011 / 15:56:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   112
!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   113
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   114
getInterfaceMethodRefNamed: name typed: type inClass: classString 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   115
   "creates interfaceMethodRef with correctly prepared constant pool"
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   116
    | cp |
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   117
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   118
    cp := JavaConstantPool new: 6.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   119
    cp at: 1 put: (self getClassRefIn: cp withNameAt: 2).
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   120
    cp at: 2 put: classString.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   121
    cp at: 3 put: name.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   122
    cp at: 4 put: type.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   123
    cp at: 5
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   124
        put: (self 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   125
                getInterfaceMethodRefIn: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   126
                withNameAndTypeAt: 6
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   127
                andClassAt: 1).
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   128
    cp at: 6
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   129
        put: (self 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   130
                getNameAndTypeIn: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   131
                withNameAt: 3
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   132
                andTypeAt: 4).
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   133
    ^ cp at: 5.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   134
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   135
    "Created: / 23-05-2011 / 16:15:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   136
!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   137
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   138
getMethodRefNamed: name typed: type inClass: classString 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   139
   "creates methodRef with correctly prepared constant pool"
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   140
    | cp |
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   141
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   142
    cp := JavaConstantPool new: 6.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   143
    cp at: 1 put: (self getClassRefIn: cp withNameAt: 2).
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   144
    cp at: 2 put: classString.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   145
    cp at: 3 put: name.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   146
    cp at: 4 put: type.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   147
    cp at: 5
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   148
        put: (self 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   149
                getMethodRefIn: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   150
                withNameAndTypeAt: 6
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   151
                andClassAt: 1).
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   152
    cp at: 6
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   153
        put: (self 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   154
                getNameAndTypeIn: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   155
                withNameAt: 3
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   156
                andTypeAt: 4).
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   157
    ^ cp at: 5.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   158
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   159
    "Created: / 23-05-2011 / 16:00:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   160
! !
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   161
1515
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   162
!JavaRefsAndConstantPoolTestCase methodsFor:'helpers'!
773
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   163
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   164
disableMockedExceptionThrowing
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   165
    JavaResolver uniqueInstance exceptionThrower: exceptionThrowerBackup.
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   166
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   167
    "Created: / 13-04-2011 / 14:11:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   168
!
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   169
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   170
enableMockedExceptionThrowing
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   171
    exceptionThrowerBackup := JavaResolver uniqueInstance exceptionThrower.
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   172
    JavaResolver uniqueInstance exceptionThrower: JavaExceptionThrowerMock new.
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   173
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   174
    "Created: / 13-04-2011 / 14:11:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   175
!
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   176
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   177
getCrateClassReadStream
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   178
    ^ ((Filename named: UserPreferences current javaTestsDirectory) 
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   179
        / 'libjava' / 'bin' 
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   180
        / 'stx' / 'libjava' 
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   181
        / 'tests' / 'mocks' 
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   182
        / 'Crate.class') readStream.
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   183
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   184
    "Created: / 10-05-2011 / 12:13:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   185
    "Modified: / 12-05-2011 / 16:26:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   186
!
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   187
778
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   188
getPrettyBigConstantPool
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   189
    | cp |
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   190
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   191
    cp := JavaConstantPool new: 20.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   192
    cp at: 1 put: 6.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   193
    cp at: 2 put: 'Ljava/lang/Object;'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   194
    cp at: 3 putClassRefWithNameAt: 2.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   195
    cp 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   196
        at: 4
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   197
        putMethodRefWithClassAt: 3
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   198
        andNameAndTypeAt: 5.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   199
    cp 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   200
        at: 5
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   201
        putNameAndTypeWithNameAt: 6
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   202
        andDescriptorAt: 7.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   203
    cp at: 6 put: '<init>'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   204
    cp at: 7 put: '()V'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   205
    cp at: 8 put: 'Ljava/lang/String;'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   206
    cp at: 9 putClassRefWithNameAt: 8.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   207
    cp 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   208
        at: 10
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   209
        putMethodRefWithClassAt: 9
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   210
        andNameAndTypeAt: 13.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   211
    cp at: 11 put: 'length'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   212
    cp at: 12 put: '()I'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   213
    cp 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   214
        at: 13
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   215
        putNameAndTypeWithNameAt: 11
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   216
        andDescriptorAt: 12.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   217
    cp at: 14 putClassRefWithNameAt: 15.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   218
    cp at: 15 put: 'Ljava/lang/Runnable;'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   219
    cp at: 16 put: 'run'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   220
    cp at: 17 put: '()V'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   221
    cp 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   222
        at: 18
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   223
        putNameAndTypeWithNameAt: 16
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   224
        andDescriptorAt: 17.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   225
    cp at: 19 putClassRefWithNameAt: 15.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   226
    cp 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   227
        at: 20
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   228
        putInterfaceMethodRefWithClassAt: 19
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   229
        andNameAndTypeAt: 18.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   230
    ^ cp
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   231
814
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   232
    "Modified: / 23-05-2011 / 15:16:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
778
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   233
!
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   234
777
e6e61412ae43 refactoring tests.. and more needed
hlopkmar
parents: 774
diff changeset
   235
javaLangObject
e6e61412ae43 refactoring tests.. and more needed
hlopkmar
parents: 774
diff changeset
   236
^Java classForName:'java.lang.Object'.
e6e61412ae43 refactoring tests.. and more needed
hlopkmar
parents: 774
diff changeset
   237
e6e61412ae43 refactoring tests.. and more needed
hlopkmar
parents: 774
diff changeset
   238
    "Created: / 12-05-2011 / 19:09:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
773
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   239
! !
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   240
1515
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   241
!JavaRefsAndConstantPoolTestCase methodsFor:'refs creation'!
814
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   242
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   243
getClassRefIn: aJavaConstantPool withNameAt: nameCPIndex 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   244
    | result |
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   245
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   246
    result := JavaClassRef2 in: aJavaConstantPool withNameAt: nameCPIndex.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   247
    result owner: self javaLangObject.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   248
    ^ result.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   249
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   250
    "Created: / 12-05-2011 / 19:14:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   251
    "Modified: / 23-05-2011 / 16:24:32 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   252
!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   253
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   254
getFieldRefIn: cp withNameAndTypeAt: nmIndex andClassAt: classIndex 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   255
    |result|
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   256
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   257
    result := JavaFieldRef2 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   258
        in: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   259
        withNameAndTypeAt: nmIndex
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   260
        andClassAt: classIndex.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   261
result owner: self javaLangObject.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   262
    ^ result.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   263
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   264
    "Created: / 23-05-2011 / 16:01:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   265
!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   266
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   267
getInterfaceMethodRefIn: cp withNameAndTypeAt: nmIndex andClassAt: classIndex 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   268
    |result|
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   269
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   270
    result:= JavaInterfaceMethodRef2 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   271
        in: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   272
        withNameAndTypeAt: nmIndex
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   273
        andClassAt: classIndex.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   274
 result owner: self javaLangObject.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   275
    ^ result.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   276
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   277
    "Created: / 23-05-2011 / 15:58:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   278
!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   279
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   280
getMethodRefIn: cp withNameAndTypeAt: nmIndex andClassAt: classIndex 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   281
    |result|
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   282
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   283
    result := JavaMethodRef2 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   284
        in: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   285
        withNameAndTypeAt: nmIndex
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   286
        andClassAt: classIndex.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   287
 result owner: self javaLangObject.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   288
    ^ result.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   289
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   290
    "Created: / 23-05-2011 / 15:58:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   291
!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   292
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   293
getNameAndTypeIn: cp withNameAt: nameIndex andTypeAt: typeIndex 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   294
    |result|
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   295
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   296
    result := JavaNameAndType2 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   297
        in: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   298
        withNameAt: nameIndex
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   299
        andDescriptorAt: typeIndex.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   300
 result owner: self javaLangObject.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   301
    ^ result.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   302
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   303
    "Created: / 23-05-2011 / 16:00:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   304
! !
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   305
1515
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   306
!JavaRefsAndConstantPoolTestCase methodsFor:'running'!
774
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   307
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   308
setUp
777
e6e61412ae43 refactoring tests.. and more needed
hlopkmar
parents: 774
diff changeset
   309
    self enableMockedExceptionThrowing.
774
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   310
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   311
    "Created: / 12-05-2011 / 17:30:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
816
4e3072021201 all tests fixed.. updated interfaceMethodRef to checkPermissions (which were not checked until now ehm)
hlopkmar
parents: 814
diff changeset
   312
    "Modified: / 23-05-2011 / 18:02:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
774
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   313
!
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   314
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   315
tearDown
891
vranyj1
parents: 877
diff changeset
   316
777
e6e61412ae43 refactoring tests.. and more needed
hlopkmar
parents: 774
diff changeset
   317
    self disableMockedExceptionThrowing.
774
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   318
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   319
    "Created: / 12-05-2011 / 17:30:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
891
vranyj1
parents: 877
diff changeset
   320
    "Modified: / 08-08-2011 / 17:24:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
774
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   321
! !
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   322
1515
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   323
!JavaRefsAndConstantPoolTestCase::JavaExceptionThrowerMock class methodsFor:'documentation'!
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   324
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   325
copyright
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   326
"
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   327
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   328
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   329
 New code and modifications done at SWING Research Group [1]:
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   330
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   331
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   332
                            SWING Research Group, Czech Technical University in Prague
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   333
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   334
 This software is furnished under a license and may be used
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   335
 only in accordance with the terms of that license and with the
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   336
 inclusion of the above copyright notice.   This software may not
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   337
 be provided or otherwise made available to, or used by, any
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   338
 other person.  No title to or ownership of the software is
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   339
 hereby transferred.
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   340
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   341
 [1] Code written at SWING Research Group contains a signature
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   342
     of one of the above copright owners. For exact set of such code,
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   343
     see the differences between this version and version stx:libjava
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   344
     as of 1.9.2010
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   345
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   346
"
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   347
!
773
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   348
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   349
version_SVN
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   350
    ^ '$Id$'
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   351
! !
1515
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   352
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   353
!JavaRefsAndConstantPoolTestCase::JavaExceptionThrowerMock methodsFor:'exceptions'!
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   354
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   355
throwAbstractMethodError
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   356
    self error: 'AbstractMethodError'.
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   357
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   358
    "Created: / 11-04-2011 / 20:19:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   359
    "Modified: / 13-04-2011 / 14:09:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   360
!
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   361
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   362
throwIllegalAccessError
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   363
    self error: 'IllegalAccessError'.
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   364
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   365
    "Created: / 11-04-2011 / 19:39:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   366
    "Modified: / 13-04-2011 / 14:09:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   367
!
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   368
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   369
throwIllegalAccessException
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   370
    self error: 'IllegalAccessException'.
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   371
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   372
    "Created: / 13-04-2011 / 23:02:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   373
!
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   374
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   375
throwIncompatibleClassChangeError
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   376
    self error: 'IncompatibleClassChangeError'.
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   377
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   378
    "Created: / 11-04-2011 / 20:02:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   379
    "Modified: / 13-04-2011 / 14:09:50 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   380
!
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   381
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   382
throwNoSuchFieldException
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   383
    self error: 'NoSuchFieldException'.
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   384
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   385
    "Created: / 11-04-2011 / 21:35:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   386
    "Modified: / 13-04-2011 / 14:10:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   387
!
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   388
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   389
throwNoSuchMethodError
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   390
    self error: 'NoSuchMethodError'.
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   391
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   392
    "Created: / 11-04-2011 / 20:19:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   393
    "Modified: / 13-04-2011 / 14:10:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   394
! !
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   395
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   396
!JavaRefsAndConstantPoolTestCase class methodsFor:'documentation'!
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   397
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   398
version_SVN
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   399
    ^ '$Id$'
f4ebf5cf3f89 - JavaClassReaderTests
vranyj1
parents: 1155
diff changeset
   400
! !