8015663: Need to supply tests to provide javadoc for profiles support code coverage

Reviewed-by: jjg
This commit is contained in:
Evgeniya Stepanova 2013-08-30 17:36:47 -07:00 committed by Jonathan Gibbons
parent b8f8cab5f4
commit 4337286502
8 changed files with 273 additions and 5 deletions

View file

@ -25,7 +25,7 @@
* @test * @test
* @bug 8006124 8009684 8016921 8023700 * @bug 8006124 8009684 8016921 8023700
* @summary Test javadoc support for profiles. * @summary Test javadoc support for profiles.
* @author Bhavesh Patel * @author Bhavesh Patel, Evgeniya Stepanova
* @library ../lib/ * @library ../lib/
* @build JavadocTester TestProfiles * @build JavadocTester TestProfiles
* @run main TestProfiles * @run main TestProfiles
@ -38,8 +38,9 @@ public class TestProfiles extends JavadocTester {
private static final String PACKAGE_BUG_ID = BUG_ID + "-2"; private static final String PACKAGE_BUG_ID = BUG_ID + "-2";
//Javadoc arguments. //Javadoc arguments.
private static final String[] ARGS1 = new String[]{ private static final String[] ARGS1 = new String[]{
"-d", PROFILE_BUG_ID, "-sourcepath", SRC_DIR, "-Xprofilespath", SRC_DIR + FS "-d", PROFILE_BUG_ID, "-sourcepath", SRC_DIR, "-Xprofilespath",
+ "profile-rtjar-includes.txt", "pkg1", "pkg2", "pkg3", "pkg4", "pkg5" SRC_DIR + FS + "profile-rtjar-includes.txt", "pkg1", "pkg2",
"pkg3", "pkg4", "pkg5", "pkgDeprecated"
}; };
private static final String[] ARGS2 = new String[]{ private static final String[] ARGS2 = new String[]{
"-d", PACKAGE_BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2", "pkg3", "pkg4", "pkg5" "-d", PACKAGE_BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2", "pkg3", "pkg4", "pkg5"
@ -113,6 +114,49 @@ public class TestProfiles extends JavadocTester {
"target=\"classFrame\">compact2</a></li>" + NL + "<li><a href=\"" + "target=\"classFrame\">compact2</a></li>" + NL + "<li><a href=\"" +
"compact3-summary.html\" target=\"classFrame\">compact3</a></li>" + NL + "compact3-summary.html\" target=\"classFrame\">compact3</a></li>" + NL +
"</ul>" "</ul>"
},
//Test deprecated class in profiles
{PROFILE_BUG_ID + FS + "compact1-summary.html","<td class=\"colFirst\">"
+ "<a href=\"pkg2/Class1Pkg2.html\" title=\"class in pkg2\">Class1Pkg2</a></td>"
+ NL + "<td class=\"colLast\">Deprecated"
},
{PROFILE_BUG_ID + FS + "deprecated-list.html","<td class=\"colOne\">"
+ "<a href=\"pkg2/Class1Pkg2.html\" title=\"class in pkg2\">pkg2.Class1Pkg2</a>"
+ NL +"<div class=\"block\"><span class=\"italic\">Class1Pkg2. This class is deprecated</span></div>"
},
//Test deprecated package in profile
{PROFILE_BUG_ID + FS + "deprecated-list.html","<td class=\"colOne\">"
+ "<a href=\"pkgDeprecated/package-summary.html\">pkgDeprecated</a>"
+ NL +"<div class=\"block\"><span class=\"italic\">This package is <b>Deprecated</b>."
+ " Use pkg1.</span></div>"
},
{PROFILE_BUG_ID + FS + "pkgDeprecated" + FS + "package-summary.html",
"<div class=\"deprecatedContent\"><span class=\"strong\">Deprecated.</span>"
+ NL + "<div class=\"block\"><span class=\"italic\">This package is <b>Deprecated</b>."
+ " Use pkg1.</span></div>"
},
// need to add teststring when JDK-8015496 will be fixed
//Test exception in profiles
{PROFILE_BUG_ID + FS + "compact1-summary.html","<table class=\"packageSummary\" "
+ "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" "
+ "summary=\"Exception Summary table, listing exceptions, and an explanation\">"
+ NL + "<caption><span>Exception Summary</span><span class=\"tabEnd\">"
+ "&nbsp;</span></caption>" + NL + "<tr>" + NL + "<th class=\"colFirst\" "
+ "scope=\"col\">Exception</th>" + NL + "<th class=\"colLast\" scope=\"col\">"
+ "Description</th>" + NL + "</tr>" + NL + "<tbody>" + NL + "<tr class=\"altColor\">"
+ NL + "<td class=\"colFirst\"><a href=\"pkg2/ClassException.html\""
+ " title=\"class in pkg2\">ClassException</a></td>"
},
//Test errors in profiles
{PROFILE_BUG_ID + FS + "compact1-summary.html",
"<table class=\"packageSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" "
+ "summary=\"Error Summary table, listing errors, and an explanation\">"
+ NL + "<caption><span>Error Summary</span><span class=\"tabEnd\">&nbsp;"
+ "</span></caption>" + NL + "<tr>" + NL + "<th class=\"colFirst\""
+ " scope=\"col\">Error</th>" + NL + "<th class=\"colLast\" "
+ "scope=\"col\">Description</th>" + NL + "</tr>" + NL + "<tbody>"
+ NL + "<tr class=\"altColor\">" + NL + "<td class=\"colFirst\">"
+ "<a href=\"pkg2/ClassError.html\" title=\"class in pkg2\">ClassError</a></td>"
} }
}; };
private static final String[][] PROFILES_NEGATED_TEST = { private static final String[][] PROFILES_NEGATED_TEST = {
@ -125,6 +169,8 @@ public class TestProfiles extends JavadocTester {
{PROFILE_BUG_ID + FS + "pkg4" + FS + "compact2-package-frame.html", {PROFILE_BUG_ID + FS + "pkg4" + FS + "compact2-package-frame.html",
"<li><a href=\"Anno1Pkg4.html\" title=\"annotation in pkg4\" " "<li><a href=\"Anno1Pkg4.html\" title=\"annotation in pkg4\" "
+ "target=\"classFrame\">Anno1Pkg4</a></li>" + "target=\"classFrame\">Anno1Pkg4</a></li>"
},
{PROFILE_BUG_ID + FS + "compact1-summary.html","<li>Use</li>"
} }
}; };
private static final String[][] PACKAGES_TEST = { private static final String[][] PACKAGES_TEST = {

View file

@ -0,0 +1,94 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* 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.
*
* 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.
*/
/*
* @test
* @bug 8006124 8009684 8015663
* @summary Test javadoc options support for profiles.
* @author Evgeniya Stepanova
* @library ../lib/
* @build JavadocTester TestProfilesConfiguration
* @run main TestProfilesConfiguration
*/
public class TestProfilesConfiguration extends JavadocTester {
//Test information.
private static final String BUG_ID = "8006124-8009684";
private static final String PROFILE_CONFIGURATION_BUG_ID = BUG_ID + "-3";
//Javadoc arguments.
private static final String[] ARGS3 = new String[]{
"-d", PROFILE_CONFIGURATION_BUG_ID, "-sourcepath", SRC_DIR, "-nocomment",
"-keywords", "-Xprofilespath", SRC_DIR + FS + "profile-rtjar-includes.txt",
"-doctitle", "Simple doctitle", "-use", "pkg3", "pkg1", "pkg2", "pkg4",
"pkg5", "-packagesheader", "Simple packages header","pkgDeprecated"
};
private static final String[][] PROFILES_CONFIGURATION_TEST = {
//-use option test string fo profile view page
{PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html","<li>Use</li>"
},
//-doctitle option test string
{PROFILE_CONFIGURATION_BUG_ID + FS + "overview-summary.html",
"<div class=\"header\">" + NL + "<h1 class=\"title\">Simple doctitle</h1>"
},
//-packagesheader option test string fo profiles
{PROFILE_CONFIGURATION_BUG_ID + FS + "profile-overview-frame.html",
"<h1 title=\"Simple packages header\" class=\"bar\">Simple packages header</h1>"
},
//-keywords option test string for profiles
{PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html",
"<meta name=\"keywords\" content=\"compact1 profile\">"
}
};
private static final String[][] PROFILES_CONFIGURATION_NEGATED_TEST = {
//-nocomments option test string
{PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html",
"<div class=\"block\"><i>Class1Pkg2.</i></div>"
}
};
/**
* The entry point of the test.
*
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestProfilesConfiguration tester = new TestProfilesConfiguration();
run(tester, ARGS3, PROFILES_CONFIGURATION_TEST,
PROFILES_CONFIGURATION_NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}

View file

@ -24,7 +24,7 @@
package pkg2; package pkg2;
/** /**
* Another test class. * @deprecated Class1Pkg2. This class is deprecated
* *
* @author Bhavesh Patel * @author Bhavesh Patel
*/ */

View file

@ -0,0 +1,31 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* 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.
*
* 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.
*/
package pkg2;
/**
* Simple error class.
*
* @author Evgeniya Stepanova
*/
public class ClassError extends Error {}

View file

@ -0,0 +1,31 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* 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.
*
* 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.
*/
package pkg2;
/**
* Simple exception class.
*
* @author Evgeniya Stepanova
*/
public class ClassException extends Exception {}

View file

@ -0,0 +1,36 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* 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.
*
* 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.
*/
package pkgDeprecated;
/**
* Simple deprecated class of deprecated package.
*
* @author Evgeniya Stepanova
*/
public class Class1PkgDeprecated {
public void method(int t) {
return null;
}
}

View file

@ -0,0 +1,29 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* 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.
*
* 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.
*/
/**
* Deprecated package.
*
* @deprecated This package is <b>Deprecated</b>. Use pkg1.
*/
package pkgDeprecated;

View file

@ -1,5 +1,6 @@
PROFILE_1_RTJAR_INCLUDE_PACKAGES := \ PROFILE_1_RTJAR_INCLUDE_PACKAGES := \
pkg2 pkg2 \
pkgDeprecated
PROFILE_1_RTJAR_INCLUDE_TYPES := \ PROFILE_1_RTJAR_INCLUDE_TYPES := \
pkg3/Class1Pkg3.class pkg3/Class1Pkg3.class