[Jython-checkins] jython: Merge test_javalist into test_jbasic.
frank.wierzbicki
jython-checkins at python.org
Fri May 20 05:12:18 CEST 2011
http://hg.python.org/jython/rev/ebbe7b0253e9
changeset: 6227:ebbe7b0253e9
user: Frank Wierzbicki <fwierzbicki at gmail.com>
date: Thu May 19 08:24:50 2011 -0700
summary:
Merge test_javalist into test_jbasic.
files:
Lib/test/test_javalist.py | 52 ---------------------------
Lib/test/test_jbasic.py | 44 ++++++++++++++++++++++
2 files changed, 44 insertions(+), 52 deletions(-)
diff --git a/Lib/test/test_javalist.py b/Lib/test/test_javalist.py
deleted file mode 100644
--- a/Lib/test/test_javalist.py
+++ /dev/null
@@ -1,52 +0,0 @@
-from javatests import ListTest
-
-class PyListTest(ListTest):
-
- def __init__(self):
- ListTest.__init__(self)
-
- def newInstance(self, coll):
- if coll is None:
- return list()
- else:
- return list(coll)
-
- def isReadOnly(self):
- return False
-
-
-class PyTupleTest(ListTest):
-
- def __init__(self):
- ListTest.__init__(self)
-
- def newInstance(self, coll):
- if coll is None:
- return tuple()
- else:
- return tuple(coll)
-
- def isReadOnly(self):
- return True
-
-
-# these first two tests just verify that we have a good unit test
-print "ListTest.java driver (test_javalist.py)"
-print "running test on ArrayList"
-alt = ListTest.getArrayListTest(False)
-alt.testAll()
-
-print "running test on ArrayList (read-only)"
-alt = ListTest.getArrayListTest(True)
-alt.testAll()
-
-
-# Now run the critical tests
-
-print "running test on PyListTest"
-plt = PyListTest()
-plt.testAll()
-
-print "running test on PyTupleTest"
-ptt = PyTupleTest()
-ptt.testAll()
diff --git a/Lib/test/test_jbasic.py b/Lib/test/test_jbasic.py
--- a/Lib/test/test_jbasic.py
+++ b/Lib/test/test_jbasic.py
@@ -10,6 +10,37 @@
from java.util import Vector
from javax import swing
+from javatests import ListTest
+
+class PyListTest(ListTest):
+
+ def __init__(self):
+ ListTest.__init__(self)
+
+ def newInstance(self, coll):
+ if coll is None:
+ return list()
+ else:
+ return list(coll)
+
+ def isReadOnly(self):
+ return False
+
+
+class PyTupleTest(ListTest):
+
+ def __init__(self):
+ ListTest.__init__(self)
+
+ def newInstance(self, coll):
+ if coll is None:
+ return tuple()
+ else:
+ return tuple(coll)
+
+ def isReadOnly(self):
+ return True
+
class JythonBasicTests(unittest.TestCase):
@@ -135,6 +166,19 @@
x = javatests.AnonInner()
self.assertEquals(x.doit(), 2000)
+ def test_javalists(self):
+ # these first two tests just verify that we have a good unit test
+ alt = ListTest.getArrayListTest(False)
+ alt.testAll()
+
+ alt = ListTest.getArrayListTest(True)
+ alt.testAll()
+
+ # Now run the tests
+ plt = PyListTest()
+ plt.testAll()
+ ptt = PyTupleTest()
+ ptt.testAll()
def test_main():
test_support.run_unittest(JythonBasicTests)
--
Repository URL: http://hg.python.org/jython
More information about the Jython-checkins
mailing list