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

test[jx8-android] 010 - Call static methods


"test static calls"
self print: 'System currentTimeMillis=' ,JavaSystem currentTimeMillis.


"test method does not exists (sync)"
[ Java current
	callStaticMethodSync: 'java.lang.System'
	method: #badMethod
] on: Error do: [^#ok].
self error: 'This should not happen'


"test method does not exists (aSync)"
Java current
	callStaticMethod: 'java.lang.System'
	method: #badMethod
	callback: [:err :result|
		err isNil ifTrue: [ self error: 'This should not happen(Async)' ]
	]


"test static calls single argument"
self print: 'System os.version='
	,(JavaSystem getProperty: 'os.version').