src/AbstractJavaTestCase.st
author hlopkmar
Mon, 23 May 2011 14:53:35 +0000
branchjk_new_structure
changeset 814 68df82c46fb0
parent 778 caa3a009f617
child 816 4e3072021201
permissions -rw-r--r--
finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
773
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
     1
"{ Package: 'stx:libjava' }"
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
     2
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
     3
TestCase subclass:#AbstractJavaTestCase
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
     4
	instanceVariableNames:'exceptionThrowerBackup'
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
     5
	classVariableNames:''
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
     6
	poolDictionaries:''
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
     7
	category:'Languages-Java-Tests-RuntimeConstantPool'
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
     8
!
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
     9
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    10
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    11
!AbstractJavaTestCase class methodsFor:'resources'!
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    12
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    13
resources
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    14
    ^ Array with: JavaInitializedResource with: JavaTestsResource.
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    15
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    16
    "Created: / 26-04-2011 / 13:03:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    17
! !
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
    18
814
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    19
!AbstractJavaTestCase methodsFor:'cp creation helpers'!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    20
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    21
getClassRefNamed: name 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    22
    "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
    23
    
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    24
    | cp |
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    25
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    26
    cp := JavaConstantPool new:2.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    27
    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
    28
    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
    29
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    30
    ^ cp at: 1.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    31
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    32
    "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
    33
!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    34
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    35
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
    36
    "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
    37
    | cp |
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    38
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    39
    cp := JavaConstantPool new: 6.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    40
    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
    41
    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
    42
    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
    43
    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
    44
    cp at: 5
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    45
        put: (self 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    46
                getFieldRefIn: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    47
                withNameAndTypeAt: 6 andClassAt: 1).
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    48
    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
    49
    ^ cp at: 5.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    50
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    51
    "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
    52
!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    53
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    54
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
    55
   "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
    56
    | cp |
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    57
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    58
    cp := JavaConstantPool new: 6.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    59
    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
    60
    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
    61
    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
    62
    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
    63
    cp at: 5
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    64
        put: (self 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    65
                getInterfaceMethodRefIn: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    66
                withNameAndTypeAt: 6
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    67
                andClassAt: 1).
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    68
    cp at: 6
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    69
        put: (self 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    70
                getNameAndTypeIn: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    71
                withNameAt: 3
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    72
                andTypeAt: 4).
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    73
    ^ cp at: 5.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    74
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    75
    "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
    76
!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    77
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    78
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
    79
   "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
    80
    | cp |
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    81
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    82
    cp := JavaConstantPool new: 6.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    83
    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
    84
    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
    85
    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
    86
    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
    87
    cp at: 5
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    88
        put: (self 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    89
                getMethodRefIn: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    90
                withNameAndTypeAt: 6
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    91
                andClassAt: 1).
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    92
    cp at: 6
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    93
        put: (self 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    94
                getNameAndTypeIn: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    95
                withNameAt: 3
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    96
                andTypeAt: 4).
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
    97
    ^ cp at: 5.
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
    "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
   100
! !
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   101
773
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   102
!AbstractJavaTestCase methodsFor:'helpers'!
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   103
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   104
disableMockedExceptionThrowing
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   105
    JavaResolver uniqueInstance exceptionThrower: exceptionThrowerBackup.
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   106
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   107
    "Created: / 13-04-2011 / 14:11:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   108
!
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   109
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   110
enableMockedExceptionThrowing
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   111
    exceptionThrowerBackup := JavaResolver uniqueInstance exceptionThrower.
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   112
    JavaResolver uniqueInstance exceptionThrower: JavaExceptionThrowerMock new.
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   113
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   114
    "Created: / 13-04-2011 / 14:11:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   115
!
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   116
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   117
getCrateClassReadStream
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   118
    ^ ((Filename named: UserPreferences current javaTestsDirectory) 
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   119
        / 'libjava' / 'bin' 
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   120
        / 'stx' / 'libjava' 
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   121
        / 'tests' / 'mocks' 
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   122
        / 'Crate.class') readStream.
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   123
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   124
    "Created: / 10-05-2011 / 12:13:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   125
    "Modified: / 12-05-2011 / 16:26:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   126
!
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   127
778
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   128
getPrettyBigConstantPool
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   129
    | cp |
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   130
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   131
    cp := JavaConstantPool new: 20.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   132
    cp at: 1 put: 6.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   133
    cp at: 2 put: 'Ljava/lang/Object;'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   134
    cp at: 3 putClassRefWithNameAt: 2.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   135
    cp 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   136
        at: 4
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   137
        putMethodRefWithClassAt: 3
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   138
        andNameAndTypeAt: 5.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   139
    cp 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   140
        at: 5
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   141
        putNameAndTypeWithNameAt: 6
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   142
        andDescriptorAt: 7.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   143
    cp at: 6 put: '<init>'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   144
    cp at: 7 put: '()V'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   145
    cp at: 8 put: 'Ljava/lang/String;'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   146
    cp at: 9 putClassRefWithNameAt: 8.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   147
    cp 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   148
        at: 10
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   149
        putMethodRefWithClassAt: 9
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   150
        andNameAndTypeAt: 13.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   151
    cp at: 11 put: 'length'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   152
    cp at: 12 put: '()I'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   153
    cp 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   154
        at: 13
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   155
        putNameAndTypeWithNameAt: 11
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   156
        andDescriptorAt: 12.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   157
    cp at: 14 putClassRefWithNameAt: 15.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   158
    cp at: 15 put: 'Ljava/lang/Runnable;'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   159
    cp at: 16 put: 'run'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   160
    cp at: 17 put: '()V'.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   161
    cp 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   162
        at: 18
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   163
        putNameAndTypeWithNameAt: 16
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   164
        andDescriptorAt: 17.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   165
    cp at: 19 putClassRefWithNameAt: 15.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   166
    cp 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   167
        at: 20
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   168
        putInterfaceMethodRefWithClassAt: 19
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   169
        andNameAndTypeAt: 18.
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   170
    ^ cp
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   171
814
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   172
    "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
   173
!
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   174
777
e6e61412ae43 refactoring tests.. and more needed
hlopkmar
parents: 774
diff changeset
   175
javaLangObject
e6e61412ae43 refactoring tests.. and more needed
hlopkmar
parents: 774
diff changeset
   176
^Java classForName:'java.lang.Object'.
e6e61412ae43 refactoring tests.. and more needed
hlopkmar
parents: 774
diff changeset
   177
e6e61412ae43 refactoring tests.. and more needed
hlopkmar
parents: 774
diff changeset
   178
    "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
   179
! !
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   180
814
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   181
!AbstractJavaTestCase methodsFor:'refs creation'!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   182
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   183
getClassRefIn: aJavaConstantPool withNameAt: nameCPIndex 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   184
    | result |
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   185
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   186
    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
   187
    result owner: self javaLangObject.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   188
    ^ result.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   189
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   190
    "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
   191
    "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
   192
!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   193
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   194
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
   195
    |result|
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   196
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   197
    result := JavaFieldRef2 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   198
        in: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   199
        withNameAndTypeAt: nmIndex
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   200
        andClassAt: classIndex.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   201
result owner: self javaLangObject.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   202
    ^ result.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   203
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   204
    "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
   205
!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   206
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   207
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
   208
    |result|
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   209
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   210
    result:= JavaInterfaceMethodRef2 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   211
        in: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   212
        withNameAndTypeAt: nmIndex
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   213
        andClassAt: classIndex.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   214
 result owner: self javaLangObject.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   215
    ^ result.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   216
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   217
    "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
   218
!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   219
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   220
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
   221
    |result|
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   222
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   223
    result := JavaMethodRef2 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   224
        in: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   225
        withNameAndTypeAt: nmIndex
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   226
        andClassAt: classIndex.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   227
 result owner: self javaLangObject.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   228
    ^ result.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   229
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   230
    "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
   231
!
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   232
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   233
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
   234
    |result|
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   235
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   236
    result := JavaNameAndType2 
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   237
        in: cp
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   238
        withNameAt: nameIndex
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   239
        andDescriptorAt: typeIndex.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   240
 result owner: self javaLangObject.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   241
    ^ result.
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
    "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
   244
! !
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 778
diff changeset
   245
774
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   246
!AbstractJavaTestCase methodsFor:'running'!
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   247
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   248
setUp
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   249
    JavaClassReader useNewClassReader.
777
e6e61412ae43 refactoring tests.. and more needed
hlopkmar
parents: 774
diff changeset
   250
    self enableMockedExceptionThrowing.
774
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   251
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   252
    "Created: / 12-05-2011 / 17:30:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   253
!
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   254
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   255
tearDown
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   256
    JavaClassReader useOldClassReader.
777
e6e61412ae43 refactoring tests.. and more needed
hlopkmar
parents: 774
diff changeset
   257
    self disableMockedExceptionThrowing.
774
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   258
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   259
    "Created: / 12-05-2011 / 17:30:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   260
! !
ac54730a2b74 cleaning.. removed JavaConstantPoolContent
hlopkmar
parents: 773
diff changeset
   261
773
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   262
!AbstractJavaTestCase class methodsFor:'documentation'!
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   263
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   264
version_SVN
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   265
    ^ '$Id$'
ff7dbe5581a3 cleaned tests class hierarchy, small fixes
hlopkmar
parents:
diff changeset
   266
! !