|
46 | 46 | import org.junit.After; |
47 | 47 | import org.junit.Before; |
48 | 48 | import org.junit.Test; |
| 49 | +import org.python.jsr223.PyScriptEngine; |
49 | 50 | import org.scijava.Context; |
50 | 51 | import org.scijava.script.ScriptLanguage; |
51 | 52 | import org.scijava.script.ScriptModule; |
@@ -87,7 +88,7 @@ public void testBasic() throws InterruptedException, ExecutionException, |
87 | 88 | public void testLocals() throws ScriptException { |
88 | 89 | final ScriptLanguage language = scriptService.getLanguageByExtension("py"); |
89 | 90 | final ScriptEngine engine = language.getScriptEngine(); |
90 | | - assertEquals(JythonScriptEngine.class, engine.getClass()); |
| 91 | + assertEquals(PyScriptEngine.class, engine.getClass()); |
91 | 92 | engine.put("hello", 17); |
92 | 93 | assertEquals(17, language.decode(engine.eval("hello"))); |
93 | 94 | assertEquals(17, language.decode(engine.get("hello"))); |
@@ -117,20 +118,20 @@ public void testParameters() throws InterruptedException, ExecutionException, |
117 | 118 | * Tests that variables assigned a primitive long value have the expected |
118 | 119 | * type. |
119 | 120 | * <p> |
120 | | - * There is a crazy bug in {@link org.python.jsr223.PyScriptEngine}, which |
121 | | - * results in variables assigned a long primitive to somehow end up as (or |
| 121 | + * There was a crazy bug in {@link PyScriptEngine} version 2.5.3, which |
| 122 | + * resulted in variables assigned a long primitive to somehow end up as (or |
122 | 123 | * appearing to end up as) {@link java.math.BigInteger} instances instead. See |
123 | 124 | * <a href= |
124 | 125 | * "http://sourceforge.net/p/jython/mailman/jython-users/thread/54370FE9.5010603%40farowl.co.uk/" |
125 | 126 | * >this thread on the jython-users mailing list</a> for discussion. |
126 | 127 | * </p> |
127 | 128 | * <p> |
128 | | - * This test ensures that that specific problem gets flagged if it occurs. As |
129 | | - * long as we keep using our own Jython {@code ScriptEngine} implementation |
130 | | - * (i.e.: {@link org.scijava.plugins.scripting.jython.JythonScriptEngine}), |
131 | | - * the problem does not occur. But if we switch to the stock JSR-223 Jython |
132 | | - * {@code ScriptEngine} (i.e.: {@link org.python.jsr223.PyScriptEngine}), the |
133 | | - * problem manifests. See {@link JythonScriptLanguage#getScriptEngine()}. |
| 129 | + * This test ensures that that specific problem gets flagged if it recurs. |
| 130 | + * Previously, to avoid it, we used our own Jython {@code ScriptEngine} |
| 131 | + * implementation |
| 132 | + * ({@code org.scijava.plugins.scripting.jython.JythonScriptEngine}). But |
| 133 | + * since Jython 2.7.0, the stock JSR-223 Jython {@code ScriptEngine} (i.e.: |
| 134 | + * {@link org.python.jsr223.PyScriptEngine}) no longer has this issue. |
134 | 135 | * </p> |
135 | 136 | */ |
136 | 137 | @Test |
|
0 commit comments