JavaClassRefTests.st
author Stefan Vogel <sv@exept.de>
Thu, 11 Apr 2019 18:33:00 +0200
branchcvs_MAIN
changeset 3896 0467a3e7cc0f
parent 3412 df11bb428463
child 3539 e546e1df7a01
permissions -rw-r--r--
#REFACTORING by stefan class: JavaNativeMethodImpl_OpenJDK6 class changed: #_java_io_UnixFileSystem_canonicalize0:_: #_java_io_WinNTFileSystem_canonicalize0:_: #_java_io_WinNTFileSystem_canonicalizeWithPrefix0:_:_: use \"asFilename pathName\" instead of \"asFilename asAbsoluteFilename pathName\" ist is equivalent!
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     1
"
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3008
diff changeset
     2
 COPYRIGHT (c) 1996-2015 by Claus Gittinger
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
     3
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
     4
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
     5
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3008
diff changeset
     6
 COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     7
                            SWING Research Group, Czech Technical University in Prague
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
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    16
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    17
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    18
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    19
     as of 1.9.2010
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    20
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    21
"{ Package: 'stx:libjava' }"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    22
3330
b14c58b2876c Oops, moved stray reloading-related methods from stx:libjava/experiments to stx:libjava.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3324
diff changeset
    23
"{ NameSpace: Smalltalk }"
b14c58b2876c Oops, moved stray reloading-related methods from stx:libjava/experiments to stx:libjava.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3324
diff changeset
    24
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    25
JavaRefsAndConstantPoolTestCase subclass:#JavaClassRefTests
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    26
	instanceVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    27
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    28
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    29
	category:'Languages-Java-Tests-RuntimeConstantPool'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    30
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    31
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    32
!JavaClassRefTests class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    33
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    34
copyright
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    35
"
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3008
diff changeset
    36
 COPYRIGHT (c) 1996-2015 by Claus Gittinger
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    37
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    38
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    39
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3008
diff changeset
    40
 COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    41
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    42
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    43
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    44
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    45
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    46
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    47
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    48
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    49
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    50
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    51
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    52
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    53
     as of 1.9.2010
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    54
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    55
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    56
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    57
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    58
!JavaClassRefTests methodsFor:'arrays'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    59
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    60
testCorrectArrayCreation
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    61
    | classRef  result  expectedResult |
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    62
    classRef := self getClassRefNamed: '[Ljava/lang/Object;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    63
    result := classRef resolve.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    64
    expectedResult := JavaArray 
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    65
            javaArrayClassFor: (Java classForName: 'java.lang.Object').
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    66
    self assertTrue: (result = expectedResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    67
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    68
    "Created: / 23-05-2011 / 21:15:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    69
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    70
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    71
testCorrectMultiArrayCreation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    72
    | classRef  result  expectedResult |
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    73
    classRef := self getClassRefNamed: '[[Ljava/lang/Object;'.
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    74
    result := classRef resolve.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    75
    expectedResult := JavaArray javaArrayClassFor: (JavaArray 
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    76
                    javaArrayClassFor: (Java classForName: 'java.lang.Object')).
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    77
    self assertTrue: (result name = expectedResult name).
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    78
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    79
    "Created: / 23-05-2011 / 21:15:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    80
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    81
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    82
!JavaClassRefTests methodsFor:'permission tests'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    83
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    84
testAccessingNonPublicFromInside
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    85
    | javaClassRef  initString  throwedException |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    86
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    87
    self enableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    88
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    89
    [ initString := 'Lstx/libjava/tests/mocks/NonPublicClass;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    90
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    91
    javaClassRef owner: (Java classForName: 'stx.libjava.tests.mocks.Crate').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    92
    javaClassRef resolve. ] on: Error
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    93
            do: [:e | throwedException := e ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    94
    self assertTrue: (throwedException isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    95
    self disableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    96
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    97
    "Created: / 13-04-2011 / 13:42:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    98
    "Modified: / 23-05-2011 / 17:58:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    99
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   100
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   101
testAccessingNonPublicFromOutside
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   102
    | javaClassRef  initString  throwedException |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   103
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   104
    self enableMockedExceptionThrowing.
2960
d133d35e293b Class loading refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   105
    [
d133d35e293b Class loading refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   106
        initString := 'Lstx/libjava/tests/mocks/NonPublicClass;'.
d133d35e293b Class loading refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   107
        javaClassRef := self getClassRefNamed:initString.
3004
659fb25645b0 fix constant pool content tests
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2960
diff changeset
   108
        javaClassRef owner: self someJavaClass.
2960
d133d35e293b Class loading refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   109
        javaClassRef resolve.
d133d35e293b Class loading refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   110
    ] on:Error do:[:e | throwedException := e ].
d133d35e293b Class loading refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   111
    self assertTrue:(throwedException notNil 
d133d35e293b Class loading refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   112
                and:[ throwedException messageText = 'IllegalAccessError' ]).
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   113
    self disableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   114
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   115
    "Created: / 13-04-2011 / 13:37:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   116
    "Modified: / 23-05-2011 / 17:58:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2960
d133d35e293b Class loading refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   117
    "Modified: / 10-12-2013 / 18:36:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   118
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   119
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   120
testAccessingPublic
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   121
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   122
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   123
    self enableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   124
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   125
            [ initString := 'Lstx/libjava/tests/mocks/PublicClass;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   126
            javaClassRef := self getClassRefNamed: initString.
3004
659fb25645b0 fix constant pool content tests
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2960
diff changeset
   127
            javaClassRef owner: self someJavaClass.
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   128
            javaClassRef resolve. ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   129
        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   130
    self disableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   131
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   132
    "Created: / 13-04-2011 / 13:36:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   133
    "Modified: / 23-05-2011 / 17:58:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2960
d133d35e293b Class loading refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
   134
    "Modified: / 10-12-2013 / 18:38:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   135
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   136
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   137
testNonPublicClassPresent
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   138
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   139
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   140
    self enableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   141
    initString := 'Lstx/libjava/tests/mocks/NonPublicClass;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   142
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   143
    javaClassRef owner: (Java 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   144
                classForName: 'stx.libjava.tests.mocks.SubclassOfNonPublicClass').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   145
    javaClassRef resolve.
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2960
diff changeset
   146
    self assertTrue: (javaClassRef resolvedValue notNil).
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   147
    self disableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   148
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   149
    "Created: / 13-04-2011 / 13:38:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   150
    "Modified: / 23-05-2011 / 17:58:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2960
diff changeset
   151
    "Modified: / 31-01-2014 / 09:12:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   152
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   153
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   154
testPublicClassPresent
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   155
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   156
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   157
    self enableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   158
    initString := 'Lstx/libjava/tests/mocks/PublicClass;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   159
    javaClassRef := self getClassRefNamed: initString.
3004
659fb25645b0 fix constant pool content tests
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 2960
diff changeset
   160
    javaClassRef owner: self someJavaClass.
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   161
    javaClassRef resolve.
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2960
diff changeset
   162
    self assertTrue: (javaClassRef resolvedValue notNil).
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   163
    self disableMockedExceptionThrowing.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   164
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   165
    "Created: / 13-04-2011 / 13:39:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   166
    "Modified: / 23-05-2011 / 17:58:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2960
diff changeset
   167
    "Modified: / 31-01-2014 / 09:13:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   168
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   169
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   170
!JavaClassRefTests methodsFor:'primitives'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   171
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   172
testAllPrimitiveArrayClasses
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   173
    | classRef  descriptor |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   174
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   175
    #( $B $D $F $I $J $S $Z ) do: 
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   176
            [:each | 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   177
            descriptor := '[' , each.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   178
            classRef := self getClassRefNamed: descriptor.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   179
            self assertTrue: ((JavaDescriptor readFromString: descriptor) javaClass 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   180
                        = classRef resolve) ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   181
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   182
    "Created: / 23-05-2011 / 20:49:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   183
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   184
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   185
testAllPrimitiveClasses
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   186
    | classRef |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   187
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   188
    #( $B $C $D $F $I $J $S $Z )
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   189
        do: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   190
            [:each | 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   191
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   192
            classRef := self getClassRefNamed: each asString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   193
            self assertTrue: ((JavaDescriptor baseTypes at: each) = classRef resolve) ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   194
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   195
    "Created: / 23-05-2011 / 20:48:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   196
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   197
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   198
testAllPrimitiveMultiArrayClasses
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   199
    | classRef  descriptor |
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   200
    #( $B $D $F $I $J $S $Z ) do: [
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   201
        :each | 
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   202
        descriptor := '[[[[' , each.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   203
        classRef := self getClassRefNamed: descriptor.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   204
        self assertTrue: ((JavaDescriptor readFromString: descriptor) match: classRef resolve). 
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   205
    ].
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   206
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   207
    "Created: / 23-05-2011 / 20:50:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   208
    "Modified: / 17-11-2012 / 21:40:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   209
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   210
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   211
!JavaClassRefTests methodsFor:'resolving static tests'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   212
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   213
testCorrectStaticResolving
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   214
    | javaClassRef  initString  result  expectedResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   215
    initString := 'Lstx/libjava/tests/mocks/ClassWithInnerClasses$InnerStatic;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   216
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   217
    javaClassRef 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   218
        owner: (Java classForName: 'stx.libjava.tests.mocks.ClassWithInnerClasses').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   219
    expectedResult := Java 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   220
                classForName: 'stx.libjava.tests.mocks.ClassWithInnerClasses$InnerStatic'.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   221
    result := javaClassRef resolve.
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   222
    self assertTrue: (result = expectedResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   223
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   224
    "Created: / 28-04-2011 / 21:51:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   225
    "Modified: / 08-12-2011 / 19:24:46 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   226
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   227
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   228
!JavaClassRefTests methodsFor:'resolving tests'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   229
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   230
testCorrectInstanceCreation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   231
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   232
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   233
    initString := 'Ljava/lang/String;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   234
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   235
    self assertFalse: (javaClassRef isResolved).
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2960
diff changeset
   236
    self assertTrue: (javaClassRef resolvedValue isNil).
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   237
    self assertTrue: (javaClassRef name = initString).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   238
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   239
    "Created: / 08-04-2011 / 14:01:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   240
    "Modified: / 23-05-2011 / 17:58:08 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2960
diff changeset
   241
    "Modified: / 31-01-2014 / 09:12:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   242
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   243
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   244
testCorrectResolving
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   245
    | javaClassRef  initString  result  expectedResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   246
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   247
    initString := 'Ljava/lang/String;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   248
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   249
    javaClassRef owner: (Java classForName: 'java.lang.Object').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   250
    expectedResult := Java classForName: 'java.lang.String'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   251
    result := javaClassRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   252
    self assertTrue: (result = expectedResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   253
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   254
    "Created: / 08-04-2011 / 14:07:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   255
    "Modified: / 23-05-2011 / 17:58:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   256
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   257
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   258
testInvalidation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   259
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   260
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   261
    initString := 'Ljava/lang/String;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   262
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   263
    javaClassRef owner: (Java classForName: 'java.lang.Object').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   264
    self assertTrue: (javaClassRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   265
    javaClassRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   266
    self assertTrue: (javaClassRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   267
    javaClassRef invalidate.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   268
    self assertTrue: (javaClassRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   269
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   270
    "Created: / 08-04-2011 / 14:09:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   271
    "Modified: / 23-05-2011 / 17:58:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   272
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   273
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   274
testInvalidationForClassNegative
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   275
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   276
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   277
    initString := 'Ljava/lang/String;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   278
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   279
    javaClassRef owner: (Java classForName: 'java.lang.Object').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   280
    self assertTrue: (javaClassRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   281
    javaClassRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   282
    self assertTrue: (javaClassRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   283
    javaClassRef invalidateForClass: 'Ljava/lang/Object;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   284
    self assertTrue: (javaClassRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   285
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   286
    "Created: / 08-04-2011 / 16:21:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   287
    "Modified: / 23-05-2011 / 17:58:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   288
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   289
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   290
testInvalidationForClassPositive
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   291
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   292
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   293
    initString := 'Ljava/lang/String;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   294
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   295
    javaClassRef owner: (Java classForName: 'java.lang.Object').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   296
    self assertTrue: (javaClassRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   297
    javaClassRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   298
    self assertTrue: (javaClassRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   299
    javaClassRef invalidateForClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   300
    self assertTrue: (javaClassRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   301
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   302
    "Created: / 08-04-2011 / 16:21:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   303
    "Modified: / 23-05-2011 / 17:57:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   304
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   305
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   306
testResolving
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   307
    | javaClassRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   308
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   309
    initString := 'Ljava/lang/String;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   310
    javaClassRef := self getClassRefNamed: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   311
    javaClassRef owner: (Java classForName: 'java.lang.Object').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   312
    self assertTrue: (javaClassRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   313
    javaClassRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   314
    self assertTrue: (javaClassRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   315
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   316
    "Created: / 08-04-2011 / 14:04:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   317
    "Modified: / 23-05-2011 / 17:57:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   318
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   319
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   320
!JavaClassRefTests class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   321
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   322
version_CVS
3412
df11bb428463 Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3360
diff changeset
   323
    ^ '$Header: /cvs/stx/stx/libjava/JavaClassRefTests.st,v 1.6 2015-03-20 12:07:59 vrany Exp $'
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   324
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   325
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   326
version_HG
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   327
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   328
    ^ '$Changeset: <not expanded> $'
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   329
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   330
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   331
version_SVN
2731
13f5be2bf83b Merged d87e89dd5276 and fe83a843a7bf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2711 2678
diff changeset
   332
    ^ 'Id'
2152
1cbdfbcc685c Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 749
diff changeset
   333
! !
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   334