tests/jni: Test for basic object operations.
This commit is contained in:
parent
805c6534f8
commit
9a334d41e3
16
tests/jni/object.py
Normal file
16
tests/jni/object.py
Normal file
@ -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)
|
3
tests/jni/object.py.exp
Normal file
3
tests/jni/object.py.exp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
42
|
||||||
|
42
|
||||||
|
42
|
Loading…
x
Reference in New Issue
Block a user