Added JavaExceptionTests jk_new_structure
authorvranyj1
Fri, 30 Mar 2012 13:38:40 +0000
branchjk_new_structure
changeset 1440 3737a6150f96
parent 1439 3464e66fae36
child 1441 0faa0f8eda0c
Added JavaExceptionTests
src/JavaExceptionTests.st
src/Make.proto
src/Make.spec
src/abbrev.stc
src/bc.mak
src/libjava.rc
src/stx_libjava.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/JavaExceptionTests.st	Fri Mar 30 13:38:40 2012 +0000
@@ -0,0 +1,166 @@
+"
+ COPYRIGHT (c) 1996-2011 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
+                            SWING Research Group, Czech Technical University in Prague
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+
+ [1] Code written at SWING Research Group contains a signature
+     of one of the above copright owners. For exact set of such code,
+     see the differences between this version and version stx:libjava
+     as of 1.9.2010
+"
+"{ Package: 'stx:libjava' }"
+
+TestCase subclass:#JavaExceptionTests
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Languages-Java-Tests'
+!
+
+!JavaExceptionTests class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 1996-2011 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
+                            SWING Research Group, Czech Technical University in Prague
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+
+ [1] Code written at SWING Research Group contains a signature
+     of one of the above copright owners. For exact set of such code,
+     see the differences between this version and version stx:libjava
+     as of 1.9.2010
+
+"
+! !
+
+!JavaExceptionTests class methodsFor:'accessing'!
+
+resources
+
+  ^ Array 
+        with: JavaInitializedResource 
+        with: JavaLibrariesResource
+        with: JavaTestsResource
+
+    "Created: / 30-03-2012 / 13:38:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaExceptionTests methodsFor:'tests'!
+
+test_01a
+    "
+    Scenario (method activation stack, last called at bottom)
+        1) ST method, handles IllegalArgumentException
+        2) Java method, throws IllegalArgumentException.
+    "
+
+    | thrower caught |
+    thrower := JAVA stx libjava tests SimpleExceptionThrower new.
+    [ 
+        thrower throw_me: true.
+        caught := false.
+        
+    ] on: JAVA java lang IllegalArgumentException do: [:ex|
+        caught := true.
+    ].
+
+    self assert: caught == true
+
+    "Created: / 18-03-2012 / 11:06:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_01b
+    "
+    Scenario (method activation stack, last called at bottom)
+        1) ST method, handles IllegalArgumentException
+        2) Java method, does not IllegalArgumentException.
+    "
+
+    | thrower caught |
+    thrower := JAVA stx libjava tests SimpleExceptionThrower new.
+    [ 
+        thrower throw_me: false.
+        caught := false.
+        
+    ] on: JAVA java lang IllegalArgumentException do: [:ex|
+        caught := true.
+    ].
+
+    self assert: caught == false
+
+    "Created: / 18-03-2012 / 21:49:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_01c
+    "
+    Scenario (method activation stack, last called at bottom)
+        1) ST method, handles IllegalArgumentException
+        2) Java method, does not IllegalArgumentException.
+    "
+
+    | thrower caught |
+    thrower := JAVA stx libjava tests SimpleExceptionThrower new.
+    [ 
+        thrower throw_me: true.
+        caught := false.
+        
+    ] on: JAVA java lang Throwable do: [:ex|
+        caught := true.
+    ].
+
+    self assert: caught == true
+
+    "Created: / 18-03-2012 / 22:11:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_01d
+    "
+    Scenario (method activation stack, last called at bottom)
+        1) ST method, handles IllegalArgumentException
+        2) Java method, does not IllegalArgumentException.
+    "
+
+    | thrower caught |
+    thrower := JAVA stx libjava tests SimpleExceptionThrower new.
+    [
+        [ 
+            thrower throw_me: true.
+            caught := false.
+            
+        ] on: JAVA java lang ArrayIndexOutOfBoundsException do: [:ex|
+            caught := true.
+        ].
+    ] on: JavaUnhandledExceptionError do:[
+        caught := 123.
+    ].
+
+    self assert: caught == 123
+
+    "Created: / 18-03-2012 / 22:12:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaExceptionTests class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- a/src/Make.proto	Thu Mar 29 18:16:01 2012 +0000
+++ b/src/Make.proto	Fri Mar 30 13:38:40 2012 +0000
@@ -1,7 +1,7 @@
 # $Header$
 #
 # DO NOT EDIT
-# automagically generated from the projectDefinition: stx_libjava at 2012-03-29 19:14:03.188.
+# automagically generated from the projectDefinition: stx_libjava at 2012-03-30 14:39:23.328.
 #
 # Warning: once you modify this file, do not rerun
 # stmkmp or projectDefinition-build again - otherwise, your changes are lost.
--- a/src/Make.spec	Thu Mar 29 18:16:01 2012 +0000
+++ b/src/Make.spec	Fri Mar 30 13:38:40 2012 +0000
@@ -1,7 +1,7 @@
 # $Header$
 #
 # DO NOT EDIT
-# automagically generated from the projectDefinition: stx_libjava at 2012-03-29 19:14:01.210.
+# automagically generated from the projectDefinition: stx_libjava at 2012-03-30 14:39:21.696.
 #
 # Warning: once you modify this file, do not rerun
 # stmkmp or projectDefinition-build again - otherwise, your changes are lost.
--- a/src/abbrev.stc	Thu Mar 29 18:16:01 2012 +0000
+++ b/src/abbrev.stc	Fri Mar 30 13:38:40 2012 +0000
@@ -140,3 +140,4 @@
 ProxyMethodJavaFieldAccessor ProxyMethodJavaFieldAccessor stx:libjava 'Languages-Java-Interop' 0
 ProxyMethodJavaFieldGetter ProxyMethodJavaFieldGetter stx:libjava 'Languages-Java-Interop' 0
 ProxyMethodJavaFieldSetter ProxyMethodJavaFieldSetter stx:libjava 'Languages-Java-Interop' 0
+JavaExceptionTests JavaExceptionTests stx:libjava 'Languages-Java-Tests' 1
--- a/src/bc.mak	Thu Mar 29 18:16:01 2012 +0000
+++ b/src/bc.mak	Fri Mar 30 13:38:40 2012 +0000
@@ -1,7 +1,7 @@
 # $Header$
 #
 # DO NOT EDIT
-# automagically generated from the projectDefinition: stx_libjava at 2012-03-29 19:14:03.889.
+# automagically generated from the projectDefinition: stx_libjava at 2012-03-30 14:39:24.099.
 #
 # Warning: once you modify this file, do not rerun
 # stmkmp or projectDefinition-build again - otherwise, your changes are lost.
--- a/src/libjava.rc	Thu Mar 29 18:16:01 2012 +0000
+++ b/src/libjava.rc	Fri Mar 30 13:38:40 2012 +0000
@@ -3,7 +3,7 @@
 // automagically generated from the projectDefinition: stx_libjava.
 //
 VS_VERSION_INFO VERSIONINFO
-  FILEVERSION     6,2,1787,1787
+  FILEVERSION     6,2,1791,1791
   PRODUCTVERSION  6,2,1,1
 #if (__BORLANDC__)
   FILEFLAGSMASK   VS_FF_DEBUG | VS_FF_PRERELEASE
@@ -20,12 +20,12 @@
     BEGIN
       VALUE "CompanyName", "eXept Software AG\0"
       VALUE "FileDescription", "Smalltalk/X Class library (LIB)\0"
-      VALUE "FileVersion", "6.2.1787.1787\0"
+      VALUE "FileVersion", "6.2.1791.1791\0"
       VALUE "InternalName", "stx:libjava\0"
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\nCopyright Jan Vrany, Jan Kurs and Marcel Hlopko\b          SWING Research Group, Czech Technical University In Prague\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.1.1\0"
-      VALUE "ProductDate", "Thu, 29 Mar 2012 18:14:24 GMT\0"
+      VALUE "ProductDate", "Fri, 30 Mar 2012 13:39:43 GMT\0"
     END
 
   END
--- a/src/stx_libjava.st	Thu Mar 29 18:16:01 2012 +0000
+++ b/src/stx_libjava.st	Fri Mar 30 13:38:40 2012 +0000
@@ -160,17 +160,17 @@
 
     ^ #(
         #'squeak:petitparser'
-        #'stx:goodies/sunit'    "TestAsserter - superclass of JavaTestsResource "
-        #'stx:libbasic'    "Behavior - superclass of GroovyClass "
-        #'stx:libbasic2'    "BitArray - superclass of extended BooleanArray "
+        #'stx:goodies/sunit'    "TestCase - superclass of JavaByteCodeProcessorTests "
+        #'stx:libbasic'    "PeekableStream - superclass of JavaSocket "
+        #'stx:libbasic2'    "UnboxedIntegerArray - superclass of extended WordArray "
         #'stx:libbasic3'    "WrappedMethod - extended "
-        #'stx:libcomp'    "ObjectFileLoader - referenced by JavaVM class>>_Runtime_loadFileInternalI: "
+        #'stx:libcomp'    "ReturnNode - referenced by ProxyMethodCompiler>>generate "
         #'stx:libhtml'    "URL - referenced by JavaEmbeddedFrameView>>setupAppletFrameIn:initializeJava: "
         #'stx:libtool'    "WorkspaceApplication - referenced by GroovyEvaluator>>evaluate:in:receiver:notifying:logged:ifFail: "
-        #'stx:libview'    "GraphicsMedium - superclass of JavaPopUpView "
-        #'stx:libview2'    "Plug - referenced by JavaSourceCodeCache>>findMethodLine:inMethods: "
-        #'stx:libwidg'    "FileSelectionBox - referenced by Java class>>javaProcessForMainOf:argumentString: "
-        #'stx:libwidg2'    "CheckBox - referenced by JavaVM class>>_WCheckboxPeer_create: "
+        #'stx:libview'    "DeviceGraphicsContext - superclass of JavaView "
+        #'stx:libview2'    "GIFReader - referenced by JavaVM class>>_GifImageDecoder_parseImage: "
+        #'stx:libwidg'    "HorizontalScrollBar - referenced by JavaVM class>>_WScrollPanePeer__getHScrollbarHeight: "
+        #'stx:libwidg2'    "ComboListView - referenced by JavaVM class>>_WChoicePeer_create: "
     )
 ! !
 
@@ -396,7 +396,10 @@
         ProxyMethodJavaFieldAccessor
         ProxyMethodJavaFieldGetter
         ProxyMethodJavaFieldSetter
+        (JavaExceptionTests autoload)
     )
+
+    "Modified: / 30-03-2012 / 14:39:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 extensionMethodNames