@Test public void testEvalPyClassIsExcluded() throws Exception { PythonExecutor executor = getPythonExecutor(); PythonEvaluationResult pythonEvaluationResult = executor.eval(PY_CLASS_IS_EXCLUDED_SCRIPT, "'hello'" , EMPTY_CALL_ARGUMENTS); Assert.assertEquals(EXPECTED_CONTEXT_EVAL, pythonEvaluationResult.getResultContext()); }
public PythonEvaluationResult eval(String prepareEnvironmentScript, String expr, Map<String, Serializable> context) { checkValidInterpreter(); try { initInterpreter(); prepareInterpreterContext(context); return new PythonEvaluationResult(eval(prepareEnvironmentScript, expr), getPythonLocals()); } catch (PyException exception) { throw new RuntimeException("Error in running script expression: '" + getTruncatedExpression(expr) + "',\n\tException is: " + handleExceptionSpecialCases(exception.value.toString()), exception); } catch (Exception exception) { throw new RuntimeException("Error in running script expression: '" + getTruncatedExpression(expr) + "',\n\tException is: " + handleExceptionSpecialCases(exception.getMessage()), exception); } }
PythonExecutor implements Executor { public PythonEvaluationResult eval(String prepareEnvironmentScript, String expr, Map<String, Serializable> context) { checkValidInterpreter(); try { initInterpreter(); prepareInterpreterContext(context); return new PythonEvaluationResult(eval(prepareEnvironmentScript, expr), getPythonLocals()); } catch (PyException exception) { throw new RuntimeException("Error in running script expression: '" + getTruncatedExpression(expr) + "',\n\tException is: " + handleExceptionSpecialCases(exception.value.toString()), exception); } catch (Exception exception) { throw new RuntimeException("Error in running script expression: '" + getTruncatedExpression(expr) + "',\n\tException is: " + handleExceptionSpecialCases(exception.getMessage()), exception); } } }
PythonExecutor implements Executor { public PythonEvaluationResult eval(String prepareEnvironmentScript, String expr, Map<String, Serializable> context) { checkValidInterpreter(); try { initInterpreter(); prepareInterpreterContext(context); return new PythonEvaluationResult(eval(prepareEnvironmentScript, expr), getPythonLocals()); } catch (PyException exception) { throw new RuntimeException("Error in running script expression: '" + getTruncatedExpression(expr) + "',\n\tException is: " + handleExceptionSpecialCases(exception.value.toString()), exception); } catch (Exception exception) { throw new RuntimeException("Error in running script expression: '" + getTruncatedExpression(expr) + "',\n\tException is: " + handleExceptionSpecialCases(exception.getMessage()), exception); } } PythonExecutor();  PythonExecutor(Set<String> dependencies); }
PythonExecutor implements Executor { public PythonEvaluationResult eval(String prepareEnvironmentScript, String expr, Map<String, Serializable> context) { checkValidInterpreter(); try { initInterpreter(); prepareInterpreterContext(context); return new PythonEvaluationResult(eval(prepareEnvironmentScript, expr), getPythonLocals()); } catch (PyException exception) { throw new RuntimeException("Error in running script expression: '" + getTruncatedExpression(expr) + "',\n\tException is: " + handleExceptionSpecialCases(exception.value.toString()), exception); } catch (Exception exception) { throw new RuntimeException("Error in running script expression: '" + getTruncatedExpression(expr) + "',\n\tException is: " + handleExceptionSpecialCases(exception.getMessage()), exception); } } PythonExecutor();  PythonExecutor(Set<String> dependencies); PythonExecutionResult exec(String script, Map<String, Serializable> callArguments); PythonEvaluationResult eval(String prepareEnvironmentScript, String expr, Map<String, Serializable> context); @Override void allocate(); @Override void release(); @Override void close(); boolean isClosed(); }
PythonExecutor implements Executor { public PythonEvaluationResult eval(String prepareEnvironmentScript, String expr, Map<String, Serializable> context) { checkValidInterpreter(); try { initInterpreter(); prepareInterpreterContext(context); return new PythonEvaluationResult(eval(prepareEnvironmentScript, expr), getPythonLocals()); } catch (PyException exception) { throw new RuntimeException("Error in running script expression: '" + getTruncatedExpression(expr) + "',\n\tException is: " + handleExceptionSpecialCases(exception.value.toString()), exception); } catch (Exception exception) { throw new RuntimeException("Error in running script expression: '" + getTruncatedExpression(expr) + "',\n\tException is: " + handleExceptionSpecialCases(exception.getMessage()), exception); } } PythonExecutor();  PythonExecutor(Set<String> dependencies); PythonExecutionResult exec(String script, Map<String, Serializable> callArguments); PythonEvaluationResult eval(String prepareEnvironmentScript, String expr, Map<String, Serializable> context); @Override void allocate(); @Override void release(); @Override void close(); boolean isClosed(); static final String THREADED_MODULES_ISSUE; static final int RETRIES_NUMBER_ON_THREADED_ISSUE; static final int MAX_LENGTH; }