From: <cg...@us...> - 2008-12-29 05:45:49
|
Revision: 5804 http://jython.svn.sourceforge.net/jython/?rev=5804&view=rev Author: cgroves Date: 2008-12-29 05:45:42 +0000 (Mon, 29 Dec 2008) Log Message: ----------- test207 - Moved to test_unicode_jy test208 - Moved to test_java_visibility test209,211 - Tested by test_cpickle test210 - Tested by test_pickle test212 - Moved to test_str test213 - Tested by test_str test214,217,218,220-224,226-229,237,242,246,249,251-257 - Testing jythonc; deleted test215 - Tested by test_list test219 - Moved to org.python.tests.ExceptionTest test225 - Moved to test_grammar_jy test230,235,239,240 - Not sure what it's testing; deleted test231 - Moved to test_java_integration test232 - Moved to test_java_visibility test233 - Tested by test_import_jy test234 - Tested by test_copy test238 - Was already disabled; deleted test245 - Tested by org.python.util.InterpreterTest test247 - Moved to test_java_integration test248 - Dupe of test247 test250 - Moved to test_java_visibility test258 - Tested by test_import_jy Modified Paths: -------------- trunk/jython/Lib/test/string_tests.py trunk/jython/Lib/test/test_grammar_jy.py trunk/jython/Lib/test/test_java_integration.py trunk/jython/Lib/test/test_java_visibility.py trunk/jython/Lib/test/test_unicode_jy.py trunk/jython/bugtests/test230.py trunk/jython/src/org/python/core/PyArray.java trunk/jython/src/org/python/core/PyJavaType.java trunk/jython/src/org/python/core/PyReflectedFunction.java trunk/jython/tests/java/org/python/expose/generate/ExposedTypeProcessorTest.java trunk/jython/tests/java/org/python/tests/Callbacker.java trunk/jython/tests/java/org/python/tests/Coercions.java Added Paths: ----------- trunk/jython/tests/java/org/python/tests/BadStaticInitializer.java trunk/jython/tests/java/org/python/tests/ExceptionTest.java trunk/jython/tests/java/org/python/tests/HiddenSuper.java trunk/jython/tests/java/org/python/tests/OtherSubVisible.java trunk/jython/tests/java/org/python/tests/SomePyMethods.java Removed Paths: ------------- trunk/jython/bugtests/classes/test208j.java trunk/jython/bugtests/classes/test208j0.java trunk/jython/bugtests/classes/test208j1.java trunk/jython/bugtests/classes/test208j2.java trunk/jython/bugtests/classes/test217p/ trunk/jython/bugtests/classes/test219e.java trunk/jython/bugtests/classes/test219i.java trunk/jython/bugtests/classes/test219j.java trunk/jython/bugtests/classes/test220e.java trunk/jython/bugtests/classes/test220i.java trunk/jython/bugtests/classes/test220j.java trunk/jython/bugtests/classes/test231j.java trunk/jython/bugtests/classes/test231j2.java trunk/jython/bugtests/classes/test232p/ trunk/jython/bugtests/classes/test236j1.java trunk/jython/bugtests/classes/test236j2.java trunk/jython/bugtests/classes/test246p/ trunk/jython/bugtests/classes/test248j.java trunk/jython/bugtests/test207.py trunk/jython/bugtests/test208.py trunk/jython/bugtests/test209.py trunk/jython/bugtests/test209p/ trunk/jython/bugtests/test210.py trunk/jython/bugtests/test212.py trunk/jython/bugtests/test213.py trunk/jython/bugtests/test214.html trunk/jython/bugtests/test214.py trunk/jython/bugtests/test215.py trunk/jython/bugtests/test217.py trunk/jython/bugtests/test217c.py trunk/jython/bugtests/test217t.java trunk/jython/bugtests/test218.py trunk/jython/bugtests/test218c.py trunk/jython/bugtests/test219.py trunk/jython/bugtests/test220.py trunk/jython/bugtests/test220c.py trunk/jython/bugtests/test221.py trunk/jython/bugtests/test221c.py trunk/jython/bugtests/test222.py trunk/jython/bugtests/test222s.py trunk/jython/bugtests/test223.py trunk/jython/bugtests/test223s.py trunk/jython/bugtests/test224.py trunk/jython/bugtests/test224s.py trunk/jython/bugtests/test225.py trunk/jython/bugtests/test225s.py trunk/jython/bugtests/test226.py trunk/jython/bugtests/test226c.py trunk/jython/bugtests/test227.py trunk/jython/bugtests/test227c.py trunk/jython/bugtests/test228.py trunk/jython/bugtests/test228s.py trunk/jython/bugtests/test229.py trunk/jython/bugtests/test229c.py trunk/jython/bugtests/test231.py trunk/jython/bugtests/test232.py trunk/jython/bugtests/test233.py trunk/jython/bugtests/test234.py trunk/jython/bugtests/test237.py trunk/jython/bugtests/test237m1.py trunk/jython/bugtests/test237m2.py trunk/jython/bugtests/test238.py trunk/jython/bugtests/test242.py trunk/jython/bugtests/test242c.py trunk/jython/bugtests/test245.py trunk/jython/bugtests/test245j.java trunk/jython/bugtests/test246.py trunk/jython/bugtests/test246c.py trunk/jython/bugtests/test247.py trunk/jython/bugtests/test247j.java trunk/jython/bugtests/test248.py trunk/jython/bugtests/test249.py trunk/jython/bugtests/test249c.py trunk/jython/bugtests/test250.py trunk/jython/bugtests/test250j.java trunk/jython/bugtests/test251.py trunk/jython/bugtests/test251c.py trunk/jython/bugtests/test251c2.py trunk/jython/bugtests/test252.py trunk/jython/bugtests/test252c.py trunk/jython/bugtests/test252c2.py trunk/jython/bugtests/test253.py trunk/jython/bugtests/test253c.py trunk/jython/bugtests/test253c2.py trunk/jython/bugtests/test254.html trunk/jython/bugtests/test254.py trunk/jython/bugtests/test254c.py trunk/jython/bugtests/test255.py trunk/jython/bugtests/test255s1.py trunk/jython/bugtests/test255s2.py trunk/jython/bugtests/test256.html trunk/jython/bugtests/test256.py trunk/jython/bugtests/test256a.py trunk/jython/bugtests/test257.py trunk/jython/bugtests/test258.py trunk/jython/bugtests/test258m1.py Modified: trunk/jython/Lib/test/string_tests.py =================================================================== --- trunk/jython/Lib/test/string_tests.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/Lib/test/string_tests.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -917,7 +917,9 @@ self.checkequal(u'abc', 'abc', '__getitem__', slice(0, 3)) self.checkequal(u'abc', 'abc', '__getitem__', slice(0, 1000)) self.checkequal(u'a', 'abc', '__getitem__', slice(0, 1)) + self.checkequal(u'a', 'abc', '__getitem__', slice(0, 1L)) self.checkequal(u'', 'abc', '__getitem__', slice(0, 0)) + self.checkequal(u'', 'abc', '__getitem__', slice(0L, 0L)) # FIXME What about negative indices? This is handled differently by [] and __getitem__(slice) self.checkraises(TypeError, 'abc', '__getitem__', 'def') Modified: trunk/jython/Lib/test/test_grammar_jy.py =================================================================== --- trunk/jython/Lib/test/test_grammar_jy.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/Lib/test/test_grammar_jy.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -24,6 +24,14 @@ self.assertEquals(uR"spam", Ur"spam") self.assertEquals(ur"spam", UR"spam") + def testKeywordOperations(self): + def foo(a=1, b=2 + 4): + return b + self.assertEquals(6, foo()) + self.assertEquals(6, foo(1)) + self.assertEquals(7, foo(1, 7)) + self.assertEquals(10, foo(b=10)) + def test_main(): test_support.run_unittest(GrammarTest) Modified: trunk/jython/Lib/test/test_java_integration.py =================================================================== --- trunk/jython/Lib/test/test_java_integration.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/Lib/test/test_java_integration.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -8,7 +8,7 @@ from java.util import ArrayList, HashMap, Hashtable, StringTokenizer, Vector from java.io import FileOutputStream, FileWriter, OutputStreamWriter -from java.lang import (Boolean, Integer, Object, String, Runnable, +from java.lang import (Boolean, ExceptionInInitializerError, Integer, Object, String, Runnable, Thread, ThreadGroup, System, Runtime, Math, Byte) from javax.swing.table import AbstractTableModel from javax.swing.tree import TreePath @@ -322,10 +322,12 @@ self.assertEquals(self.kws.yield(), "yield") class ImportTest(unittest.TestCase): - def test_bad_input_exception(self): self.assertRaises(ValueError, __import__, '') + def test_broken_static_initializer(self): + self.assertRaises(ExceptionInInitializerError, __import__, "org.python.tests.BadStaticInitializer") + class ColorTest(unittest.TestCase): def test_assigning_over_method(self): @@ -417,9 +419,9 @@ def call(self, extraarg=None): called.append(extraarg) Callbacker.callNoArg(PyCallback()) - Callbacker.callOneArg(PyCallback(), "arg") + Callbacker.callOneArg(PyCallback(), 4294967295L) self.assertEquals(None, called[0]) - self.assertEquals("arg", called[1]) + self.assertEquals(4294967295L, called[1]) class PyBadCallback(Callbacker.Callback): def call(pyself, extraarg): self.fail("Shouldn't be callable with a no args") Modified: trunk/jython/Lib/test/test_java_visibility.py =================================================================== --- trunk/jython/Lib/test/test_java_visibility.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/Lib/test/test_java_visibility.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -3,8 +3,8 @@ from test import test_support from java.lang import Class from java.util import HashMap, Observable, Observer -from org.python.tests import (Coercions, InterfaceCombination, Invisible, OnlySubclassable, - SubVisible, Visible, VisibleOverride) +from org.python.tests import (Coercions, HiddenSuper, InterfaceCombination, Invisible, OnlySubclassable, + OtherSubVisible, SomePyMethods, SubVisible, Visible, VisibleOverride) from org.python.tests import VisibilityResults as Results class VisibilityTest(unittest.TestCase): @@ -125,6 +125,10 @@ self.assertFalse(hasattr(i, "internalMethod"), "methods from private interfaces shouldn't be visible on a private class") + def test_super_methods_visible(self): + '''Bug #222847 - Can't access public member of package private base class''' + self.assertEquals("hi", HiddenSuper().hi()) + class JavaClassTest(unittest.TestCase): def test_class_methods_visible(self): self.assertFalse(HashMap.isInterface(), @@ -138,7 +142,13 @@ self.assertEquals(Class, HashMap.__class__) self.assertEquals(None, HashMap.__doc__) -class NumberCoercionTest(unittest.TestCase): + def test_python_methods(self): + s = SomePyMethods() + self.assertEquals(6, s[3]) + self.assertEquals(2, s.a, "Undefined attributes should go through to __getattr__") + self.assertEquals(3, s.b, "Defined fields should take precedence") + +class CoercionTest(unittest.TestCase): def test_int_coercion(self): c = Coercions() self.assertEquals("5", c.takeInt(5)) @@ -151,11 +161,13 @@ self.assertEquals("4", Coercions.takePyObj(1, 2, 3, 4)) c = Coercions() self.assertEquals("5", c.takePyObjInst(1, 2, 3, 4, 5)) + self.assertEquals("OtherSubVisible[]", c.takeArray([OtherSubVisible()])) + self.assertEquals("SubVisible[]", c.takeArray([SubVisible()])) def test_main(): test_support.run_unittest(VisibilityTest, JavaClassTest, - NumberCoercionTest) + CoercionTest) if __name__ == "__main__": test_main() Modified: trunk/jython/Lib/test/test_unicode_jy.py =================================================================== --- trunk/jython/Lib/test/test_unicode_jy.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/Lib/test/test_unicode_jy.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -83,7 +83,32 @@ self.assertRaises(UnicodeDecodeError, u''.join, ['foo', '毛泽东']) self.assertRaises(UnicodeDecodeError, '毛泽东'.join, [u'foo', u'bar']) + def test_file_encoding(self): + '''Ensure file writing doesn't attempt to encode things by default and reading doesn't + decode things by default. This was jython's behavior prior to 2.2.1''' + EURO_SIGN = u"\u20ac" + try: + EURO_SIGN.encode() + except UnicodeEncodeError: + # This default encoding can't handle the encoding the Euro sign. Skip the test + return + f = open(test_support.TESTFN, "w") + self.assertRaises(UnicodeEncodeError, f, write, EURO_SIGN, + "Shouldn't be able to write out a Euro sign without first encoding") + f.close() + + f = open(test_support.TESTFN, "w") + f.write(EURO_SIGN.encode('utf-8')) + f.close() + + f = open(test_support.TESTFN, "r") + encoded_euro = f.read() + f.close() + os.remove(test_support.TESTFN) + self.assertEquals('\xe2\x82\xac', encoded_euro) + self.assertEquals(EURO_SIGN, encoded_euro.decode('utf-8')) + def test_main(): test_support.run_unittest(UnicodeTestCase) Deleted: trunk/jython/bugtests/classes/test208j.java =================================================================== --- trunk/jython/bugtests/classes/test208j.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/classes/test208j.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,14 +0,0 @@ -public class test208j { - public static String foo(test208j1[] p) { - return "test208j1[]"; - } - public static String foo(test208j2[] p) { - return "test208j2[]"; - } - public static String foo(Object p) { - return "Object"; - } - public static String foo(Object[] p) { - return "Object[]"; - } -} \ No newline at end of file Deleted: trunk/jython/bugtests/classes/test208j0.java =================================================================== --- trunk/jython/bugtests/classes/test208j0.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/classes/test208j0.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1 +0,0 @@ -public class test208j0 {} \ No newline at end of file Deleted: trunk/jython/bugtests/classes/test208j1.java =================================================================== --- trunk/jython/bugtests/classes/test208j1.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/classes/test208j1.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1 +0,0 @@ -public class test208j1 extends test208j0 {} \ No newline at end of file Deleted: trunk/jython/bugtests/classes/test208j2.java =================================================================== --- trunk/jython/bugtests/classes/test208j2.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/classes/test208j2.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1 +0,0 @@ -public class test208j2 extends test208j0 {} \ No newline at end of file Deleted: trunk/jython/bugtests/classes/test219e.java =================================================================== --- trunk/jython/bugtests/classes/test219e.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/classes/test219e.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,7 +0,0 @@ - -public class test219e extends Exception { - public test219e(String msg) { - super(msg); - } -} - Deleted: trunk/jython/bugtests/classes/test219i.java =================================================================== --- trunk/jython/bugtests/classes/test219i.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/classes/test219i.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,5 +0,0 @@ - -public interface test219i { - public void foo() throws test219e; - public void foo2(int i) throws test219e, Throwable; -} Deleted: trunk/jython/bugtests/classes/test219j.java =================================================================== --- trunk/jython/bugtests/classes/test219j.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/classes/test219j.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,25 +0,0 @@ - -public class test219j { - public static void checkFoo(test219i o) { - try { - o.foo(); - } catch (test219e t) { - // Success. - } catch (Throwable t) { - System.out.println(t.getClass() + " " + t); - } - } - - - public static void checkFoo2(test219i o, int i) { - try { - o.foo2(i); - } catch (test219e t) { - if (i != 0) - System.out.println("failure to catch test219e"); - } catch (Throwable t) { - if (i != 1) - System.out.println("failure to catch Throwable"); - } - } -} \ No newline at end of file Deleted: trunk/jython/bugtests/classes/test220e.java =================================================================== --- trunk/jython/bugtests/classes/test220e.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/classes/test220e.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,7 +0,0 @@ - -public class test220e extends Exception { - public test220e(String msg) { - super(msg); - } -} - Deleted: trunk/jython/bugtests/classes/test220i.java =================================================================== --- trunk/jython/bugtests/classes/test220i.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/classes/test220i.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,5 +0,0 @@ - -public interface test220i { - public void foo() throws test220e; - public void foo2(int i) throws test220e, Throwable; -} Deleted: trunk/jython/bugtests/classes/test220j.java =================================================================== --- trunk/jython/bugtests/classes/test220j.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/classes/test220j.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,25 +0,0 @@ - -public class test220j { - public static void checkFoo(test220i o) { - try { - o.foo(); - } catch (test220e t) { - // Success. - } catch (Throwable t) { - System.out.println(t.getClass() + " " + t); - } - } - - - public static void checkFoo2(test220i o, int i) { - try { - o.foo2(i); - } catch (test220e t) { - if (i != 0) - System.out.println("failure to catch test220e"); - } catch (Throwable t) { - if (i != 1) - System.out.println("failure to catch Throwable"); - } - } -} \ No newline at end of file Deleted: trunk/jython/bugtests/classes/test231j.java =================================================================== --- trunk/jython/bugtests/classes/test231j.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/classes/test231j.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,4 +0,0 @@ - -public interface test231j{ - public void handleRemove(long start); -} Deleted: trunk/jython/bugtests/classes/test231j2.java =================================================================== --- trunk/jython/bugtests/classes/test231j2.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/classes/test231j2.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,6 +0,0 @@ - -public class test231j2 { - public static void callback(test231j t) { - t.handleRemove(4294967295l); - } -} \ No newline at end of file Deleted: trunk/jython/bugtests/classes/test236j1.java =================================================================== --- trunk/jython/bugtests/classes/test236j1.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/classes/test236j1.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,4 +0,0 @@ -public class test236j1 { - static int foo_ = test236j2.foo(); -} - Deleted: trunk/jython/bugtests/classes/test236j2.java =================================================================== --- trunk/jython/bugtests/classes/test236j2.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/classes/test236j2.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,3 +0,0 @@ -public class test236j2 { - public static int foo() { return 12; } -} \ No newline at end of file Deleted: trunk/jython/bugtests/classes/test248j.java =================================================================== --- trunk/jython/bugtests/classes/test248j.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/classes/test248j.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,10 +0,0 @@ - -public class test248j { - static { - //System.out.println("hello1"); - String s = null; - s.length(); - //It seems like jdk1.4 doesn't like a naked throws in static. - //throw new NullPointerException("init failure"); - } -} Deleted: trunk/jython/bugtests/test207.py =================================================================== --- trunk/jython/bugtests/test207.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test207.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,34 +0,0 @@ -""" -Test that file writing doesn't attempt to encode things by default and reading -doesn't decode things by default. -""" - -import support - -EURO_SIGN = u"\u20ac" -try: - EURO_SIGN.encode() - import sys - raise support.TestError('Your default encoding, %s, can handle encoding the Euro sign. This test needs the default encoding to be unable to handle on its test character' % - sys.getdefaultencoding()) -except UnicodeEncodeError: - pass - -f = open("test207.out", "w") -try: - f.write(EURO_SIGN) - raise support.TestError("Shouldn't be able to write out a Euro sign without first encoding") -except UnicodeEncodeError: - pass -f.close() - -f = open("test207.out", "w") -f.write(EURO_SIGN.encode('utf-8')) -f.close() - -f = open("test207.out", "r") -encoded_euro = f.read() -f.close() -if encoded_euro != '\xe2\x82\xac' or encoded_euro.decode('utf-8') != EURO_SIGN: - raise support.TestError("Read something other than the euro sign that we wrote out") -f.close() Deleted: trunk/jython/bugtests/test208.py =================================================================== --- trunk/jython/bugtests/test208.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test208.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,17 +0,0 @@ -""" - -""" - -import support - -support.compileJava("classes/test208j.java") - -import test208j -import test208j1 -import test208j2 - -p=[test208j2()] -support.compare(test208j.foo(p), "test208j2\[\]") - -p=[test208j1()] -support.compare(test208j.foo(p), "test208j1\[\]") Deleted: trunk/jython/bugtests/test209.py =================================================================== --- trunk/jython/bugtests/test209.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test209.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,19 +0,0 @@ -""" - -""" - -import support - -import cPickle - -import test209p.foo.bar - -o = test209p.foo.bar.baz() - -s = cPickle.dumps(o) -#print s - -o2 = cPickle.loads(s) - - - Deleted: trunk/jython/bugtests/test210.py =================================================================== --- trunk/jython/bugtests/test210.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test210.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,29 +0,0 @@ - -import sys -import pickle -tmpfile = "test210.tmp" - -try: - import test118 -except: - pass - -def saveValue( value): - f = open(tmpfile,"wb") - p = pickle.Pickler(f,1) - p.dump(value) - f.close() - -def loadValue(): - f=open(tmpfile,"rb") - retVal = pickle.Unpickler(f).load() - f.close() - return retVal - -for x in range(256): - saveValue(x) - y = loadValue() - if x != y: - print "saved: ", x, - print "loaded: ", y - Deleted: trunk/jython/bugtests/test212.py =================================================================== --- trunk/jython/bugtests/test212.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test212.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,14 +0,0 @@ -""" -Test long indexing of sequences (1.6) -""" - -import support - - -l = (0,1,2,3) - -if l[2L:4L] != (2, 3): - raise support.TestError, "long slice error #1" - -if "abcbdef"[2L:4L] != "cb": - raise support.TestError, "long slice error #2" Deleted: trunk/jython/bugtests/test213.py =================================================================== --- trunk/jython/bugtests/test213.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test213.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,15 +0,0 @@ -""" -Test %r on strings -""" - -import support - - - - -r = "%s %r" % ("abc", "abc") - -if r != "abc 'abc'": - raise support.TestError, "wrong output %s" % r - - Deleted: trunk/jython/bugtests/test214.html =================================================================== --- trunk/jython/bugtests/test214.html 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test214.html 2008-12-29 05:45:42 UTC (rev 5804) @@ -1 +0,0 @@ -<applet code="test214a" archive="test214.jar" width=300 height=200></applet> \ No newline at end of file Deleted: trunk/jython/bugtests/test214.py =================================================================== --- trunk/jython/bugtests/test214.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test214.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,9 +0,0 @@ -""" - -""" - -import support - -support.compileJPythonc("test214a.py", core=1, jar="test214.jar", output="test214.err") - -#raise support.TestError("" + `x`) Deleted: trunk/jython/bugtests/test215.py =================================================================== --- trunk/jython/bugtests/test215.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test215.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,24 +0,0 @@ -""" - -""" - -import support - - - -l = [] -try: - l.insert('a', 1) -except TypeError: - pass -else: - raise support.TestError("Should raise TypeError") - - - -l = [] -l.insert(1, 'a') -l.insert(6, 'b') -l.insert(-1, 'c') -l.insert(3, 'd') - Deleted: trunk/jython/bugtests/test217.py =================================================================== --- trunk/jython/bugtests/test217.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test217.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,11 +0,0 @@ -""" - -""" - -import os -import support -support.compileJava("classes/test217p/test217i.java") - -support.compileJPythonc("test217c.py", output="test217.err") -support.compileJava("test217t.java", classpath="jpywork") -support.runJava("test217t", classpath="jpywork" + os.pathsep + ".") Deleted: trunk/jython/bugtests/test217c.py =================================================================== --- trunk/jython/bugtests/test217c.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test217c.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,10 +0,0 @@ -from java.lang import Object, String -from java.io import Serializable -from test217p import test217i -import java - -class test217c(Object, Serializable, test217i): - def add(self, x, y): - "@sig public java.lang.String add(int x, int y)" - return "The sum of %d and %d is %d" % (x, y, x+y) - Deleted: trunk/jython/bugtests/test217t.java =================================================================== --- trunk/jython/bugtests/test217t.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test217t.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,8 +0,0 @@ -public class test217t { - public static void main(String args[]) { - test217p.test217i c = new test217c(); - String s = c.add(1, 2); - if (!"The sum of 1 and 2 is 3".equals(s)) - System.out.println("Wrong output:" + s); - } -} Deleted: trunk/jython/bugtests/test218.py =================================================================== --- trunk/jython/bugtests/test218.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test218.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,9 +0,0 @@ -""" - -""" - -import support - -support.compileJPythonc("test218c.py", output="test218.err") - -support.runJava("test218c", classpath="jpywork") \ No newline at end of file Deleted: trunk/jython/bugtests/test218c.py =================================================================== --- trunk/jython/bugtests/test218c.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test218c.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,2 +0,0 @@ - -a,b, = 1,2 Deleted: trunk/jython/bugtests/test219.py =================================================================== --- trunk/jython/bugtests/test219.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test219.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,22 +0,0 @@ - -import support - -support.compileJava("classes/test219j.java") - -import test219i, test219e, test219j - -class test219(test219i): - def foo(self): - raise test219e("raised in foo()") - def foo2(self, i): - if i == 0: - raise test219e("test219e raised in foo()") - else: - raise java.lang.Throwable("Throwable raised in foo()") - - -a = test219() - -test219j.checkFoo(a) -test219j.checkFoo2(a, 0) -test219j.checkFoo2(a, 1) Deleted: trunk/jython/bugtests/test220.py =================================================================== --- trunk/jython/bugtests/test220.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test220.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,10 +0,0 @@ -""" - -""" - -import support - -support.compileJava("classes/test220j.java") -support.compileJPythonc("test220c.py", output="test220.err") - -support.runJava("test220c", classpath="jpywork") Deleted: trunk/jython/bugtests/test220c.py =================================================================== --- trunk/jython/bugtests/test220c.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test220c.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,18 +0,0 @@ - -import test219i, test219e, test219j - -class test219(test219i): - def foo(self): - raise test219e("raised in foo()") - def foo2(self, i): - if i == 0: - raise test219e("test219e raised in foo()") - else: - raise java.lang.Throwable("Throwable raised in foo()") - - -a = test219() - -test219j.checkFoo(a) -test219j.checkFoo2(a, 0) -test219j.checkFoo2(a, 1) Deleted: trunk/jython/bugtests/test221.py =================================================================== --- trunk/jython/bugtests/test221.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test221.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,11 +0,0 @@ -""" - -""" - -import support - -import test221c - -support.compileJPythonc("test221c.py", deep=1, output="test221.err") - -support.runJava("test221c", classpath="jpywork") \ No newline at end of file Deleted: trunk/jython/bugtests/test221c.py =================================================================== --- trunk/jython/bugtests/test221c.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test221c.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,33 +0,0 @@ - -import support - -a = 1 -a += 1 + 2 -if a != 4: - raise support.TestError, "Wrong result #1 %s" % a - -a=[0,1,2,3,4,5] -if a[1:3] != [1, 2]: - raise support.TestError, "Wrong result #2 %s" % a[1:3] - -a[1:3] += ["a", "b"] -if a != [0, 1, 2, 'a', 'b', 3, 4, 5]: - raise support.TestError, "Wrong result #3 %s" % a - - -s = None - -class A: - def __getitem__(self, i): - global s - if s is None: - s = i - else: - raise support.TestError, "__getitem__ should only be called once" - return 11 - def __setitem__(self, i, v): - if s != i: - raise support.TestError, "__setitem__ should have same index af __getitem__" - -a = A() -a[:, ..., ::, 0:10:2, :10:, 1, 2:, ::-1] += 1 \ No newline at end of file Deleted: trunk/jython/bugtests/test222.py =================================================================== --- trunk/jython/bugtests/test222.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test222.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,19 +0,0 @@ -""" - -""" - -import support - -try: - import test222s -except SyntaxError: - pass -else: - raise support.TestError('Should raise SyntaxError #1') - -ret = support.compileJPythonc("test222s.py", output="test222.err", - expectError=1) - -if ret == 0: - raise support.TestError('Should raise SyntaxError #2') - Deleted: trunk/jython/bugtests/test222s.py =================================================================== --- trunk/jython/bugtests/test222s.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test222s.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,2 +0,0 @@ - -(a, b, c) += 1,2,3 Deleted: trunk/jython/bugtests/test223.py =================================================================== --- trunk/jython/bugtests/test223.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test223.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,19 +0,0 @@ -""" - -""" - -import support - -try: - import test223s -except SyntaxError: - pass -else: - raise support.TestError('Should raise SyntaxError #1') - -ret = support.compileJPythonc("test223s.py", output="test223.err", - expectError=1) - -if ret == 0: - raise support.TestError('Should raise SyntaxError #2') - Deleted: trunk/jython/bugtests/test223s.py =================================================================== --- trunk/jython/bugtests/test223s.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test223s.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,2 +0,0 @@ - -a += b += c Deleted: trunk/jython/bugtests/test224.py =================================================================== --- trunk/jython/bugtests/test224.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test224.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,19 +0,0 @@ -""" - -""" - -import support - -try: - import test224s -except SyntaxError: - pass -else: - raise support.TestError('Should raise SyntaxError #1') - -ret = support.compileJPythonc("test224s.py", output="test224.err", - expectError=1) - -if ret == 0: - raise support.TestError('Should raise SyntaxError #2') - Deleted: trunk/jython/bugtests/test224s.py =================================================================== --- trunk/jython/bugtests/test224s.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test224s.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,2 +0,0 @@ - -[a, b, c] += 1,2,3 Deleted: trunk/jython/bugtests/test225.py =================================================================== --- trunk/jython/bugtests/test225.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test225.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,2 +0,0 @@ - -import test225s Deleted: trunk/jython/bugtests/test225s.py =================================================================== --- trunk/jython/bugtests/test225s.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test225s.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,11 +0,0 @@ - -import support - -def foo(a=1, b=2+4): - return b - -v = foo() - -if v != 6: - raise support.TestError, "Wrong return value %d" % d - Deleted: trunk/jython/bugtests/test226.py =================================================================== --- trunk/jython/bugtests/test226.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test226.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,9 +0,0 @@ -""" - -""" - -import support - -support.compileJPythonc("test226c.py", output="test226.err") - -support.runJava("test226c", classpath="jpywork") \ No newline at end of file Deleted: trunk/jython/bugtests/test226c.py =================================================================== --- trunk/jython/bugtests/test226c.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test226c.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,20 +0,0 @@ - -cnt = 0 - -def f(i): - global cnt - cnt = cnt + 1 - return i - - -l=[1,2,3,4,5,6] - -l[f(2):f(4)] += ['a', 'b', 'c'] - -if cnt != 2: - raise support.TestError('Number of calls is wrong') - - -if l != [1, 2, 3, 4, 'a', 'b', 'c', 5, 6]: - raise support.TestError('list is wrong') - Deleted: trunk/jython/bugtests/test227.py =================================================================== --- trunk/jython/bugtests/test227.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test227.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,9 +0,0 @@ -""" - -""" - -import support - -support.compileJPythonc("test227c.py", output="test227.err") - -support.runJava("test227c", classpath="jpywork", output="test227.out") \ No newline at end of file Deleted: trunk/jython/bugtests/test227c.py =================================================================== --- trunk/jython/bugtests/test227c.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test227c.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,232 +0,0 @@ - -# Augmented assignment test. - -x = 2 -x += 1 -x *= 2 -x **= 2 -x -= 8 -x /= 2 -x %= 12 -x &= 2 -x |= 5 -x ^= 1 - -print x - -x = [2] -x[0] += 1 -x[0] *= 2 -x[0] **= 2 -x[0] -= 8 -x[0] /= 2 -x[0] %= 12 -x[0] &= 2 -x[0] |= 5 -x[0] ^= 1 - -print x - -x = {0: 2} -x[0] += 1 -x[0] *= 2 -x[0] **= 2 -x[0] -= 8 -x[0] /= 2 -x[0] %= 12 -x[0] &= 2 -x[0] |= 5 -x[0] ^= 1 - -print x[0] - -x = [1,2] -x += [3,4] -x *= 2 - -print x - -x = [1, 2, 3] -y = x -x[1:2] *= 2 -y[1:2] += [1] - -print x -print x is y - -class aug_test: - def __init__(self, value): - self.val = value - def __radd__(self, val): - return self.val + val - def __add__(self, val): - return aug_test(self.val + val) - - -class aug_test2(aug_test): - def __iadd__(self, val): - self.val = self.val + val - return self - -class aug_test3(aug_test): - def __iadd__(self, val): - return aug_test3(self.val + val) - -x = aug_test(1) -y = x -x += 10 - -print isinstance(x, aug_test) -print y is not x -print x.val - -x = aug_test2(2) -y = x -x += 10 - -print y is x -print x.val - -x = aug_test3(3) -y = x -x += 10 - -print isinstance(x, aug_test3) -print y is not x -print x.val - -class testall: - - def __add__(self, val): - print "__add__ called" - def __radd__(self, val): - print "__radd__ called" - def __iadd__(self, val): - print "__iadd__ called" - return self - - def __sub__(self, val): - print "__sub__ called" - def __rsub__(self, val): - print "__rsub__ called" - def __isub__(self, val): - print "__isub__ called" - return self - - def __mul__(self, val): - print "__mul__ called" - def __rmul__(self, val): - print "__rmul__ called" - def __imul__(self, val): - print "__imul__ called" - return self - - def __div__(self, val): - print "__div__ called" - def __rdiv__(self, val): - print "__rdiv__ called" - def __idiv__(self, val): - print "__idiv__ called" - return self - - def __mod__(self, val): - print "__mod__ called" - def __rmod__(self, val): - print "__rmod__ called" - def __imod__(self, val): - print "__imod__ called" - return self - - def __pow__(self, val): - print "__pow__ called" - def __rpow__(self, val): - print "__rpow__ called" - def __ipow__(self, val): - print "__ipow__ called" - return self - - def __or__(self, val): - print "__or__ called" - def __ror__(self, val): - print "__ror__ called" - def __ior__(self, val): - print "__ior__ called" - return self - - def __and__(self, val): - print "__and__ called" - def __rand__(self, val): - print "__rand__ called" - def __iand__(self, val): - print "__iand__ called" - return self - - def __xor__(self, val): - print "__xor__ called" - def __rxor__(self, val): - print "__rxor__ called" - def __ixor__(self, val): - print "__ixor__ called" - return self - - def __rshift__(self, val): - print "__rshift__ called" - def __rrshift__(self, val): - print "__rrshift__ called" - def __irshift__(self, val): - print "__irshift__ called" - return self - - def __lshift__(self, val): - print "__lshift__ called" - def __rlshift__(self, val): - print "__rlshift__ called" - def __ilshift__(self, val): - print "__ilshift__ called" - return self - -x = testall() -x + 1 -1 + x -x += 1 - -x - 1 -1 - x -x -= 1 - -x * 1 -1 * x -x *= 1 - -x / 1 -1 / x -x /= 1 - -x % 1 -1 % x -x %= 1 - -x ** 1 -1 ** x -x **= 1 - -x | 1 -1 | x -x |= 1 - -x & 1 -1 & x -x &= 1 - -x ^ 1 -1 ^ x -x ^= 1 - -x >> 1 -1 >> x -x >>= 1 - -x << 1 -1 << x -x <<= 1 - Deleted: trunk/jython/bugtests/test228.py =================================================================== --- trunk/jython/bugtests/test228.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test228.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,11 +0,0 @@ -""" - -""" - -import support - -import test228s - -support.compileJPythonc("test228s.py", deep=1, output="test228.err") - -support.runJava("test228s", classpath="jpywork") \ No newline at end of file Deleted: trunk/jython/bugtests/test228s.py =================================================================== --- trunk/jython/bugtests/test228s.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test228s.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,26 +0,0 @@ - -from java import util as ut, io, awt as aw, text as te -import java - -import support - -if java.util != ut: - raise support.TestError("util not the same") -if java.awt != aw: - raise support.TestError("awt not the same") -if java.io != io: - raise support.TestError("io not the same") -if java.text != te: - raise support.TestError("text not the same") - - -import java.util.Vector as vec -import java.util.Date as date, java.io.File as file - -if java.util.Vector != vec: - raise support.TestError("Vector not the same") -if java.util.Date != date: - raise support.TestError("Date not the same") -if java.io.File != file: - raise support.TestError("File not the same") - Deleted: trunk/jython/bugtests/test229.py =================================================================== --- trunk/jython/bugtests/test229.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test229.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,8 +0,0 @@ -""" - -""" - -import support - -support.compileJPythonc("test229c.py", output="test229.err") - Deleted: trunk/jython/bugtests/test229c.py =================================================================== --- trunk/jython/bugtests/test229c.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test229c.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,2 +0,0 @@ - -zeros((3,3))[:,0] Modified: trunk/jython/bugtests/test230.py =================================================================== --- trunk/jython/bugtests/test230.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test230.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -7,8 +7,7 @@ class P: def do_help(self, arg): - pass - #print "do_help", arg + print "do_help", arg #print do_help, id(do_help) def onecmd(self, cmd, arg): Deleted: trunk/jython/bugtests/test231.py =================================================================== --- trunk/jython/bugtests/test231.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test231.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,15 +0,0 @@ - -import support - -support.compileJava("classes/test231j2.java") - -import test231j, test231j2 - -class MyHandler(test231j): - def handleRemove(self, start): - if start != 4294967295L: - raise support.TestError("long not passed correcttly") - -m = MyHandler() - -test231j2.callback(m); Deleted: trunk/jython/bugtests/test232.py =================================================================== --- trunk/jython/bugtests/test232.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test232.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,15 +0,0 @@ -""" -Bug #222847 - Can't access public member of package private base class -""" - -import support - -support.compileJava("classes/test232p/Foo.java") - -from test232p import Foo -try: - Foo().hi() -except IllegalAccessException: - raise support.TestError('Should be able to call public method on package protected superclass') - - Deleted: trunk/jython/bugtests/test233.py =================================================================== --- trunk/jython/bugtests/test233.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test233.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,9 +0,0 @@ - -import support - -try: - from test233s import foobar -except ImportError: - pass -else: - raise support.TestError("Should raise ImportError") Deleted: trunk/jython/bugtests/test234.py =================================================================== --- trunk/jython/bugtests/test234.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test234.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,7 +0,0 @@ -import copy -class X: pass - -x=X() -y=copy.deepcopy(x) - -y=copy.copy(x) Deleted: trunk/jython/bugtests/test237.py =================================================================== --- trunk/jython/bugtests/test237.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test237.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,4 +0,0 @@ -import support - -support.compileJPythonc("test237m2.py", output="test237.err", deep=1) - Deleted: trunk/jython/bugtests/test237m1.py =================================================================== --- trunk/jython/bugtests/test237m1.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test237m1.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,97 +0,0 @@ -from jarray import array - -from javax import swing -from java import awt -from java.beans import PropertyChangeListener - -import java.lang -import string - - -class DlgClick(PropertyChangeListener) : - # - # this delegates propertyChange events - # subclassing and interface extending doesn't seem to work - # properly - # - def __init__(self, delegate) : - self.cb = delegate - - def propertyChange(self, e) : - self.cb(e) - -class UiDialog(swing.JDialog) : - - def __init__(self, widget, title="") : - swing.JDialog.__init__(self, swing.JOptionPane.getFrameForComponent(widget), 1) - - self.setTitle(title) - self.dlg_body = None - self.create_body() - - self.dlg_option_pane = swing.JOptionPane( \ - array(self.dlg_body, java.lang.Object), \ - self.get_type(), \ - self.get_options(), \ - self.get_icon(), \ - self.get_buttons(), \ - self.get_default()) - - self.setContentPane(self.dlg_option_pane) - self.setDefaultCloseOperation(swing.JDialog.DO_NOTHING_ON_CLOSE) - - self.dlg_option_pane.addPropertyChangeListener(DlgClick(self.dlg_click)) - - - self.pack() - self.setResizable(0) - self.show() - - def create_body(self) : - if self.dlg_body is None : - self.dlg_body = ["This is a dialog"] - - def get_type(self) : - return swing.JOptionPane.PLAIN_MESSAGE - - def get_options(self) : - return swing.JOptionPane.OK_CANCEL_OPTION - - def get_icon(self) : - return None - - def get_buttons(self) : - return ["Ok", "Cancel"] - - def get_default(self) : - return self.get_buttons()[0] - - def dlg_click(self, event) : - - prop = event.getPropertyName() - value = self.dlg_option_pane.getValue() - - # don't run after initialisation - if self.isVisible() and (event.getSource() == self.dlg_option_pane) \ - and (prop == swing.JOptionPane.VALUE_PROPERTY or prop == swing.JOptionPane.INPUT_VALUE_PROPERTY) : - - # reset for new input - if value == swing.JOptionPane.UNINITIALIZED_VALUE : - return - - self.dlg_option_pane.setValue(swing.JOptionPane.UNINITIALIZED_VALUE) - - if self.dlg_validate(value) : - self.dlg_make_result(value) - self.dispose() - - def dlg_validate(self, pressed) : - # return whether input is valid depending on pressed button - return 1 - - def dlg_make_result(self, pressed) : - # the result is read afterwards to figure out the outcome of the user input - if pressed == "Ok" : - self.result = 1 - else : - self.result = 0 Deleted: trunk/jython/bugtests/test237m2.py =================================================================== --- trunk/jython/bugtests/test237m2.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test237m2.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,56 +0,0 @@ -import test237m1 -from javax import swing -from java import awt -import string - -class PSetNameDlg(test237m1.UiDialog) : - - def __init__(self, frame, label="Enter a name for the property set:", must_not_exist=1, must_exist=0) : - self.must_exist = must_exist - self.must_not_exist = must_not_exist - self.label_text = label - - test237m1.UiDialog.__init__(self, frame, title="property set name") - - def create_body(self) : - self.ps_name_input = swing.JTextField(10) - self.label_widget = swing.JLabel(self.label_text) - - - if self.dlg_body is None : - self.dlg_body = [self.label_widget, self.ps_name_input] - - - def dlg_validate(self, pressed) : - # check whether the name is correct - if pressed != "Ok" : - return 1 - - name = self.ps_name_input.getText() - - # comment this out for testing - #if len(name) < 1 : - # error = "A reasonbale name should at least have one character." - # test237m1.ErrorMsg(self, error) - # return 0 - #if self.must_not_exist : - # if conf.main.psb.find_property_set(name) is not None : - # error = "There is already a property set with this name." - # test237m1.ErrorMsg(self, error) - # return 0 - #if self.must_exist : - # if conf.main.psb.find_property_set(name) is None : - # error = "There is no property set with this name." - # test237m1.ErrorMsg(self, error) - # return 0 - # comment out until here - - - return 1 - - def dlg_make_result(self, pressed) : - # input value as result or None for cancel - if pressed != "Ok" : - self.result = None - else : - self.result = self.ps_name_input.getText() \ No newline at end of file Deleted: trunk/jython/bugtests/test238.py =================================================================== --- trunk/jython/bugtests/test238.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test238.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,43 +0,0 @@ -""" -Try reloading a javaclass located on sys.path. -""" - -import support -import java -import sys - -def mkspam(a): - f = open("test238p/test238j.java", "w") - f.write(""" -package test238p; -public class test238j { - public static String spam() { return "%s"; } - public static void %s() {} -} -""" % (a, a)) - f.close() - support.compileJava("test238p/test238j.java") - - -mkspam("foo") - -import test238p - -spam1 = test238p.test238j.spam() -support.compare(spam1, "foo") - -mkspam("bar") - -# -# Test removed. Reloading a java package is not supposed to work. -# -#reload(test238p) -#spam1 = test238p.test238j.spam() -#support.compare(spam1, "bar") -# -#mkspam("baz") -# -#reload(test238p) -#spam1 = test238p.test238j.spam() -#support.compare(spam1, "baz") - Deleted: trunk/jython/bugtests/test242.py =================================================================== --- trunk/jython/bugtests/test242.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test242.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,11 +0,0 @@ -""" - -""" - -import support - -import test242c - -support.compileJPythonc("test242c.py", deep=1, output="test242.err") - -support.runJava("test242c", classpath="jpywork") \ No newline at end of file Deleted: trunk/jython/bugtests/test242c.py =================================================================== --- trunk/jython/bugtests/test242c.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test242c.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,67 +0,0 @@ - -import support - -# list comprehension tests -nums = [1, 2, 3, 4, 5] -strs = ["Apple", "Banana", "Coconut"] -spcs = [" Apple", " Banana ", "Coco nut "] - -if [s.strip() for s in spcs] != ['Apple', 'Banana', 'Coco nut']: - raise support.TestError, "Wrong value #1" - -if [3 * x for x in nums] != [3, 6, 9, 12, 15]: - raise support.TestError, "Wrong value #2" - -if [x for x in nums if x > 2] != [3, 4, 5]: - raise support.TestError, "Wrong value #3" - -if len([(i, s) for i in nums for s in strs]) != len(nums) * len(strs): - raise support.TestError, "Wrong value #4" - -if [(i, s) for i in nums for s in [f for f in strs if "n" in f]] != [ - (1, 'Banana'), (1, 'Coconut'), (2, 'Banana'), (2, 'Coconut'), - (3, 'Banana'), (3, 'Coconut'), (4, 'Banana'), (4, 'Coconut'), - (5, 'Banana'), (5, 'Coconut')]: - raise support.TestError, "Wrong value #5" - - -try: - eval("[i, s for i in nums for s in strs]") - print "FAIL: should have raised a SyntaxError!" -except SyntaxError: - pass - -try: - eval("[x if y]") - print "FAIL: should have raised a SyntaxError!" -except SyntaxError: - pass - -suppliers = [ - (1, "Boeing"), - (2, "Ford"), - (3, "Macdonalds") -] - -parts = [ - (10, "Airliner"), - (20, "Engine"), - (30, "Cheeseburger") -] - -suppart = [ - (1, 10), (1, 20), (2, 20), (3, 30) -] - -l = [ - (sname, pname) - for (sno, sname) in suppliers - for (pno, pname) in parts - for (sp_sno, sp_pno) in suppart - if sno == sp_sno and pno == sp_pno -] - - -if l != [('Boeing', 'Airliner'), ('Boeing', 'Engine'), - ('Ford', 'Engine'), ('Macdonalds', 'Cheeseburger')]: - raise support.TestError, "Wrong value #6" Deleted: trunk/jython/bugtests/test245.py =================================================================== --- trunk/jython/bugtests/test245.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test245.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,11 +0,0 @@ - - -import support - -support.compileJava("test245j.java") - -#import test245j -#test245j.main([]) - -support.runJava("test245j", classpath=".") - Deleted: trunk/jython/bugtests/test245j.java =================================================================== --- trunk/jython/bugtests/test245j.java 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test245j.java 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,75 +0,0 @@ -import java.util.*; -import org.python.util.PythonInterpreter; -import org.python.core.*; -import java.lang.reflect.*; - -public abstract class test245j { - - public static test245j createPythonScriptClass( - String var[],String script,String name) { - StringTokenizer st=new StringTokenizer(script,"\n\r"); - - StringBuffer scr=new StringBuffer( - "import test245j\n"); - - scr.append("class PySS"); - scr.append(name); - scr.append("(test245j):\n def get(self,variables):\n"); - - for (int i=0;i<var.length;i++) { - scr.append(" "); - scr.append(var[i]); - scr.append("=variables["); - scr.append(i); - scr.append("]\n"); - } - - while (st.hasMoreTokens()) { - scr.append(" "); - scr.append(st.nextToken()); - scr.append("\n"); - } - scr.append(" return "); - scr.append(name); - scr.append("\nrr=PySS"); - scr.append(name); - scr.append("()\n\n"); - - String scriptString=scr.toString(); - -//System.out.println("------------------------\n"+scriptString+"------------------------\n"); - PythonInterpreter interp = new PythonInterpreter(); - interp.exec("import sys"); - interp.exec(scriptString); - - - Object pso = interp.get("rr",Object.class); -// System.out.println("pso class: "+pso.getClass().getName()); -// System.out.println("pso superclass:"+(pso.getClass()).getSuperclass().getName()); -// Method met[]=pso.getClass().getMethods(); -// for(int i=0;i<met.length;i++) -// System.out.println("Met: "+met[i]); - - test245j psc = null; - - psc =(test245j) pso; //<-------------------------------------------------------------------------EXCEPTION -// System.out.println(" psc class: "+psc.getClass().getName()); -// System.out.println(" psc superclass:"+(psc.getClass()).getSuperclass().getName()); - return psc; - } - - public double get(double variable[]) { - return 0.0; - }; - - public static void main(String args[]) throws Exception { - String names[]={"a","b"}; - double variables[]={1.0,2.0}; - String script="c = a + b"; - test245j psc=test245j.createPythonScriptClass(names,script,"c"); - double c=psc.get(variables); - if (c != 3.0) - throw new Exception("Wrong result"); - //System.out.println("C = "+c); - } -} Deleted: trunk/jython/bugtests/test246.py =================================================================== --- trunk/jython/bugtests/test246.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test246.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,35 +0,0 @@ - -import support - -support.compileJava("classes/test246p/test246j.java") - -support.compileJPythonc("test246c.py", package="test246p", output="test246.err") - - -# -# This will fuck up the remaining tests if this test is aborted midways. -# -import sys -sys.path[:0] = ["jpywork"] - -# make the test246 a package. Hmm. -open("jpywork/test246p/__init__.py", "w").close() - -from test246c import testStatic -#from test246p.test246c import testStatic - -v = testStatic.staticMethode('test') -if v != "staticMethode called in testStaticBase": - raise support.TestError, "wrong result #1: %s" % v - -t=testStatic() - -v = t.staticMethode('test') -if v != "staticMethode called in testStaticBase": - raise support.TestError, "wrong result #2: %s" % v - -v = t.notStaticMethode('test') -if v != "notStaticMethode is called in testStatic": - raise support.TestError, "wrong result #3: %s" % v - -del sys.path[0] Deleted: trunk/jython/bugtests/test246c.py =================================================================== --- trunk/jython/bugtests/test246c.py 2008-12-29 01:30:27 UTC (rev 5803) +++ trunk/jython/bugtests/test246c.py 2008-12-29 05:45:42 UTC (rev 5804) @@ -1,13 +0,0 @@ -import java -from test246p import test246j - -class testStatic(test246j): - def __init__(self): - #return "testStatic.__init__ is called" - pass - - def notStaticMethode(self,group): - return "notStaticMethode is called in testStatic" - -def staticMethode(group): - return "staticMethode is called in test246c" Deleted: trunk/jython/bugtests/te... [truncated message content] |