1117N/A/*
1117N/A * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
1117N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1117N/A *
1117N/A * This code is free software; you can redistribute it and/or modify it
1117N/A * under the terms of the GNU General Public License version 2 only, as
1117N/A * published by the Free Software Foundation.
1117N/A *
1117N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1117N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1117N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1117N/A * version 2 for more details (a copy is included in the LICENSE file that
1117N/A * accompanied this code).
1117N/A *
1117N/A * You should have received a copy of the GNU General Public License version
1117N/A * 2 along with this work; if not, write to the Free Software Foundation,
1117N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1117N/A *
1117N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1117N/A * or visit www.oracle.com if you need additional information or have any
1117N/A * questions.
1117N/A */
1117N/A
1117N/A/**
1117N/A * @test
1117N/A * @bug 7091528
1117N/A * @summary javadoc attempts to parse .class files
1117N/A * @compile p/C1.java p/q/C2.java
1117N/A * @run main T7091528
1117N/A */
1117N/A
1117N/Aimport java.io.File;
1117N/Aimport java.io.PrintWriter;
1117N/Aimport java.io.StringWriter;
1117N/A
1117N/Apublic class T7091528 {
1117N/A public static void main(String... args) {
1117N/A new T7091528().run();
1117N/A }
1117N/A
1117N/A void run() {
1117N/A File testSrc = new File(System.getProperty("test.src"));
1117N/A File testClasses = new File(System.getProperty("test.classes"));
1117N/A String[] args = {
1117N/A "-d", ".",
1117N/A "-sourcepath", testClasses + File.pathSeparator + testSrc,
1117N/A "-subpackages",
1117N/A "p"
1117N/A };
1117N/A
1117N/A StringWriter sw = new StringWriter();
1117N/A PrintWriter pw = new PrintWriter(sw);
1117N/A String doclet = com.sun.tools.doclets.standard.Standard.class.getName();
1117N/A int rc = com.sun.tools.javadoc.Main.execute("javadoc", pw, pw, pw, doclet, args);
1117N/A pw.close();
1117N/A
1117N/A String out = sw.toString();
1117N/A if (!out.isEmpty()) {
1117N/A System.err.println(out);
1117N/A }
1117N/A
1117N/A if (rc != 0)
1117N/A System.err.println("javadoc failed: exit code = " + rc);
1117N/A
1117N/A if (out.matches("(?s).*p/[^ ]+\\.class.*"))
1117N/A throw new Error("reading .class files");
1117N/A
1117N/A if (!new File("index.html").exists())
1117N/A throw new Error("index.html not found");
1117N/A }
1117N/A}