[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[jx8-android] 090 - Import should not crash the system

Trying to import a missing class should not crash the system.
"Importing missing classes"
| failed reason |
#(	#System
	'java.gnal.System'
	'jave.lang.System'
	'org.missing.Class'
	1234
	nil true false
) do: [:each|
	self print: '// trying to import (missing) ',each.
	[ failed := false.
	  Java current import: each ] on: Error do: [:ex|
	  failed := true.
	  reason := ex toString.
	].
	failed ifFalse: [
		^self error: 'This import must fail #',each
	].
].