5252import java .util .Arrays ;
5353import java .util .List ;
5454
55- import com .oracle .graal .python .runtime .interop .InteropArray ;
56- import com .oracle .graal .python .test .PythonTests ;
57- import com .oracle .truffle .api .interop .ArityException ;
58- import com .oracle .truffle .api .interop .InteropLibrary ;
59- import com .oracle .truffle .api .interop .TruffleObject ;
60- import com .oracle .truffle .api .interop .UnknownIdentifierException ;
61- import com .oracle .truffle .api .library .ExportLibrary ;
62- import com .oracle .truffle .api .library .ExportMessage ;
63-
6455import org .graalvm .polyglot .Context ;
6556import org .graalvm .polyglot .Context .Builder ;
6657import org .graalvm .polyglot .Engine ;
7667import org .junit .runners .Parameterized .Parameter ;
7768import org .junit .runners .Parameterized .Parameters ;
7869
70+ import com .oracle .graal .python .runtime .interop .InteropArray ;
71+ import com .oracle .graal .python .test .PythonTests ;
72+ import com .oracle .truffle .api .interop .ArityException ;
73+ import com .oracle .truffle .api .interop .InteropLibrary ;
74+ import com .oracle .truffle .api .interop .TruffleObject ;
75+ import com .oracle .truffle .api .interop .UnknownIdentifierException ;
76+ import com .oracle .truffle .api .library .ExportLibrary ;
77+ import com .oracle .truffle .api .library .ExportMessage ;
78+
7979@ RunWith (Enclosed .class )
8080public class JavaInteropTest {
8181 public static class GeneralInterop extends PythonTests {
@@ -89,6 +89,7 @@ public void setUpTest() {
8989 out = new ByteArrayOutputStream ();
9090 err = new ByteArrayOutputStream ();
9191 Builder builder = Context .newBuilder ();
92+ builder .allowExperimentalOptions (true );
9293 builder .allowAllAccess (true );
9394 builder .out (out );
9495 builder .err (err );
@@ -113,7 +114,7 @@ public void evalFailsOnError() {
113114
114115 @ Test
115116 public void evalNonInteractiveThrowsSyntaxError () throws IOException {
116- try (Context c = Context .newBuilder ().allowAllAccess (true ).option ("python.TerminalIsInteractive" , "false" ).build ()) {
117+ try (Context c = Context .newBuilder ().allowExperimentalOptions ( true ). allowAllAccess (true ).option ("python.TerminalIsInteractive" , "false" ).build ()) {
117118 c .eval (Source .newBuilder ("python" , INCOMPLETE_SOURCE , "eval" ).interactive (false ).build ());
118119 } catch (PolyglotException t ) {
119120 assertTrue (t .isSyntaxError ());
@@ -125,7 +126,7 @@ public void evalNonInteractiveThrowsSyntaxError() throws IOException {
125126
126127 @ Test
127128 public void evalNonInteractiveInInteractiveTerminalThrowsSyntaxError () throws IOException {
128- try (Context c = Context .newBuilder ().allowAllAccess (true ).option ("python.TerminalIsInteractive" , "true" ).build ()) {
129+ try (Context c = Context .newBuilder ().allowExperimentalOptions ( true ). allowAllAccess (true ).option ("python.TerminalIsInteractive" , "true" ).build ()) {
129130 c .eval (Source .newBuilder ("python" , INCOMPLETE_SOURCE , "eval" ).interactive (false ).build ());
130131 } catch (PolyglotException t ) {
131132 assertTrue (t .isSyntaxError ());
@@ -137,7 +138,7 @@ public void evalNonInteractiveInInteractiveTerminalThrowsSyntaxError() throws IO
137138
138139 @ Test
139140 public void evalInteractiveInNonInteractiveTerminalThrowsSyntaxError () throws IOException {
140- try (Context c = Context .newBuilder ().allowAllAccess (true ).option ("python.TerminalIsInteractive" , "false" ).build ()) {
141+ try (Context c = Context .newBuilder ().allowExperimentalOptions ( true ). allowAllAccess (true ).option ("python.TerminalIsInteractive" , "false" ).build ()) {
141142 c .eval (Source .newBuilder ("python" , INCOMPLETE_SOURCE , "eval" ).interactive (true ).build ());
142143 } catch (PolyglotException t ) {
143144 assertTrue (t .isSyntaxError ());
@@ -149,7 +150,7 @@ public void evalInteractiveInNonInteractiveTerminalThrowsSyntaxError() throws IO
149150
150151 @ Test
151152 public void evalInteractiveInInteractiveTerminalThrowsSyntaxError () throws IOException {
152- try (Context c = Context .newBuilder ().allowAllAccess (true ).option ("python.TerminalIsInteractive" , "true" ).build ()) {
153+ try (Context c = Context .newBuilder ().allowExperimentalOptions ( true ). allowAllAccess (true ).option ("python.TerminalIsInteractive" , "true" ).build ()) {
153154 c .eval (Source .newBuilder ("python" , INCOMPLETE_SOURCE , "eval" ).interactive (true ).build ());
154155 } catch (PolyglotException t ) {
155156 assertTrue (t .isSyntaxError ());
@@ -513,7 +514,7 @@ static class OptionsChecker {
513514 private Builder builder ;
514515
515516 OptionsChecker (String option , String code , String ... values ) {
516- this .builder = Context .newBuilder ("python" ).engine (engine ).allowAllAccess (true );
517+ this .builder = Context .newBuilder ("python" ).engine (engine ).allowExperimentalOptions ( true ). allowAllAccess (true );
517518 this .option = "python." + option ;
518519 this .source = Source .create ("python" , code );
519520 this .values = values ;
0 commit comments