JavaInterfaceMethodRefTests.st
author Claus Gittinger <cg@exept.de>
Wed, 26 Jun 2019 22:06:15 +0200
branchcvs_MAIN
changeset 3917 94088b7097d5
parent 3412 df11bb428463
permissions -rw-r--r--
#OTHER by cg +bracketStrings
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: 2992
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: 2992
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:#JavaInterfaceMethodRefTests
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
!JavaInterfaceMethodRefTests 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: 2992
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: 2992
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
!JavaInterfaceMethodRefTests methodsFor:'javaInterfaceMethodRef tests'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    59
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    60
testCorrectInstanceCreation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    61
    | initString  javaMethodRef |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    62
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    63
    initString := 'Ljava/lang/Runnable;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    64
    javaMethodRef := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    65
                getInterfaceMethodRefNamed: 'run'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    66
                typed: '()V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    67
                inClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    68
    self assertTrue: (javaMethodRef isResolved not).
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
    69
    self assertTrue: (javaMethodRef resolvedValue isNil).
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    70
    self assertTrue: (javaMethodRef name = 'run').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    71
    self assertTrue: (javaMethodRef descriptor = '()V').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    72
    self assertTrue: (javaMethodRef classRef name = 'Ljava/lang/Runnable;').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    73
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    74
    "Created: / 08-04-2011 / 14:01:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    75
    "Modified: / 23-05-2011 / 17:19:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2992
732f9db2a195 Cleanup & refactoring of constant pool references (JavaRef2 hierarchy)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
    76
    "Modified: / 31-01-2014 / 09:13:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    77
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    78
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    79
testCorrectResolving
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    80
    | initString  javaMethodRef  expectedResult  result |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    81
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    82
    initString := 'Ljava/lang/Runnable;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    83
    javaMethodRef := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    84
                getInterfaceMethodRefNamed: 'run'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    85
                typed: '()V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    86
                inClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    87
    result := javaMethodRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    88
    expectedResult := (Java classForName: 'java.lang.Runnable') 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    89
                methodDictionary at: #'run()V'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    90
    self assertTrue: (result = expectedResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    91
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    92
    "Created: / 08-04-2011 / 14:07:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    93
    "Modified: / 23-05-2011 / 17:18:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
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
testInvalidation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    97
    | javaMethodRef  initString|
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    98
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    99
   initString :='Ljava/lang/Runnable;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   100
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   101
    javaMethodRef := javaMethodRef := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   102
                getInterfaceMethodRefNamed: 'run'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   103
                typed: '()V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   104
                inClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   105
    self assertTrue: (javaMethodRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   106
    javaMethodRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   107
    self assertTrue: (javaMethodRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   108
    self assertTrue: (javaMethodRef classRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   109
    javaMethodRef invalidate.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   110
    self assertTrue: (javaMethodRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   111
    self assertTrue: (javaMethodRef classRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   112
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   113
    "Created: / 08-04-2011 / 14:09:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   114
    "Modified: / 23-05-2011 / 17:19:45 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   115
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   116
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   117
testInvalidationForClassNegative
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   118
    | javaMethodRef  initString|
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   119
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   120
    initString :='Ljava/lang/Runnable;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   121
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   122
    javaMethodRef := javaMethodRef := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   123
                getInterfaceMethodRefNamed: 'run'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   124
                typed: '()V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   125
                inClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   126
    self assertTrue: (javaMethodRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   127
    javaMethodRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   128
    self assertTrue: (javaMethodRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   129
    self assertTrue: (javaMethodRef classRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   130
    javaMethodRef invalidateForClass: 'Ljava/lang/Object;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   131
    self assertTrue: (javaMethodRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   132
    self assertTrue: (javaMethodRef classRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   133
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   134
    "Created: / 08-04-2011 / 16:23:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   135
    "Modified: / 23-05-2011 / 17:20:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   136
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   137
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   138
testInvalidationForClassPositive
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   139
    | javaMethodRef  initString|
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   140
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   141
    initString :='Ljava/lang/Runnable;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   142
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   143
    javaMethodRef := javaMethodRef := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   144
                getInterfaceMethodRefNamed: 'run'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   145
                typed: '()V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   146
                inClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   147
    self assertTrue: (javaMethodRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   148
    javaMethodRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   149
    self assertTrue: (javaMethodRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   150
    self assertTrue: (javaMethodRef classRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   151
    javaMethodRef invalidateForClass: 'Ljava/lang/Runnable;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   152
    self assertTrue: (javaMethodRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   153
    self assertTrue: (javaMethodRef classRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   154
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   155
    "Created: / 08-04-2011 / 16:23:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   156
    "Modified: / 23-05-2011 / 17:20:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   157
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   158
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   159
testResolving
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   160
    | javaMethodRef  initString|
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   161
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   162
     initString :='Ljava/lang/Runnable;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   163
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   164
    javaMethodRef := javaMethodRef := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   165
                getInterfaceMethodRefNamed: 'run'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   166
                typed: '()V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   167
                inClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   168
    self assertTrue: (javaMethodRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   169
    javaMethodRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   170
    self assertTrue: (javaMethodRef classRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   171
    self assertTrue: (javaMethodRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   172
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   173
    "Created: / 08-04-2011 / 14:04:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   174
    "Modified: / 23-05-2011 / 17:21:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   175
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   176
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   177
!JavaInterfaceMethodRefTests methodsFor:'permission tests'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   178
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   179
testAccessingPublicFromSubclass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   180
    | javaMethodRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   181
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   182
    initString := 'Lstx/libjava/tests/mocks/PublicClass;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   183
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   184
        should: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   185
            [ javaMethodRef := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   186
                        getInterfaceMethodRefNamed: 'publicMethod'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   187
                        typed: '()Ljava/lang/String;'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   188
                        inClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   189
            javaMethodRef resolve. ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   190
        raise: Error
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   191
        suchThat: [:e | e messageText = 'IncompatibleClassChangeError' ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   192
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   193
    "Created: / 13-04-2011 / 14:49:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   194
    "Modified: / 23-05-2011 / 17:54:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   195
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   196
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   197
!JavaInterfaceMethodRefTests class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   198
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
   199
version_CVS
3412
df11bb428463 Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3360
diff changeset
   200
    ^ '$Header: /cvs/stx/stx/libjava/JavaInterfaceMethodRefTests.st,v 1.6 2015-03-20 12:08:00 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
   201
!
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
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
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
   204
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
    ^ '$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
   206
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
   207
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   208
version_SVN
2731
13f5be2bf83b Merged d87e89dd5276 and fe83a843a7bf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2711 2678
diff changeset
   209
    ^ 'Id'
2152
1cbdfbcc685c Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 749
diff changeset
   210
! !
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
   211