JavaClassRefTests.st
author Claus Gittinger <cg@exept.de>
Thu, 24 Nov 2011 12:54:59 +0100
changeset 2305 c11e70f81f74
parent 2152 1cbdfbcc685c
child 2353 fa7400d022a0
permissions -rw-r--r--
fixed: #version_SVN ($ to ยง)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     1
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     3
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     4
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     6
 Parts of the code written by Claus Gittinger are under following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     7
 license:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     8
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     9
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    10
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    12
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    13
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    14
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    15
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    16
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    17
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    18
 Permission is hereby granted, free of charge, to any person
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    19
 obtaining a copy of this software and associated documentation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    20
 files (the 'Software'), to deal in the Software without
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    21
 restriction, including without limitation the rights to use,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    22
 copy, modify, merge, publish, distribute, sublicense, and/or sell
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    23
 copies of the Software, and to permit persons to whom the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    24
 Software is furnished to do so, subject to the following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    25
 conditions:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    26
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    27
 The above copyright notice and this permission notice shall be
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    28
 included in all copies or substantial portions of the Software.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    29
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    30
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    31
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    32
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    33
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    34
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    35
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    36
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    37
 OTHER DEALINGS IN THE SOFTWARE.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    38
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    39
 [1] Code written at SWING Research Group contain a signature
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    40
     of one of the above copright owners.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    41
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    42
"{ Package: 'stx:libjava' }"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    43
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    44
AbstractJavaTestCase subclass:#JavaClassRefTests
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    45
	instanceVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    46
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    47
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    48
	category:'Languages-Java-Tests-RuntimeConstantPool'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    49
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    50
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    51
!JavaClassRefTests class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    52
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    53
copyright
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    54
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    55
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    56
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    57
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    58
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    59
 Parts of the code written by Claus Gittinger are under following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    60
 license:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    61
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    62
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    63
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    64
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    65
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    66
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    67
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    68
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    69
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    70
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    71
 Permission is hereby granted, free of charge, to any person
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    72
 obtaining a copy of this software and associated documentation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    73
 files (the 'Software'), to deal in the Software without
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    74
 restriction, including without limitation the rights to use,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    75
 copy, modify, merge, publish, distribute, sublicense, and/or sell
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    76
 copies of the Software, and to permit persons to whom the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    77
 Software is furnished to do so, subject to the following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    78
 conditions:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    79
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    80
 The above copyright notice and this permission notice shall be
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    81
 included in all copies or substantial portions of the Software.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    82
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    83
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    84
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    85
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    86
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    87
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    88
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    89
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    90
 OTHER DEALINGS IN THE SOFTWARE.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    91
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    92
 [1] Code written at SWING Research Group contain a signature
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    93
     of one of the above copright owners.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    94
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    95
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    96
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    97
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    98
!JavaClassRefTests methodsFor:'arrays'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    99
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   100
testCorrectArrayCreation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   101
|classRef result expectedResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   102
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   103
    classRef := self getClassRefNamed: '[Ljava/lang/Object;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   104
    result := classRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   105
    expectedResult := JavaVM javaArrayClassFor: (Java classForName: 'java.lang.Object').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   106
    self assertTrue: (result = expectedResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   107
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   108
    "Created: / 23-05-2011 / 21:15:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   109
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   110
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   111
testCorrectMultiArrayCreation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   112
    | classRef  result  expectedResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   113
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   114
    classRef := self getClassRefNamed: '[[[[[Ljava/lang/Object;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   115
    result := classRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   116
    expectedResult := JavaVM 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   117
                javaArrayClassFor: (Java classForName: 'java.lang.Object').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   118
    self assertTrue: (result = expectedResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   119
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   120
    "Created: / 23-05-2011 / 21:15:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   121
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   122
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   123
!JavaClassRefTests methodsFor:'permission tests'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   124
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   125
testAccessingNonPublicFromInside
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   126
    | javaClassRef  initString  throwedException |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   127
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   128
    self enableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   129
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   130
    [ initString := 'Lstx/libjava/tests/mocks/NonPublicClass;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   131
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   132
    javaClassRef owner: (Java classForName: 'stx.libjava.tests.mocks.Crate').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   133
    javaClassRef resolve. ] on: Error
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   134
            do: [:e | throwedException := e ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   135
    self assertTrue: (throwedException isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   136
    self disableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   137
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   138
    "Created: / 13-04-2011 / 13:42:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   139
    "Modified: / 23-05-2011 / 17:58:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   140
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   141
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   142
testAccessingNonPublicFromOutside
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   143
    | javaClassRef  initString  throwedException |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   144
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   145
    self enableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   146
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   147
    [ initString := 'Lstx/libjava/tests/mocks/NonPublicClass;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   148
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   149
    javaClassRef owner: (Java classForName: 'java.lang.Object').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   150
    javaClassRef resolve. ] on: Error
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   151
            do: [:e | throwedException := e ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   152
    self assertTrue: (throwedException notNil 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   153
                and: [ throwedException messageText = 'IllegalAccessError' ]).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   154
    self disableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   155
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   156
    "Created: / 13-04-2011 / 13:37:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   157
    "Modified: / 23-05-2011 / 17:58:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   158
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   159
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   160
testAccessingPublic
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   161
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   162
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   163
    self enableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   164
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   165
            [ initString := 'Lstx/libjava/tests/mocks/PublicClass;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   166
            javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   167
            javaClassRef owner: (Java classForName: 'java.lang.Object').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   168
            javaClassRef resolve. ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   169
        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   170
    self disableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   171
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   172
    "Created: / 13-04-2011 / 13:36:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   173
    "Modified: / 23-05-2011 / 17:58:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   174
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   175
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   176
testNonPublicClassPresent
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   177
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   178
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   179
    self enableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   180
    initString := 'Lstx/libjava/tests/mocks/NonPublicClass;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   181
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   182
    javaClassRef owner: (Java 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   183
                classForName: 'stx.libjava.tests.mocks.SubclassOfNonPublicClass').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   184
    javaClassRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   185
    self assertTrue: (javaClassRef valueCache notNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   186
    self disableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   187
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   188
    "Created: / 13-04-2011 / 13:38:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   189
    "Modified: / 23-05-2011 / 17:58:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   190
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   191
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   192
testPublicClassPresent
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   193
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   194
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   195
    self enableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   196
    initString := 'Lstx/libjava/tests/mocks/PublicClass;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   197
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   198
    javaClassRef owner: (Java classForName: 'java.lang.Object').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   199
    javaClassRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   200
    self assertTrue: (javaClassRef valueCache notNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   201
    self disableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   202
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   203
    "Created: / 13-04-2011 / 13:39:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   204
    "Modified: / 23-05-2011 / 17:58:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   205
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   206
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   207
!JavaClassRefTests methodsFor:'primitives'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   208
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   209
testAllPrimitiveArrayClasses
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   210
    | classRef  descriptor |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   211
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   212
    #( $B $C $D $F $I $J $S $Z ) do: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   213
            [:each | 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   214
            descriptor := '[' , each.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   215
            classRef := self getClassRefNamed: descriptor.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   216
            self assertTrue: ((JavaDescriptor readFromString: descriptor) javaClass 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   217
                        = classRef resolve) ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   218
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   219
    "Created: / 23-05-2011 / 20:49:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   220
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   221
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   222
testAllPrimitiveClasses
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   223
    | classRef |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   224
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   225
    #( $B $C $D $F $I $J $S $Z )
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   226
        do: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   227
            [:each | 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   228
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   229
            classRef := self getClassRefNamed: each asString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   230
            self assertTrue: ((JavaDescriptor baseTypes at: each) = classRef resolve) ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   231
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   232
    "Created: / 23-05-2011 / 20:48:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   233
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   234
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   235
testAllPrimitiveMultiArrayClasses
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   236
    | classRef  descriptor |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   237
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   238
    #( $B $C $D $F $I $J $S $Z )
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   239
        do: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   240
            [:each | 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   241
            descriptor := '[[[[' , each.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   242
            classRef := self getClassRefNamed: descriptor.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   243
            self assertTrue: ((JavaDescriptor readFromString: descriptor) javaClass 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   244
                        = classRef resolve) ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   245
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   246
    "Created: / 23-05-2011 / 20:50:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   247
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   248
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   249
!JavaClassRefTests methodsFor:'resolving static tests'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   250
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   251
testCorrectStaticResolving
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   252
    | javaClassRef  initString  result  expectedResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   253
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   254
    initString := 'Lstx/libjava/tests/mocks/ClassWithInnerClasses$InnerStatic;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   255
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   256
    javaClassRef 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   257
        owner: (Java classForName: 'stx.libjava.tests.mocks.ClassWithInnerClasses').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   258
    expectedResult := Java 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   259
                classForName: 'stx.libjava.tests.mocks.ClassWithInnerClasses$InnerStatic'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   260
    result := javaClassRef resolveStatic.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   261
    self assertTrue: (result = expectedResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   262
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   263
    "Created: / 28-04-2011 / 21:51:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   264
    "Modified: / 23-05-2011 / 17:58:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   265
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   266
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   267
!JavaClassRefTests methodsFor:'resolving tests'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   268
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   269
testCorrectInstanceCreation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   270
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   271
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   272
    initString := 'Ljava/lang/String;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   273
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   274
    self assertFalse: (javaClassRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   275
    self assertTrue: (javaClassRef valueCache isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   276
    self assertTrue: (javaClassRef name = initString).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   277
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   278
    "Created: / 08-04-2011 / 14:01:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   279
    "Modified: / 23-05-2011 / 17:58:08 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   280
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   281
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   282
testCorrectResolving
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   283
    | javaClassRef  initString  result  expectedResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   284
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   285
    initString := 'Ljava/lang/String;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   286
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   287
    javaClassRef owner: (Java classForName: 'java.lang.Object').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   288
    expectedResult := Java classForName: 'java.lang.String'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   289
    result := javaClassRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   290
    self assertTrue: (result = expectedResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   291
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   292
    "Created: / 08-04-2011 / 14:07:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   293
    "Modified: / 23-05-2011 / 17:58:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   294
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   295
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   296
testInvalidation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   297
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   298
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   299
    initString := 'Ljava/lang/String;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   300
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   301
    javaClassRef owner: (Java classForName: 'java.lang.Object').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   302
    self assertTrue: (javaClassRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   303
    javaClassRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   304
    self assertTrue: (javaClassRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   305
    javaClassRef invalidate.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   306
    self assertTrue: (javaClassRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   307
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   308
    "Created: / 08-04-2011 / 14:09:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   309
    "Modified: / 23-05-2011 / 17:58:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   310
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   311
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   312
testInvalidationForClassNegative
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   313
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   314
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   315
    initString := 'Ljava/lang/String;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   316
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   317
    javaClassRef owner: (Java classForName: 'java.lang.Object').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   318
    self assertTrue: (javaClassRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   319
    javaClassRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   320
    self assertTrue: (javaClassRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   321
    javaClassRef invalidateForClass: 'Ljava/lang/Object;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   322
    self assertTrue: (javaClassRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   323
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   324
    "Created: / 08-04-2011 / 16:21:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   325
    "Modified: / 23-05-2011 / 17:58:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   326
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   327
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   328
testInvalidationForClassPositive
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   329
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   330
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   331
    initString := 'Ljava/lang/String;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   332
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   333
    javaClassRef owner: (Java classForName: 'java.lang.Object').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   334
    self assertTrue: (javaClassRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   335
    javaClassRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   336
    self assertTrue: (javaClassRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   337
    javaClassRef invalidateForClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   338
    self assertTrue: (javaClassRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   339
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   340
    "Created: / 08-04-2011 / 16:21:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   341
    "Modified: / 23-05-2011 / 17:57:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   342
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   343
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   344
testResolving
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   345
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   346
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   347
    initString := 'Ljava/lang/String;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   348
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   349
    javaClassRef owner: (Java classForName: 'java.lang.Object').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   350
    self assertTrue: (javaClassRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   351
    javaClassRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   352
    self assertTrue: (javaClassRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   353
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   354
    "Created: / 08-04-2011 / 14:04:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   355
    "Modified: / 23-05-2011 / 17:57:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   356
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   357
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   358
!JavaClassRefTests class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   359
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   360
version_SVN
2152
1cbdfbcc685c Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 749
diff changeset
   361
    ^ '$Id: JavaClassRefTests.st,v 1.1 2011-08-18 19:06:53 vrany Exp $'
1cbdfbcc685c Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 749
diff changeset
   362
! !