More JavaExceptionTests jk_new_structure
authorvranyj1
Tue, 03 Apr 2012 14:48:01 +0000
branchjk_new_structure
changeset 1450 4817f2a363d6
parent 1449 797c2aa3bbce
child 1451 3a43baab358f
More JavaExceptionTests
src/JavaExceptionTests.st
--- a/src/JavaExceptionTests.st	Tue Apr 03 12:02:05 2012 +0000
+++ b/src/JavaExceptionTests.st	Tue Apr 03 14:48:01 2012 +0000
@@ -157,6 +157,52 @@
     self assert: caught == 123
 
     "Created: / 18-03-2012 / 22:12:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_01e
+    "
+    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 call: true.
+        caught := false.
+        
+    ] on: JAVA java lang IllegalArgumentException do: [:ex|
+        caught := true.
+    ].
+
+    self assert: caught == true
+
+    "Created: / 03-04-2012 / 14:44:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_03a
+    "
+    Scenario (method activation stack, last called at bottom)
+        1) ST method, handles IllegalArgumentException
+        2) Java method with finally
+        3) Java method, throws IllegalArgumentException.
+    "
+
+    | thrower caught |
+    thrower := JAVA stx libjava tests SimpleExceptionThrower new.
+    [ 
+        thrower test_03: true.
+        caught := false.
+        
+    ] on: JAVA java lang IllegalArgumentException do: [:ex|
+        caught := true.
+    ].
+
+    self assert: caught == true.
+    self assert: thrower token == 3.
+
+    "Created: / 03-04-2012 / 15:39:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaExceptionTests class methodsFor:'documentation'!