From: <fwi...@us...> - 2008-10-16 20:34:41
|
Revision: 5444 http://jython.svn.sourceforge.net/jython/?rev=5444&view=rev Author: fwierzbicki Date: 2008-10-16 20:34:32 +0000 (Thu, 16 Oct 2008) Log Message: ----------- better name for test method. Modified Paths: -------------- trunk/jython/Lib/test/test_java_integration.py Modified: trunk/jython/Lib/test/test_java_integration.py =================================================================== --- trunk/jython/Lib/test/test_java_integration.py 2008-10-16 20:32:40 UTC (rev 5443) +++ trunk/jython/Lib/test/test_java_integration.py 2008-10-16 20:34:32 UTC (rev 5444) @@ -399,7 +399,7 @@ class JavaStringTest(unittest.TestCase): - def test_override(self): + def test_string_not_iterable(self): from java import lang x = lang.String('test') try: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cg...@us...> - 2008-10-16 21:00:03
|
Revision: 5446 http://jython.svn.sourceforge.net/jython/?rev=5446&view=rev Author: cgroves Date: 2008-10-16 20:59:53 +0000 (Thu, 16 Oct 2008) Log Message: ----------- Use assertRaises instead of try: code except ExpectedException: pass else: self.fail Modified Paths: -------------- trunk/jython/Lib/test/test_java_integration.py Modified: trunk/jython/Lib/test/test_java_integration.py =================================================================== --- trunk/jython/Lib/test/test_java_integration.py 2008-10-16 20:36:11 UTC (rev 5445) +++ trunk/jython/Lib/test/test_java_integration.py 2008-10-16 20:59:53 UTC (rev 5446) @@ -130,10 +130,7 @@ self.assertRaises(TypeError, A) def test_no_public_constructors(self): - try: - Math() - except TypeError, e: - self.assert_("no public constructors for" in str(e)) + self.assertRaises(TypeError, Math) class PyObjectCmpTest(unittest.TestCase): @@ -150,21 +147,12 @@ def test_io_errors(self): "Check that IOException isn't mangled into an IOError" from java.io import UnsupportedEncodingException - try: - x = OutputStreamWriter(System.out, "garbage") - except UnsupportedEncodingException: - pass - else: - self.fail("Should have raised java.io.UnsupportedEncodingException") + self.assertRaises(UnsupportedEncodingException, OutputStreamWriter, + System.out, "garbage") def test_fileio_error(self): - from java.io import FileInputStream, IOException - try: - stream = FileInputStream("garbage") - except IOException: - pass - else: - self.fail("Should raise java.io.IOException") + from java.io import FileInputStream, FileNotFoundException + self.assertRaises(FileNotFoundException, FileInputStream, "garbage") class VectorTest(unittest.TestCase): @@ -329,11 +317,8 @@ class ImportTest(unittest.TestCase): def test_bad_input_exception(self): - try: - __import__('') - except ValueError, e: - self.assert_("Empty module name" in str(e)) - + self.assertRaises(ValueError, __import__, '') + class ButtonTest(unittest.TestCase): def test_setLabel(self): @@ -402,12 +387,7 @@ def test_string_not_iterable(self): from java import lang x = lang.String('test') - try: - list(x) - except TypeError: - pass - else: - self.fail("Should have raised TypeError") + self.assertRaises(TypeError, list, x) def test_main(): test_support.run_unittest(AbstractOnSyspathTest, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cg...@us...> - 2008-12-22 03:30:01
|
Revision: 5787 http://jython.svn.sourceforge.net/jython/?rev=5787&view=rev Author: cgroves Date: 2008-12-22 03:29:57 +0000 (Mon, 22 Dec 2008) Log Message: ----------- Move the test for assigning on top of a Java method to a class that doesn't cause a headless exception; don't worry about the message, just check that the TypeError is raised Modified Paths: -------------- trunk/jython/Lib/test/test_java_integration.py Modified: trunk/jython/Lib/test/test_java_integration.py =================================================================== --- trunk/jython/Lib/test/test_java_integration.py 2008-12-22 03:21:46 UTC (rev 5786) +++ trunk/jython/Lib/test/test_java_integration.py 2008-12-22 03:29:57 UTC (rev 5787) @@ -331,20 +331,11 @@ def test_bad_input_exception(self): self.assertRaises(ValueError, __import__, '') -class ButtonTest(unittest.TestCase): - - def test_setLabel(self): - try: - b = Button() - except HeadlessException: - return # can't raise TestSkipped - try: - b.setLabel = 4 - except TypeError, e: - self.failUnless("can't assign to this attribute in java instance: setLabel" in str(e)) - class ColorTest(unittest.TestCase): + def test_assigning_over_method(self): + self.assertRaises(TypeError, setattr, Color.RED, "getRGB", 4) + def test_static_fields(self): self.assertEquals(Color(255, 0, 0), Color.RED) # The bean accessor for getRed should be active on instances, but the static field red @@ -468,7 +459,6 @@ JavaReservedNamesTest, PyReservedNamesTest, ImportTest, - ButtonTest, ColorTest, TreePathTest, BigDecimalTest, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2009-05-31 14:50:49
|
Revision: 6434 http://jython.svn.sourceforge.net/jython/?rev=6434&view=rev Author: otmarhumbel Date: 2009-05-31 14:50:48 +0000 (Sun, 31 May 2009) Log Message: ----------- quote the policy file if it contains spaces Modified Paths: -------------- trunk/jython/Lib/test/test_java_integration.py Modified: trunk/jython/Lib/test/test_java_integration.py =================================================================== --- trunk/jython/Lib/test/test_java_integration.py 2009-05-31 03:26:57 UTC (rev 6433) +++ trunk/jython/Lib/test/test_java_integration.py 2009-05-31 14:50:48 UTC (rev 6434) @@ -411,6 +411,9 @@ # script must lie within python.home for this test to work return policy = test_support.findfile("python_home.policy") + if len(policy.split(' ')) > 1: + # quote the policy file if it contains spaces + policy = '"%s"' % policy self.assertEquals(subprocess.call([sys.executable, "-J-Dpython.cachedir.skip=true", "-J-Djava.security.manager", "-J-Djava.security.policy=%s" % policy, script]), 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2009-06-02 08:23:01
|
Revision: 6438 http://jython.svn.sourceforge.net/jython/?rev=6438&view=rev Author: otmarhumbel Date: 2009-06-02 08:23:00 +0000 (Tue, 02 Jun 2009) Log Message: ----------- rollback to 6418, due to a regression in hudson all Modified Paths: -------------- trunk/jython/Lib/test/test_java_integration.py Modified: trunk/jython/Lib/test/test_java_integration.py =================================================================== --- trunk/jython/Lib/test/test_java_integration.py 2009-06-01 04:46:45 UTC (rev 6437) +++ trunk/jython/Lib/test/test_java_integration.py 2009-06-02 08:23:00 UTC (rev 6438) @@ -411,9 +411,6 @@ # script must lie within python.home for this test to work return policy = test_support.findfile("python_home.policy") - if len(policy.split(' ')) > 1: - # quote the policy file if it contains spaces - policy = '"%s"' % policy self.assertEquals(subprocess.call([sys.executable, "-J-Dpython.cachedir.skip=true", "-J-Djava.security.manager", "-J-Djava.security.policy=%s" % policy, script]), 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2010-04-10 20:48:41
|
Revision: 7014 http://jython.svn.sourceforge.net/jython/?rev=7014&view=rev Author: pjenvey Date: 2010-04-10 20:48:35 +0000 (Sat, 10 Apr 2010) Log Message: ----------- just skip this for now on Windows so the buildbot is happy Modified Paths: -------------- trunk/jython/Lib/test/test_java_integration.py Modified: trunk/jython/Lib/test/test_java_integration.py =================================================================== --- trunk/jython/Lib/test/test_java_integration.py 2010-04-10 19:47:19 UTC (rev 7013) +++ trunk/jython/Lib/test/test_java_integration.py 2010-04-10 20:48:35 UTC (rev 7014) @@ -420,6 +420,9 @@ class SecurityManagerTest(unittest.TestCase): def test_nonexistent_import_with_security(self): + if os._name == 'nt': + # http://bugs.jython.org/issue1371 + return script = test_support.findfile("import_nonexistent.py") home = os.path.realpath(sys.prefix) if not os.path.commonprefix((home, os.path.realpath(script))) == home: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2010-04-25 18:33:40
|
Revision: 7046 http://jython.svn.sourceforge.net/jython/?rev=7046&view=rev Author: zyasoft Date: 2010-04-25 18:33:34 +0000 (Sun, 25 Apr 2010) Log Message: ----------- Remove leftover semicolons from translating Java to Python Modified Paths: -------------- trunk/jython/Lib/test/test_java_integration.py Modified: trunk/jython/Lib/test/test_java_integration.py =================================================================== --- trunk/jython/Lib/test/test_java_integration.py 2010-04-25 17:46:34 UTC (rev 7045) +++ trunk/jython/Lib/test/test_java_integration.py 2010-04-25 18:33:34 UTC (rev 7046) @@ -499,12 +499,11 @@ class CloneInput(ObjectInputStream): def __init__(self, input, output): - ObjectInputStream.__init__(self, input); - self.output = output; + ObjectInputStream.__init__(self, input) + self.output = output def resolveClass(self, obj_stream_class): - c = self.output.classQueue.popleft() - return c + return self.output.classQueue.popleft() def resolveProxyClass(self, interfaceNames): return self.output.classQueue.popleft() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2010-08-14 18:53:04
|
Revision: 7092 http://jython.svn.sourceforge.net/jython/?rev=7092&view=rev Author: zyasoft Date: 2010-08-14 18:52:58 +0000 (Sat, 14 Aug 2010) Log Message: ----------- Some additional testing of serializability of Jython builtin functions. This was intended for #1604, but actually not necessary. Modified Paths: -------------- trunk/jython/Lib/test/test_java_integration.py Modified: trunk/jython/Lib/test/test_java_integration.py =================================================================== --- trunk/jython/Lib/test/test_java_integration.py 2010-08-14 18:51:36 UTC (rev 7091) +++ trunk/jython/Lib/test/test_java_integration.py 2010-08-14 18:52:58 UTC (rev 7092) @@ -525,7 +525,13 @@ serialized_code = roundtrip_serialization(universal_answer.func_code) self.assertEqual(eval(serialized_code), universal_answer()) + def test_builtin_names(self): + import __builtin__ + names = [x for x in dir(__builtin__)] + self.assertEqual(names, roundtrip_serialization(names)) + + class CopyTest(unittest.TestCase): def test_copy(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |