From 772f0b4159095baf2f073390b2bc2f8d5aab24de Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 13 Nov 2015 01:32:54 +0200 Subject: [PATCH] tests/jni: Add test for working with container of List interface. --- tests/jni/list.py | 16 ++++++++++++++++ tests/jni/list.py.exp | 4 ++++ 2 files changed, 20 insertions(+) create mode 100644 tests/jni/list.py create mode 100644 tests/jni/list.py.exp diff --git a/tests/jni/list.py b/tests/jni/list.py new file mode 100644 index 0000000000..6725abb5a0 --- /dev/null +++ b/tests/jni/list.py @@ -0,0 +1,16 @@ +import sys +import jni +try: + ArrayList = jni.cls("java/util/ArrayList") +except: + print("SKIP") + sys.exit() + +l = ArrayList() +print(l) +l.add("one") +l.add("two") + +print(l.toString()) +print(l) +print(l[0], l[1]) diff --git a/tests/jni/list.py.exp b/tests/jni/list.py.exp new file mode 100644 index 0000000000..cc34bb0a21 --- /dev/null +++ b/tests/jni/list.py.exp @@ -0,0 +1,4 @@ +[] +[one, two] +[one, two] +one two