--- a/JavaExceptionTests.st Sun Nov 18 15:22:21 2012 +0000
+++ b/JavaExceptionTests.st Sun Nov 18 17:09:25 2012 +0000
@@ -65,13 +65,14 @@
"Created: / 30-03-2012 / 13:38:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+
!JavaExceptionTests methodsFor:'callbacks'!
-call: trhower with: aBoolean
-
- aBoolean ifTrue:[signal raise].
+call: trhower with: aBoolean
+ aBoolean ifTrue: [ signal raise ].
"Created: / 03-04-2012 / 17:33:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 18-11-2012 / 18:04:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
!
throw_me: aBoolean
@@ -150,26 +151,24 @@
test_01b
"
- Scenario (method activation stack, last called at bottom)
+ Scenario (method activation stack, last called at bottom)
1) ST method, handles IllegalArgumentException
- 2) Java method, does not IllegalArgumentException.
- "
-
- | thrower caught |
+ 2) Java method, does not IllegalArgumentException."
+
+ | thrower caught |
thrower := JAVA stx libjava tests lang ExceptionTests new.
- [
- thrower throw_me: false.
+ [
+ self halt. thrower throw_me: false.
caught := false.
-
- ] on: JAVA java lang IllegalArgumentException do: [:ex|
- caught := true.
- ].
-
+ ] on: JAVA java lang IllegalArgumentException do: [:ex | caught := true. ].
self assert: caught == false.
- self assert: (JavaVM enteredMonitorsOfProcess: Processor activeProcess) isEmptyOrNil.
- self assert: (JavaVM acquiredMonitorsOfProcess: Processor activeProcess) isEmptyOrNil.
+ self assert: (JavaVM enteredMonitorsOfProcess: Processor activeProcess)
+ isEmptyOrNil.
+ self assert: (JavaVM acquiredMonitorsOfProcess: Processor activeProcess)
+ isEmptyOrNil.
"Created: / 18-03-2012 / 21:49:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 18-11-2012 / 18:05:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
!
test_01c
@@ -250,53 +249,50 @@
test_03a
"
- Scenario (method activation stack, last called at bottom)
+ 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 |
+ 3) Java method, throws IllegalArgumentException."
+
+ | thrower caught |
thrower := JAVA stx libjava tests lang ExceptionTests new.
- [
+ [
thrower test_03: true.
caught := false.
-
- ] on: JAVA java lang IllegalArgumentException do: [:ex|
- caught := true.
- ].
-
+ ] on: JAVA java lang IllegalArgumentException do: [:ex | caught := true. ].
self assert: caught == true.
self assert: (thrower instVarNamed: #token) == 3.
- self assert: (JavaVM enteredMonitorsOfProcess: Processor activeProcess) isEmptyOrNil.
- self assert: (JavaVM acquiredMonitorsOfProcess: Processor activeProcess) isEmptyOrNil.
+ self assert: (JavaVM enteredMonitorsOfProcess: Processor activeProcess)
+ isEmptyOrNil.
+ self assert: (JavaVM acquiredMonitorsOfProcess: Processor activeProcess)
+ isEmptyOrNil.
"Created: / 03-04-2012 / 15:39:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (comment): / 18-11-2012 / 16:50:50 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
!
test_04a
"
- Scenario (method activation stack, last called at bottom)
+ Scenario (method activation stack, last called at bottom)
1) ST method, handles 'signal'
2) Java method with finally
- 3) Smalltak method, throws 'signal'
- "
-
- | thrower caught |
+ 3) Smalltak method, throws 'signal'"
+
+ | thrower caught |
thrower := JAVA stx libjava tests lang ExceptionTests new.
- [
+ [
thrower test_04: self with: true.
- caught := false.
- ] on: signal do: [:ex|
- caught := true.
- ].
-
+ caught := false.
+ ] on: signal do: [:ex | caught := true. ].
self assert: caught == true.
self assert: (thrower instVarNamed: #token) == 3.
- self assert: (JavaVM enteredMonitorsOfProcess: Processor activeProcess) isEmptyOrNil.
- self assert: (JavaVM acquiredMonitorsOfProcess: Processor activeProcess) isEmptyOrNil.
+ self assert: (JavaVM enteredMonitorsOfProcess: Processor activeProcess)
+ isEmptyOrNil.
+ self assert: (JavaVM acquiredMonitorsOfProcess: Processor activeProcess)
+ isEmptyOrNil.
"Created: / 03-04-2012 / 17:30:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 18-11-2012 / 18:04:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
! !
!JavaExceptionTests class methodsFor:'documentation'!