From: <fwi...@us...> - 2009-03-31 19:41:10
|
Revision: 6140 http://jython.svn.sourceforge.net/jython/?rev=6140&view=rev Author: fwierzbicki Date: 2009-03-31 19:41:07 +0000 (Tue, 31 Mar 2009) Log Message: ----------- rename test, added (but commented out) tests for http://bugs.jython.org/issue1271 Added Paths: ----------- trunk/jython/tests/java/org/python/tests/props/BeanPropertyTest.java trunk/jython/tests/java/org/python/tests/props/PropShadow.java Removed Paths: ------------- trunk/jython/tests/java/org/python/tests/props/ReadonlyTest.java Copied: trunk/jython/tests/java/org/python/tests/props/BeanPropertyTest.java (from rev 6138, trunk/jython/tests/java/org/python/tests/props/ReadonlyTest.java) =================================================================== --- trunk/jython/tests/java/org/python/tests/props/BeanPropertyTest.java (rev 0) +++ trunk/jython/tests/java/org/python/tests/props/BeanPropertyTest.java 2009-03-31 19:41:07 UTC (rev 6140) @@ -0,0 +1,44 @@ +package org.python.tests.props; + +import junit.framework.TestCase; + +import org.python.core.PyStringMap; +import org.python.core.PySystemState; +import org.python.util.PythonInterpreter; + +public class BeanPropertyTest extends TestCase { + + private PythonInterpreter interp; + + @Override + protected void setUp() throws Exception { + interp = new PythonInterpreter(new PyStringMap(), new PySystemState()); + } + + public void testReadonly() { + //This used to cause an NPE see http://bugs.jython.org/issue1295 + interp.exec("from org.python.tests.props import Readonly;Readonly().a = 'test'"); + } + + //This test is for http://bugs.jython.org/issue1271 + public void testBaseProp() { + /* + interp.exec("from org.python.tests.props import PropShadow"); + interp.exec("a = PropShadow.Derived()"); + interp.exec("assert a.foo() == 1, 'a'"); + interp.exec("assert a.bar() == 2, 'b'"); + */ + } + + //This test is for http://bugs.jython.org/issue1271 + public void testDerivedProp() { + /* + interp.exec("from org.python.tests.props import PropShadow"); + interp.exec("b = PropShadow.Derived()"); + interp.exec("assert b.getBaz() == 4, 'c'"); + interp.exec("assert b.getFoo() == 3, 'd'"); + interp.exec("assert b.foo() == 1, 'e'"); + interp.exec("assert b.foo() == 1, 'f'"); + */ + } +} Added: trunk/jython/tests/java/org/python/tests/props/PropShadow.java =================================================================== --- trunk/jython/tests/java/org/python/tests/props/PropShadow.java (rev 0) +++ trunk/jython/tests/java/org/python/tests/props/PropShadow.java 2009-03-31 19:41:07 UTC (rev 6140) @@ -0,0 +1,33 @@ +package org.python.tests.props; + +public class PropShadow { + + public static class Base { + + public Base() { + } + + public int foo() { + return 1; + } + + public int bar() { + return 2; + } + } + + + public static class Derived extends Base { + + public Derived() { + } + + public int getFoo() { + return 3; + } + + public int getBaz() { + return 4; + } + } +} Deleted: trunk/jython/tests/java/org/python/tests/props/ReadonlyTest.java =================================================================== --- trunk/jython/tests/java/org/python/tests/props/ReadonlyTest.java 2009-03-31 19:04:48 UTC (rev 6139) +++ trunk/jython/tests/java/org/python/tests/props/ReadonlyTest.java 2009-03-31 19:41:07 UTC (rev 6140) @@ -1,22 +0,0 @@ -package org.python.tests.props; - -import junit.framework.TestCase; - -import org.python.core.PyStringMap; -import org.python.core.PySystemState; -import org.python.util.PythonInterpreter; - -public class ReadonlyTest extends TestCase { - - private PythonInterpreter interp; - - @Override - protected void setUp() throws Exception { - interp = new PythonInterpreter(new PyStringMap(), new PySystemState()); - } - - public void testReadonly() { - //This used to cause an NPE see http://bugs.jython.org/issue1295 - interp.exec("from org.python.tests.props import Readonly;Readonly().a = 'test'"); - } -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |