InfoOptsTest.java (2933:49d207bf704d) InfoOptsTest.java (3117:404f1956145b)
1/*
2 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *

--- 34 unchanged lines hidden (view full) ---

43
44 @Test
45 void testInfoOpts() throws IOException {
46 testInfoOpt("-help", "-deprecation");
47 testInfoOpt("-X", "-Xlint");
48
49 String specVersion = System.getProperty("java.specification.version");
50 testInfoOpt("-version", "javac", specVersion);
1/*
2 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *

--- 34 unchanged lines hidden (view full) ---

43
44 @Test
45 void testInfoOpts() throws IOException {
46 testInfoOpt("-help", "-deprecation");
47 testInfoOpt("-X", "-Xlint");
48
49 String specVersion = System.getProperty("java.specification.version");
50 testInfoOpt("-version", "javac", specVersion);
51 testInfoOpt("-fullversion", "javac", specVersion, "-b");
51 testInfoOpt("-fullversion", "javac", specVersion, "+");
52 }
53
54 void testInfoOpt(String opt, String... expect) {
55 String[] opts = { opt };
56 String[] files = { };
57
58 runMain(opts, files)
59 .checkOK()
60 .checkLog(expect);
61
62 runCall(opts, files)
63 .checkIllegalArgumentException();
64
65 runParse(opts, files)
66 .checkIllegalArgumentException();
67 }
68}
52 }
53
54 void testInfoOpt(String opt, String... expect) {
55 String[] opts = { opt };
56 String[] files = { };
57
58 runMain(opts, files)
59 .checkOK()
60 .checkLog(expect);
61
62 runCall(opts, files)
63 .checkIllegalArgumentException();
64
65 runParse(opts, files)
66 .checkIllegalArgumentException();
67 }
68}