test/tools/javap/T6715753.java

Tue, 01 Sep 2009 11:35:00 -0700

author
jjg
date
Tue, 01 Sep 2009 11:35:00 -0700
changeset 397
40a1327a5283
parent 66
df47f7f4c95a
child 525
9871ce4fd56f
permissions
-rw-r--r--

6877763: update langtools/test/Makefile for JPRT
Reviewed-by: ohair

jjg@66 1 /*
jjg@66 2 * Copyright 2008 Sun Microsystems, Inc. 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 *
jjg@66 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
jjg@66 20 * CA 95054 USA or visit www.sun.com if you need additional information or
jjg@66 21 * have any 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@66 50 }

mercurial