[Jython-checkins] jython: Moves ProxyDeserialization to package javatests.
jeff.allen
jython-checkins at python.org
Tue Dec 6 01:32:43 EST 2016
https://hg.python.org/jython/rev/c24f9bc9ac87
changeset: 7975:c24f9bc9ac87
parent: 7971:4734d082de59
user: Jeff Allen <ja.py at farowl.co.uk>
date: Mon Dec 05 14:44:38 2016 +0000
summary:
Moves ProxyDeserialization to package javatests.
See user comment (thanks to Michael Prieß) on
https://github.com/jythontools/jython/commit/cf0de9999
files:
Lib/test/test_java_integration.py | 18 +++++----
tests/java/javatests/ProxyDeserialization.java | 6 +-
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/Lib/test/test_java_integration.py b/Lib/test/test_java_integration.py
--- a/Lib/test/test_java_integration.py
+++ b/Lib/test/test_java_integration.py
@@ -617,8 +617,6 @@
return jars
-
-
class JavaSource(SimpleJavaFileObject):
def __init__(self, name, source):
@@ -687,7 +685,8 @@
self.assertEqual(names, roundtrip_serialization(names))
def test_proxy_serialization(self):
- """Proxies can be deserializable in a fresh JVM, including being able to "findPython" to get a PySystemState"""
+ # Proxies can be deserializable in a fresh JVM, including being able
+ # to "findPython" to get a PySystemState.
tempdir = tempfile.mkdtemp()
old_proxy_debug_dir = org.python.core.Options.proxyDebugDirectory
try:
@@ -719,8 +718,10 @@
classpath = os.pathsep.join(jars)
env = dict(os.environ)
env.update(JYTHONPATH=os.path.normpath(os.path.join(__file__, "..")))
- cmd = [os.path.join(System.getProperty("java.home"), "bin/java"),
- "-classpath", classpath, "ProxyDeserialization", cat_path]
+ cmd = [os.path.join(System.getProperty("java.home"), "bin", "java"),
+ "-classpath", classpath,
+ "javatests.ProxyDeserialization",
+ cat_path]
self.assertEqual(subprocess.check_output(cmd, env=env, universal_newlines=True),
"meow\n")
finally:
@@ -728,7 +729,7 @@
shutil.rmtree(tempdir)
def test_custom_proxymaker(self):
- """Verify custom proxymaker supports direct usage of Python code in Java"""
+ # Verify custom proxymaker supports direct usage of Python code in Java
tempdir = tempfile.mkdtemp()
try:
SerializableProxies.serialized_path = tempdir
@@ -828,7 +829,7 @@
abc = String("abc")
abc_copy = copy.copy(abc)
self.assertEqual(id(abc), id(abc_copy))
-
+
fruits = ArrayList([String("apple"), String("banana")])
fruits_copy = copy.copy(fruits)
self.assertEqual(fruits, fruits_copy)
@@ -939,7 +940,8 @@
SysIntegrationTest,
TreePathTest,
UnicodeTest,
- SingleMethodInterfaceTest)
+ SingleMethodInterfaceTest,
+ )
if __name__ == "__main__":
test_main()
diff --git a/tests/java/ProxyDeserialization.java b/tests/java/javatests/ProxyDeserialization.java
rename from tests/java/ProxyDeserialization.java
rename to tests/java/javatests/ProxyDeserialization.java
--- a/tests/java/ProxyDeserialization.java
+++ b/tests/java/javatests/ProxyDeserialization.java
@@ -1,8 +1,8 @@
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.concurrent.Callable;
+package javatests;
+
import java.io.FileInputStream;
import java.io.ObjectInputStream;
+import java.util.concurrent.Callable;
public class ProxyDeserialization {
--
Repository URL: https://hg.python.org/jython
More information about the Jython-checkins
mailing list