JavaInterfaceMethodRefTests.st
author Stefan Vogel <sv@exept.de>
Thu, 25 Apr 2013 15:09:57 +0200
changeset 2552 f4c15588965e
parent 2396 fadc6d7a2f5b
child 2429 ebece4dcaab9
child 2678 c865275e48a7
permissions -rw-r--r--
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
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
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
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     6
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
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
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
    23
JavaRefsAndConstantPoolTestCase subclass:#JavaInterfaceMethodRefTests
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    24
	instanceVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    25
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    26
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    27
	category:'Languages-Java-Tests-RuntimeConstantPool'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    28
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    29
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    30
!JavaInterfaceMethodRefTests class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    31
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    32
copyright
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    33
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    34
 COPYRIGHT (c) 1996-2011 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
    35
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2152
diff changeset
    36
 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
    37
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    38
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    39
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    40
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    41
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    42
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    43
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    44
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    45
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    46
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    47
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
    48
 [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
    49
     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
    50
     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
    51
     as of 1.9.2010
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    52
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    53
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    54
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    55
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
    56
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    57
!JavaInterfaceMethodRefTests methodsFor:'javaInterfaceMethodRef tests'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    58
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    59
testCorrectInstanceCreation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    60
    | initString  javaMethodRef |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    61
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    62
    initString := 'Ljava/lang/Runnable;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    63
    javaMethodRef := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    64
                getInterfaceMethodRefNamed: 'run'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    65
                typed: '()V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    66
                inClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    67
    self assertTrue: (javaMethodRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    68
    self assertTrue: (javaMethodRef valueCache isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    69
    self assertTrue: (javaMethodRef name = 'run').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    70
    self assertTrue: (javaMethodRef descriptor = '()V').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    71
    self assertTrue: (javaMethodRef classRef name = 'Ljava/lang/Runnable;').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    72
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    73
    "Created: / 08-04-2011 / 14:01:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    74
    "Modified: / 23-05-2011 / 17:19:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    75
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    76
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    77
testCorrectResolving
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    78
    | initString  javaMethodRef  expectedResult  result |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    79
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    80
    initString := 'Ljava/lang/Runnable;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    81
    javaMethodRef := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    82
                getInterfaceMethodRefNamed: 'run'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    83
                typed: '()V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    84
                inClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    85
    result := javaMethodRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    86
    expectedResult := (Java classForName: 'java.lang.Runnable') 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    87
                methodDictionary at: #'run()V'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    88
    self assertTrue: (result = expectedResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    89
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    90
    "Created: / 08-04-2011 / 14:07:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    91
    "Modified: / 23-05-2011 / 17:18:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    92
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    93
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    94
testInvalidation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    95
    | javaMethodRef  initString|
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    96
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    97
   initString :='Ljava/lang/Runnable;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    98
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    99
    javaMethodRef := javaMethodRef := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   100
                getInterfaceMethodRefNamed: 'run'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   101
                typed: '()V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   102
                inClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   103
    self assertTrue: (javaMethodRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   104
    javaMethodRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   105
    self assertTrue: (javaMethodRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   106
    self assertTrue: (javaMethodRef classRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   107
    javaMethodRef invalidate.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   108
    self assertTrue: (javaMethodRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   109
    self assertTrue: (javaMethodRef classRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   110
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   111
    "Created: / 08-04-2011 / 14:09:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   112
    "Modified: / 23-05-2011 / 17:19:45 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   113
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   114
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   115
testInvalidationForClassNegative
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   116
    | javaMethodRef  initString|
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   117
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   118
    initString :='Ljava/lang/Runnable;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   119
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   120
    javaMethodRef := javaMethodRef := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   121
                getInterfaceMethodRefNamed: 'run'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   122
                typed: '()V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   123
                inClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   124
    self assertTrue: (javaMethodRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   125
    javaMethodRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   126
    self assertTrue: (javaMethodRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   127
    self assertTrue: (javaMethodRef classRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   128
    javaMethodRef invalidateForClass: 'Ljava/lang/Object;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   129
    self assertTrue: (javaMethodRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   130
    self assertTrue: (javaMethodRef classRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   131
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   132
    "Created: / 08-04-2011 / 16:23:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   133
    "Modified: / 23-05-2011 / 17:20:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   134
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   135
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   136
testInvalidationForClassPositive
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   137
    | javaMethodRef  initString|
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   138
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   139
    initString :='Ljava/lang/Runnable;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   140
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   141
    javaMethodRef := javaMethodRef := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   142
                getInterfaceMethodRefNamed: 'run'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   143
                typed: '()V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   144
                inClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   145
    self assertTrue: (javaMethodRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   146
    javaMethodRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   147
    self assertTrue: (javaMethodRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   148
    self assertTrue: (javaMethodRef classRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   149
    javaMethodRef invalidateForClass: 'Ljava/lang/Runnable;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   150
    self assertTrue: (javaMethodRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   151
    self assertTrue: (javaMethodRef classRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   152
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   153
    "Created: / 08-04-2011 / 16:23:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   154
    "Modified: / 23-05-2011 / 17:20:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   155
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   156
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   157
testResolving
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   158
    | javaMethodRef  initString|
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   159
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   160
     initString :='Ljava/lang/Runnable;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   161
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   162
    javaMethodRef := javaMethodRef := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   163
                getInterfaceMethodRefNamed: 'run'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   164
                typed: '()V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   165
                inClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   166
    self assertTrue: (javaMethodRef isResolved not).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   167
    javaMethodRef resolve.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   168
    self assertTrue: (javaMethodRef classRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   169
    self assertTrue: (javaMethodRef isResolved).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   170
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   171
    "Created: / 08-04-2011 / 14:04:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   172
    "Modified: / 23-05-2011 / 17:21:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   173
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   174
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
   175
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   176
!JavaInterfaceMethodRefTests methodsFor:'permission tests'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   177
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   178
testAccessingPublicFromSubclass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   179
    | javaMethodRef  initString |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   180
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   181
    initString := 'Lstx/libjava/tests/mocks/PublicClass;'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   182
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   183
        should: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   184
            [ javaMethodRef := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   185
                        getInterfaceMethodRefNamed: 'publicMethod'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   186
                        typed: '()Ljava/lang/String;'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   187
                        inClass: initString.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   188
            javaMethodRef resolve. ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   189
        raise: Error
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   190
        suchThat: [:e | e messageText = 'IncompatibleClassChangeError' ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   191
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   192
    "Created: / 13-04-2011 / 14:49:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   193
    "Modified: / 23-05-2011 / 17:54:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   194
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   195
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
   196
749
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
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
   200
    ^ '$Header: /cvs/stx/stx/libjava/JavaInterfaceMethodRefTests.st,v 1.3 2013-02-25 11:15:31 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
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
   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