--- a/langtools/test/jdk/jshell/KullaTesting.java Fri May 20 17:00:03 2016 -0700
+++ b/langtools/test/jdk/jshell/KullaTesting.java Sat May 21 22:32:08 2016 -0700
@@ -72,6 +72,7 @@
import static jdk.jshell.Snippet.Status.*;
import static org.testng.Assert.*;
import static jdk.jshell.Snippet.SubKind.METHOD_SUBKIND;
+import jdk.jshell.spi.ExecutionControl;
public class KullaTesting {
@@ -166,6 +167,21 @@
classpath = new ArrayList<>();
}
+ public void setUp(ExecutionControl ec) {
+ inStream = new TestingInputStream();
+ outStream = new ByteArrayOutputStream();
+ errStream = new ByteArrayOutputStream();
+ state = JShell.builder()
+ .executionEngine(ec)
+ .in(inStream)
+ .out(new PrintStream(outStream))
+ .err(new PrintStream(errStream))
+ .build();
+ allSnippets = new LinkedHashSet<>();
+ idToSnippet = new LinkedHashMap<>();
+ classpath = new ArrayList<>();
+ }
+
@AfterMethod
public void tearDown() {
if (state != null) state.close();