tests/jni: Test for basic object operations.
This commit is contained in:
parent
805c6534f8
commit
9a334d41e3
|
@ -0,0 +1,16 @@
|
||||||
|
import sys
|
||||||
|
import jni
|
||||||
|
try:
|
||||||
|
Integer = jni.cls("java/lang/Integer")
|
||||||
|
except:
|
||||||
|
print("SKIP")
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
# Create object
|
||||||
|
i = Integer(42)
|
||||||
|
print(i)
|
||||||
|
# Call object method
|
||||||
|
print(i.hashCode())
|
||||||
|
# Pass object to another method
|
||||||
|
System = jni.cls("java/lang/System")
|
||||||
|
System.out.println(i)
|
|
@ -0,0 +1,3 @@
|
||||||
|
42
|
||||||
|
42
|
||||||
|
42
|
Loading…
Reference in New Issue