test/tools/javap/InvalidOptions.java

changeset 2289
3fbda1dca565
parent 2181
658861d1b36e
child 2525
2eb010b6cb22
equal deleted inserted replaced
2288:4267f38a1706 2289:3fbda1dca565
22 */ 22 */
23 23
24 /* 24 /*
25 * @test 25 * @test
26 * @bug 8027411 26 * @bug 8027411
27 * @summary test invalid options -h and -b 27 * @summary test an invalid option
28 */ 28 */
29 29
30 import java.io.*; 30 import java.io.*;
31 import java.util.zip.*; 31 import java.util.zip.*;
32 32
37 public static void main(String[] args) throws Exception { 37 public static void main(String[] args) throws Exception {
38 new InvalidOptions().run(); 38 new InvalidOptions().run();
39 } 39 }
40 40
41 void run() throws Exception { 41 void run() throws Exception {
42 test(2, "-h", "Error: -h is no longer available - use the javah program");
43 test(2, "-b", "Error: unknown option: -b", 42 test(2, "-b", "Error: unknown option: -b",
44 "Usage: javap <options> <classes>", 43 "Usage: javap <options> <classes>",
45 "use -help for a list of possible options"); 44 "use -help for a list of possible options");
46 if (errorCount > 0) 45 if (errorCount > 0)
47 throw new Exception(errorCount + " errors received"); 46 throw new Exception(errorCount + " errors received");

mercurial