src/AbstractJavaTestCase.st
branchjk_new_structure
changeset 773 ff7dbe5581a3
child 774 ac54730a2b74
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/AbstractJavaTestCase.st	Thu May 12 14:28:39 2011 +0000
@@ -0,0 +1,65 @@
+"{ Package: 'stx:libjava' }"
+
+TestCase subclass:#AbstractJavaTestCase
+	instanceVariableNames:'exceptionThrowerBackup'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Languages-Java-Tests-RuntimeConstantPool'
+!
+
+
+!AbstractJavaTestCase class methodsFor:'resources'!
+
+resources
+    ^ Array with: JavaInitializedResource with: JavaTestsResource.
+
+    "Created: / 26-04-2011 / 13:03:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+! !
+
+!AbstractJavaTestCase methodsFor:'helpers'!
+
+disableMockedExceptionThrowing
+    JavaResolver uniqueInstance exceptionThrower: exceptionThrowerBackup.
+
+    "Created: / 13-04-2011 / 14:11:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+!
+
+enableMockedExceptionThrowing
+    exceptionThrowerBackup := JavaResolver uniqueInstance exceptionThrower.
+    JavaResolver uniqueInstance exceptionThrower: JavaExceptionThrowerMock new.
+
+    "Created: / 13-04-2011 / 14:11:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+!
+
+getClassRefFor: classString
+^ JavaClassRef2 in: (JavaConstantPool with: classString)
+                withNameAt: 1.
+
+    "Created: / 10-05-2011 / 15:03:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+!
+
+getCrateClassReadStream
+    ^ ((Filename named: UserPreferences current javaTestsDirectory) 
+        / 'libjava' / 'bin' 
+        / 'stx' / 'libjava' 
+        / 'tests' / 'mocks' 
+        / 'Crate.class') readStream.
+
+    "Created: / 10-05-2011 / 12:13:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 12-05-2011 / 16:26:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+!
+
+getName: name descriptor: type 
+    ^ JavaNameAndType2 
+        in: (JavaConstantPool with: name with: type)
+        withNameAt: 1
+        andDescriptorAt: 2.
+
+    "Created: / 10-05-2011 / 16:01:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+! !
+
+!AbstractJavaTestCase class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !