T6729471.java revision 385
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * This code is free software; you can redistribute it and/or modify it
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * under the terms of the GNU General Public License version 2 only, as
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * published by the Free Software Foundation.
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * This code is distributed in the hope that it will be useful, but WITHOUT
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * version 2 for more details (a copy is included in the LICENSE file that
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * accompanied this code).
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * You should have received a copy of the GNU General Public License version
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * 2 along with this work; if not, write to the Free Software Foundation,
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * CA 95054 USA or visit www.sun.com if you need additional information or
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * have any questions.
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * @bug 6729471
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * @summary javap does not output inner interfaces of an interface
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith // simple class
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith "public abstract boolean containsKey(java.lang.Object)");
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith // inner class
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith "public abstract K getKey()");
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith verify("../classes/tools/javap/T6729471.class",
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith "public static void main(java.lang.String...)");
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith verify("file:../classes/tools/javap/T6729471.class",
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith "public static void main(java.lang.String...)");
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith // jar url: rt.jar
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith File java_home = new File(System.getProperty("java.home"));
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith File rt_jar = new File(new File(new File(java_home, "jre"), "lib"), "rt.jar");
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith verify("jar:" + rt_jar.toURL() + "!/java/util/Map.class",
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith "public abstract boolean containsKey(java.lang.Object)");
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith // jar url: ct.sym, if it exists
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith File ct_sym = new File(new File(java_home, "lib"), "ct.sym");
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith verify("jar:" + ct_sym.toURL() + "!/META-INF/sym/rt.jar/java/util/Map.class",
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith "public abstract boolean containsKey(java.lang.Object)");
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith System.err.println("warning: ct.sym not found");
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith void verify(String className, String... expects) {
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith String testClasses = System.getProperty("test.classes", ".");
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith String[] args = { "-classpath", testClasses, className };