JavaRefsAndConstantPoolTestCase.st
branchcvs_MAIN
changeset 3360 1a8899091305
parent 3336 08a79331ec58
child 3412 df11bb428463
--- a/JavaRefsAndConstantPoolTestCase.st	Fri Feb 14 14:27:26 2014 +0100
+++ b/JavaRefsAndConstantPoolTestCase.st	Wed Jan 28 03:12:08 2015 +0100
@@ -1,9 +1,9 @@
 "
- COPYRIGHT (c) 1996-2011 by Claus Gittinger
+ COPYRIGHT (c) 1996-2015 by Claus Gittinger
 
  New code and modifications done at SWING Research Group [1]:
 
- COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
+ COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
                             SWING Research Group, Czech Technical University in Prague
 
  This software is furnished under a license and may be used
@@ -20,6 +20,8 @@
 "
 "{ Package: 'stx:libjava' }"
 
+"{ NameSpace: Smalltalk }"
+
 TestCase subclass:#JavaRefsAndConstantPoolTestCase
 	instanceVariableNames:'exceptionThrowerBackup'
 	classVariableNames:''
@@ -38,11 +40,11 @@
 
 copyright
 "
- COPYRIGHT (c) 1996-2011 by Claus Gittinger
+ COPYRIGHT (c) 1996-2015 by Claus Gittinger
 
  New code and modifications done at SWING Research Group [1]:
 
- COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
+ COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
                             SWING Research Group, Czech Technical University in Prague
 
  This software is furnished under a license and may be used
@@ -86,10 +88,12 @@
     cp := JavaConstantPool new:2.
     cp at: 1 put: (self getClassRefIn: cp withNameAt: 2).
     cp at: 2 put: name.
+    cp do:[:ref|ref isJavaRef ifTrue:[ref preResolve]].
 
     ^ cp at: 1.
 
     "Created: / 23-05-2011 / 16:17:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 31-01-2014 / 09:11:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 getFieldRefNamed: name typed: type inClass: classString
@@ -106,9 +110,12 @@
                 getFieldRefIn: cp
                 withNameAndTypeAt: 6 andClassAt: 1).
     cp at: 6 put: (self getNameAndTypeIn: cp withNameAt: 3 andTypeAt: 4).
+    cp do:[:ref|ref isJavaRef ifTrue:[ref preResolve]].
+
     ^ cp at: 5.
 
     "Created: / 23-05-2011 / 15:56:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 31-01-2014 / 09:11:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 getInterfaceMethodRefNamed: name typed: type inClass: classString 
@@ -130,9 +137,11 @@
                 getNameAndTypeIn: cp
                 withNameAt: 3
                 andTypeAt: 4).
+    cp do:[:ref|ref isJavaRef ifTrue:[ref preResolve]].
     ^ cp at: 5.
 
     "Created: / 23-05-2011 / 16:15:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 31-01-2014 / 09:11:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 getMethodRefNamed: name typed: type inClass: classString 
@@ -154,9 +163,11 @@
                 getNameAndTypeIn: cp
                 withNameAt: 3
                 andTypeAt: 4).
+    cp do:[:ref|ref isJavaRef ifTrue:[ref preResolve]].
     ^ cp at: 5.
 
     "Created: / 23-05-2011 / 16:00:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 31-01-2014 / 09:12:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaRefsAndConstantPoolTestCase methodsFor:'helpers'!
@@ -176,7 +187,7 @@
 
 getCrateClassReadStream
     ^ ((stx_libjava packageDirectory / 'tests' ) 
-        / 'libjava' / 'bin' 
+        / 'java' / 'bin' 
         / 'stx' / 'libjava' 
         / 'tests' / 'mocks' 
         / 'Crate.class') readStream.
@@ -233,10 +244,11 @@
     "Modified: / 23-05-2011 / 15:16:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 !
 
-javaLangObject
-^Java classForName:'java.lang.Object'.
+someJavaClass
+    ^ Java classForName: 'org.junit.runners.JUnit4'.
 
     "Created: / 12-05-2011 / 19:09:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 26-01-2014 / 17:08:01 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
 ! !
 
 !JavaRefsAndConstantPoolTestCase methodsFor:'refs creation'!
@@ -245,7 +257,7 @@
     | result |
 
     result := JavaClassRef2 in: aJavaConstantPool withNameAt: nameCPIndex.
-    result owner: self javaLangObject.
+    result owner: self someJavaClass.
     ^ result.
 
     "Created: / 12-05-2011 / 19:14:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
@@ -259,7 +271,7 @@
         in: cp
         withNameAndTypeAt: nmIndex
         andClassAt: classIndex.
-result owner: self javaLangObject.
+result owner: self someJavaClass.
     ^ result.
 
     "Created: / 23-05-2011 / 16:01:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
@@ -272,7 +284,7 @@
         in: cp
         withNameAndTypeAt: nmIndex
         andClassAt: classIndex.
- result owner: self javaLangObject.
+ result owner: self someJavaClass.
     ^ result.
 
     "Created: / 23-05-2011 / 15:58:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
@@ -285,7 +297,7 @@
         in: cp
         withNameAndTypeAt: nmIndex
         andClassAt: classIndex.
- result owner: self javaLangObject.
+ result owner: self someJavaClass.
     ^ result.
 
     "Created: / 23-05-2011 / 15:58:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
@@ -298,7 +310,7 @@
         in: cp
         withNameAt: nameIndex
         andDescriptorAt: typeIndex.
- result owner: self javaLangObject.
+ result owner: self someJavaClass.
     ^ result.
 
     "Created: / 23-05-2011 / 16:00:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
@@ -325,11 +337,11 @@
 
 copyright
 "
- COPYRIGHT (c) 1996-2011 by Claus Gittinger
+ COPYRIGHT (c) 1996-2015 by Claus Gittinger
 
  New code and modifications done at SWING Research Group [1]:
 
- COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
+ COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
                             SWING Research Group, Czech Technical University in Prague
 
  This software is furnished under a license and may be used
@@ -348,7 +360,7 @@
 !
 
 version_SVN
-    ^ '§Id§'
+    ^ 'Id'
 ! !
 
 !JavaRefsAndConstantPoolTestCase::JavaExceptionThrowerMock methodsFor:'exceptions'!
@@ -397,7 +409,7 @@
 !JavaRefsAndConstantPoolTestCase class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libjava/JavaRefsAndConstantPoolTestCase.st,v 1.3 2013-09-06 00:41:26 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libjava/JavaRefsAndConstantPoolTestCase.st,v 1.4 2015-01-28 02:10:50 vrany Exp $'
 !
 
 version_HG
@@ -406,6 +418,6 @@
 !
 
 version_SVN
-    ^ '§Id§'
+    ^ 'Id'
 ! !