From: <cg...@us...> - 2009-04-27 00:56:17
|
Revision: 6264 http://jython.svn.sourceforge.net/jython/?rev=6264&view=rev Author: cgroves Date: 2009-04-27 00:56:11 +0000 (Mon, 27 Apr 2009) Log Message: ----------- Whoops, forgot the test for issue1297. Modified Paths: -------------- trunk/jython/Lib/test/test_java_subclasses.py Added Paths: ----------- trunk/jython/tests/java/org/python/tests/OwnMethodCaller.java Modified: trunk/jython/Lib/test/test_java_subclasses.py =================================================================== --- trunk/jython/Lib/test/test_java_subclasses.py 2009-04-27 00:53:26 UTC (rev 6263) +++ trunk/jython/Lib/test/test_java_subclasses.py 2009-04-27 00:56:11 UTC (rev 6264) @@ -12,7 +12,7 @@ from java.awt import Color, Component, Dimension, Rectangle from javax.swing.table import AbstractTableModel -from org.python.tests import BeanInterface, Callbacker, Coercions +from org.python.tests import BeanInterface, Callbacker, Coercions, OwnMethodCaller class InterfaceTest(unittest.TestCase): def test_java_calling_python_interface_implementation(self): @@ -211,7 +211,20 @@ aa.name self.assertEquals("getName", output.pop()) + def test_python_subclass_of_python_subclass_of_java_class_overriding(self): + '''Test for http://bugs.jython.org/issue1297. + Checks that getValue on SecondSubclass is overriden correctly when called from Java.''' + class FirstSubclass(OwnMethodCaller): + pass + + class SecondSubclass(FirstSubclass): + def getValue(self): + return 10 + + self.assertEquals(10, SecondSubclass().callGetValue()) + + """ public abstract class Abstract { public Abstract() { Added: trunk/jython/tests/java/org/python/tests/OwnMethodCaller.java =================================================================== --- trunk/jython/tests/java/org/python/tests/OwnMethodCaller.java (rev 0) +++ trunk/jython/tests/java/org/python/tests/OwnMethodCaller.java 2009-04-27 00:56:11 UTC (rev 6264) @@ -0,0 +1,12 @@ +package org.python.tests; + +public class OwnMethodCaller { + + public int getValue() { + return 7; + } + + public int callGetValue() { + return getValue(); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |