equal
deleted
inserted
replaced
29 * @run testng JdiBadOptionLaunchExecutionControlTest |
29 * @run testng JdiBadOptionLaunchExecutionControlTest |
30 */ |
30 */ |
31 |
31 |
32 import org.testng.annotations.Test; |
32 import org.testng.annotations.Test; |
33 import jdk.jshell.JShell; |
33 import jdk.jshell.JShell; |
34 import jdk.jshell.execution.JdiDefaultExecutionControl; |
|
35 import static org.testng.Assert.assertTrue; |
34 import static org.testng.Assert.assertTrue; |
36 import static org.testng.Assert.fail; |
35 import static org.testng.Assert.fail; |
37 |
36 |
38 @Test |
37 @Test |
39 public class JdiBadOptionLaunchExecutionControlTest { |
38 public class JdiBadOptionLaunchExecutionControlTest { |
42 "Launching JShell execution engine threw: Failed remote launch: java.util.concurrent.ExecutionException: com.sun.jdi.connect.VMStartException: VM initialization failed"; |
41 "Launching JShell execution engine threw: Failed remote launch: java.util.concurrent.ExecutionException: com.sun.jdi.connect.VMStartException: VM initialization failed"; |
43 |
42 |
44 public void badOptionLaunchTest() { |
43 public void badOptionLaunchTest() { |
45 try { |
44 try { |
46 JShell.builder() |
45 JShell.builder() |
47 .executionEngine(JdiDefaultExecutionControl.launch()) |
46 .executionEngine("jdi:launch(true)") |
48 .remoteVMOptions("-BadBadOption") |
47 .remoteVMOptions("-BadBadOption") |
49 .build(); |
48 .build(); |
50 } catch (IllegalStateException ex) { |
49 } catch (IllegalStateException ex) { |
51 assertTrue(ex.getMessage().startsWith(EXPECTED_ERROR), ex.getMessage()); |
50 assertTrue(ex.getMessage().startsWith(EXPECTED_ERROR), ex.getMessage()); |
52 return; |
51 return; |