--- old/test/jdk/jshell/StartOptionTest.java 2016-08-18 00:26:31.955469497 -0700 +++ new/test/jdk/jshell/StartOptionTest.java 2016-08-18 00:26:31.862467109 -0700 @@ -22,7 +22,7 @@ */ /* - * @test 8151754 8080883 + * @test 8151754 8080883 8160089 * @summary Testing start-up options. * @modules jdk.compiler/com.sun.tools.javac.api * jdk.compiler/com.sun.tools.javac.main @@ -106,53 +106,54 @@ @Test public void testUsage() throws Exception { - start(s -> { - assertTrue(s.split("\n").length >= 7, "Not enough usage lines: " + s); - assertTrue(s.startsWith("Usage: jshell "), "Unexpect usage start: " + s); - }, null, "-help"); + for (String opt : new String[]{"-h", "--help"}) { + start(s -> { + assertTrue(s.split("\n").length >= 7, "Not enough usage lines: " + s); + assertTrue(s.startsWith("Usage: jshell "), "Unexpect usage start: " + s); + }, null, opt); + } } @Test public void testUnknown() throws Exception { - start(s -> { - assertTrue(s.split("\n").length >= 7, "Not enough usage lines (unknown): " + s); - assertTrue(s.startsWith("Usage: jshell "), "Unexpect usage start (unknown): " + s); - }, s -> assertEquals(s.trim(), "Unknown option: -unknown"), "-unknown"); + start(s -> { }, + s -> assertEquals(s.trim(), "Unknown option: u"), "-unknown"); + start(s -> { }, + s -> assertEquals(s.trim(), "Unknown option: unknown"), "--unknown"); } public void testStartup() throws Exception { Compiler compiler = new Compiler(); Path p = compiler.getPath("file.txt"); compiler.writeToFile(p); - start("", "'-startup' requires a filename argument.", "-startup"); - start("", "Only one -startup or -nostartup option may be used.", "-startup", p.toString(), "-startup", p.toString()); - start("", "Only one -startup or -nostartup option may be used.", "-nostartup", "-startup", p.toString()); - start("", "Only one -startup or -nostartup option may be used.", "-startup", p.toString(), "-nostartup"); - start("", "Only one -startup or -nostartup option may be used.", "-nostartup", "-nostartup"); - start("", "Only one -startup or -nostartup option may be used.", "-nostartup", "-startup"); + start("", "Argument to startup missing.", "--startup"); + start("", "Only one --startup or --no-startup option may be used.", "--startup", p.toString(), "--startup", p.toString()); + start("", "Only one --startup or --no-startup option may be used.", "--no-startup", "--startup", p.toString()); + start("", "Only one --startup or --no-startup option may be used.", "--startup", p.toString(), "--no-startup"); + start("", "Argument to startup missing.", "--no-startup", "--startup"); } public void testStartupUnknown() throws Exception { - start("", "File 'UNKNOWN' for '-startup' is not found.", "-startup", "UNKNOWN"); + start("", "File 'UNKNOWN' for '--startup' is not found.", "--startup", "UNKNOWN"); } @Test public void testClasspath() throws Exception { - for (String cp : new String[] {"-cp", "-classpath"}) { - start("", "Conflicting -classpath option.", cp, ".", "-classpath", "."); - start("", "Argument to -classpath missing.", cp); + for (String cp : new String[] {"--class-path"}) { + start("", "Only one --class-path option may be used.", cp, ".", "--class-path", "."); + start("", "Argument to class-path missing.", cp); } } @Test public void testNegFeedbackOption() throws Exception { - start("", "Argument to -feedback missing. Mode required.", "-feedback"); - start("", "Does not match any current feedback mode: blorp -- -feedback blorp", "-feedback", "blorp"); + start("", "Argument to feedback missing.", "--feedback"); + start("", "Does not match any current feedback mode: blorp -- --feedback blorp", "--feedback", "blorp"); } @Test public void testVersion() throws Exception { - start(s -> assertTrue(s.startsWith("jshell"), "unexpected version: " + s), null, "-version"); + start(s -> assertTrue(s.startsWith("jshell"), "unexpected version: " + s), null, "--version"); } @AfterMethod