T6421756.java revision 1732:e39669aea0bd
1232540Shselasky/*
2232540Shselasky * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
3232540Shselasky * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4232540Shselasky *
5232540Shselasky * This code is free software; you can redistribute it and/or modify it
6232540Shselasky * under the terms of the GNU General Public License version 2 only, as
7232540Shselasky * published by the Free Software Foundation.
8232540Shselasky *
9232540Shselasky * This code is distributed in the hope that it will be useful, but WITHOUT
10232540Shselasky * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11232540Shselasky * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12232540Shselasky * version 2 for more details (a copy is included in the LICENSE file that
13232540Shselasky * accompanied this code).
14232540Shselasky *
15232540Shselasky * You should have received a copy of the GNU General Public License version
16232540Shselasky * 2 along with this work; if not, write to the Free Software Foundation,
17232540Shselasky * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18232540Shselasky *
19232540Shselasky * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20232540Shselasky * or visit www.oracle.com if you need additional information or have any
21232540Shselasky * questions.
22232540Shselasky */
23232540Shselasky
24232540Shselasky/*
25232540Shselasky * @test
26232540Shselasky * @bug     6421756
27232540Shselasky * @summary 6421756 JSR 199: In the method JavaCompilerTool.getTask 'options' can be supplied in the place of 'classes'
28232540Shselasky * @author  Peter von der Ah\u00e9
29232540Shselasky * @library ../lib
30232540Shselasky * @build ToolTester
31232540Shselasky * @compile T6421756.java
32232540Shselasky * @run main T6421756
33232540Shselasky */
34232540Shselasky
35232540Shselaskyimport java.util.Collections;
36232540Shselasky
37232540Shselaskypublic class T6421756 extends ToolTester {
38232540Shselasky    void test(String... args) {
39232540Shselasky        Iterable<String> options = Collections.singleton("-verbose");
40232540Shselasky        try {
41232540Shselasky            task = tool.getTask(null, fm, null, null, options, null);
42232540Shselasky            throw new AssertionError("Expected IllegalArgumentException!");
43        } catch (IllegalArgumentException e) {
44            System.out.println("OK: got expected error " + e.getLocalizedMessage());
45        }
46    }
47    public static void main(String... args) {
48        new T6421756().test(args);
49    }
50}
51