test/langtools/tools/javadoc/BadOptionsTest.java
changeset 49822 53aae0c219e6
parent 47216 71c04702a3d5
equal deleted inserted replaced
49821:02c08e20d66c 49822:53aae0c219e6
     1 /*
     1 /*
     2  * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    94                 .options("--add-modules", "")
    94                 .options("--add-modules", "")
    95                 .files(src.resolve("C.java"))
    95                 .files(src.resolve("C.java"))
    96                 .run(Task.Expect.FAIL)
    96                 .run(Task.Expect.FAIL)
    97                 .writeAll();
    97                 .writeAll();
    98         checkFound(result.getOutput(Task.OutputKind.DIRECT),
    98         checkFound(result.getOutput(Task.OutputKind.DIRECT),
    99                 "javadoc: error - no value for --add-modules option");
    99                 "javadoc: error - error: no value for --add-modules option");
   100         checkNotFound(result, "Exception", "at jdk.javadoc/");
   100         checkNotFound(result, "Exception", "at jdk.javadoc/");
   101     }
   101     }
   102 
   102 
   103     @Test
   103     @Test
   104     public void testAddModulesBadName() {
   104     public void testAddModulesBadName() {
   120                 .options("--add-exports", "")
   120                 .options("--add-exports", "")
   121                 .files(src.resolve("C.java"))
   121                 .files(src.resolve("C.java"))
   122                 .run(Task.Expect.FAIL)
   122                 .run(Task.Expect.FAIL)
   123                 .writeAll();
   123                 .writeAll();
   124         checkFound(result.getOutput(Task.OutputKind.DIRECT),
   124         checkFound(result.getOutput(Task.OutputKind.DIRECT),
   125                 "javadoc: error - no value for --add-exports option");
   125                 "javadoc: error - error: no value for --add-exports option");
   126         checkNotFound(result, "Exception", "at jdk.javadoc/");
   126         checkNotFound(result, "Exception", "at jdk.javadoc/");
   127     }
   127     }
   128 
   128 
   129     @Test
   129     @Test
   130     public void testAddExportsBadArg() {
   130     public void testAddExportsBadArg() {
   133                 .options("--add-exports", "m/p")
   133                 .options("--add-exports", "m/p")
   134                 .files(src.resolve("C.java"))
   134                 .files(src.resolve("C.java"))
   135                 .run(Task.Expect.FAIL)
   135                 .run(Task.Expect.FAIL)
   136                 .writeAll();
   136                 .writeAll();
   137         checkFound(result.getOutput(Task.OutputKind.DIRECT),
   137         checkFound(result.getOutput(Task.OutputKind.DIRECT),
   138                 "javadoc: error - bad value for --add-exports option");
   138                 "javadoc: error - error: bad value for --add-exports option: 'm/p'");
   139         checkNotFound(result, "Exception", "at jdk.javadoc/");
   139         checkNotFound(result, "Exception", "at jdk.javadoc/");
   140     }
   140     }
   141 
   141 
   142     @Test
   142     @Test
   143     public void testAddExportsBadName() {
   143     public void testAddExportsBadName() {