T6411310.java revision 1451
286N/A/*
286N/A * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
286N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
286N/A *
286N/A * This code is free software; you can redistribute it and/or modify it
286N/A * under the terms of the GNU General Public License version 2 only, as
286N/A * published by the Free Software Foundation.
286N/A *
286N/A * This code is distributed in the hope that it will be useful, but WITHOUT
286N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
286N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
286N/A * version 2 for more details (a copy is included in the LICENSE file that
286N/A * accompanied this code).
286N/A *
286N/A * You should have received a copy of the GNU General Public License version
286N/A * 2 along with this work; if not, write to the Free Software Foundation,
286N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
286N/A *
286N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
286N/A * or visit www.oracle.com if you need additional information or have any
286N/A * questions.
286N/A */
286N/A
286N/A/*
286N/A * @test
286N/A * @bug 6411310
286N/A * @summary JSR 199: FileObject should support user-friendly names via getName()
286N/A * @author Peter von der Ah\u00e9
286N/A * @library ../lib
286N/A * @build ToolTester
286N/A * @compile T6411310.java
286N/A * @run main T6411310
286N/A */
286N/A
286N/Aimport java.io.IOException;
286N/Aimport javax.tools.JavaFileObject;
286N/Aimport static javax.tools.StandardLocation.PLATFORM_CLASS_PATH;
286N/Aimport static javax.tools.StandardLocation.CLASS_PATH;
286N/Aimport static javax.tools.JavaFileObject.Kind.CLASS;
286N/A
286N/A// Limited test while we wait for 6419926: 6419926 is now closed
286N/A
286N/Apublic class T6411310 extends ToolTester {
286N/A
286N/A void test(String... args) throws IOException {
286N/A JavaFileObject file = fm.getJavaFileForInput(PLATFORM_CLASS_PATH,
286N/A "java.lang.Object",
286N/A CLASS);
286N/A String fileName = file.getName();
286N/A if (!fileName.matches(".*java/lang/Object.class\\)?")) {
286N/A System.err.println(fileName);
286N/A throw new AssertionError(file);
286N/A }
286N/A }
286N/A
286N/A public static void main(String... args) throws IOException {
286N/A new T6411310().test(args);
286N/A }
286N/A}
286N/A