test/tools/javap/T6715753.java

Mon, 31 Aug 2015 13:37:01 -0700

author
asaha
date
Mon, 31 Aug 2015 13:37:01 -0700
changeset 2971
153d0309e698
parent 798
4868a36f6fd8
child 2525
2eb010b6cb22
permissions
-rw-r--r--

Added tag jdk8u65-b12 for changeset 54e958a3719e

jjg@66 1 /*
ohair@798 2 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
jjg@66 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jjg@66 4 *
jjg@66 5 * This code is free software; you can redistribute it and/or modify it
jjg@66 6 * under the terms of the GNU General Public License version 2 only, as
jjg@66 7 * published by the Free Software Foundation.
jjg@66 8 *
jjg@66 9 * This code is distributed in the hope that it will be useful, but WITHOUT
jjg@66 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jjg@66 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
jjg@66 12 * version 2 for more details (a copy is included in the LICENSE file that
jjg@66 13 * accompanied this code).
jjg@66 14 *
jjg@66 15 * You should have received a copy of the GNU General Public License version
jjg@66 16 * 2 along with this work; if not, write to the Free Software Foundation,
jjg@66 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jjg@66 18 *
ohair@554 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@554 20 * or visit www.oracle.com if you need additional information or have any
ohair@554 21 * questions.
jjg@66 22 */
jjg@66 23
jjg@66 24 import java.io.*;
jjg@66 25
jjg@66 26 /*
jjg@66 27 * @test
jjg@66 28 * @bug 6715753
jjg@66 29 * @summary Use javap to inquire about a specific inner class
jjg@66 30 */
jjg@66 31
jjg@66 32 public class T6715753 {
jjg@66 33 public static void main(String... args) throws Exception {
jjg@66 34 new T6715753().run();
jjg@66 35 }
jjg@66 36
jjg@66 37 void run() throws Exception {
jjg@66 38 StringWriter sw = new StringWriter();
jjg@66 39 PrintWriter pw = new PrintWriter(sw);
jjg@66 40 String[] args = { "-notAnOption" };
jjg@66 41 int rc = com.sun.tools.javap.Main.run(args, pw);
jjg@66 42 String log = sw.toString();
jjg@66 43 if (rc == 0
jjg@66 44 || log.indexOf("-notAnOption") == -1
jjg@66 45 || log.indexOf("javap") == -1) { // locale-independent indication of usage message
jjg@66 46 System.err.println("rc: " + rc + ", log=\n" + log);
jjg@66 47 throw new Exception("test failed");
jjg@66 48 }
jjg@66 49 }
jjg@525 50 }

mercurial