2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2014-04-16 23:17:09 +00:00
|
|
|
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
2007-12-01 00:00:00 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 only, as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
* accompanied this code).
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License version
|
|
|
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
2010-05-25 22:54:51 +00:00
|
|
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
* or visit www.oracle.com if you need additional information or have any
|
|
|
|
* questions.
|
2007-12-01 00:00:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @test
|
|
|
|
* @bug 4904075 4774450 5015144
|
|
|
|
* @summary Reference unnamed package as "Unnamed", not empty string.
|
|
|
|
* Generate a package summary for the unnamed package.
|
|
|
|
* @author jamieh
|
|
|
|
* @library ../lib/
|
|
|
|
* @build JavadocTester
|
|
|
|
* @build TestUnnamedPackage
|
|
|
|
* @run main TestUnnamedPackage
|
|
|
|
*/
|
|
|
|
|
|
|
|
public class TestUnnamedPackage extends JavadocTester {
|
|
|
|
|
|
|
|
//Javadoc arguments.
|
|
|
|
private static final String[] ARGS = new String[] {
|
2014-04-23 00:57:40 +00:00
|
|
|
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, SRC_DIR + "/C.java"
|
2007-12-01 00:00:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//Input for string search tests.
|
|
|
|
private static final String[][] TEST = {
|
2014-04-23 00:57:40 +00:00
|
|
|
{ "package-summary.html",
|
2010-12-01 19:02:38 +00:00
|
|
|
"<h1 title=\"Package\" class=\"title\">Package <Unnamed></h1>"
|
2007-12-01 00:00:00 +00:00
|
|
|
},
|
2014-04-23 00:57:40 +00:00
|
|
|
{ "package-summary.html",
|
2007-12-01 00:00:00 +00:00
|
|
|
"This is a package comment for the unnamed package."
|
|
|
|
},
|
2014-04-23 00:57:40 +00:00
|
|
|
{ "package-summary.html",
|
2007-12-01 00:00:00 +00:00
|
|
|
"This is a class in the unnamed package."
|
|
|
|
},
|
2014-04-23 00:57:40 +00:00
|
|
|
{ "package-tree.html",
|
2010-12-01 19:02:38 +00:00
|
|
|
"<h1 class=\"title\">Hierarchy For Package <Unnamed></h1>"
|
2007-12-01 00:00:00 +00:00
|
|
|
},
|
2014-04-23 00:57:40 +00:00
|
|
|
{ "index-all.html",
|
2007-12-01 00:00:00 +00:00
|
|
|
"title=\"class in <Unnamed>\""
|
|
|
|
},
|
2014-04-23 00:57:40 +00:00
|
|
|
{ "C.html", "<a href=\"package-summary.html\">"}
|
2007-12-01 00:00:00 +00:00
|
|
|
};
|
|
|
|
private static final String[][] NEGATED_TEST = {
|
|
|
|
{ERROR_OUTPUT, "BadSource"},
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The entry point of the test.
|
|
|
|
* @param args the array of command line arguments.
|
|
|
|
*/
|
|
|
|
public static void main(String[] args) {
|
|
|
|
TestUnnamedPackage tester = new TestUnnamedPackage();
|
2014-04-19 00:25:43 +00:00
|
|
|
tester.run(ARGS, TEST, NEGATED_TEST);
|
2007-12-01 00:00:00 +00:00
|
|
|
tester.printSummary();
|
|
|
|
}
|
|
|
|
}
|