}
public void testGetInterfaceCharSequence1() throws ScriptException, IOException {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("python");
Invocable invocableEngine = (Invocable) engine;
assertNull(engine.eval(
"from java.lang import CharSequence\n" +
"class MyString(CharSequence):\n" +
" def length(self): return 3\n" +
" def charAt(self, index): return 'a'\n" +
" def subSequence(self, start, end): return \"\"\n" +
" def toString(self): return \"aaa\"\n" +
"c = MyString()"));
CharSequence seq = invocableEngine.getInterface(engine.get("c"), CharSequence.class);
assertEquals("aaa", seq.toString());
}