file_name stringlengths 6 86 | file_path stringlengths 45 249 | content stringlengths 47 6.26M | file_size int64 47 6.26M | language stringclasses 1 value | extension stringclasses 1 value | repo_name stringclasses 767 values | repo_stars int64 8 14.4k | repo_forks int64 0 1.17k | repo_open_issues int64 0 788 | repo_created_at stringclasses 767 values | repo_pushed_at stringclasses 767 values |
|---|---|---|---|---|---|---|---|---|---|---|---|
BadSource.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testUnnamedPackage/BadSource.java | /*
* Copyright (c) 2004, 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.
*/
Just a dummy file that should not cause an error.
| 1,102 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestBadLinkOption.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testLinkOption/TestBadLinkOption.java | /*
* Copyright (c) 2003, 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 4625883
* @summary Make sure that bad -link arguments trigger warnings.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestBadLinkOption
* @run main TestBadLinkOption
*/
public class TestBadLinkOption extends JavadocTester {
private static final String BUG_ID = "4720957";
private static final String[] ARGS = new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR,
"-link", BUG_ID, "pkg"
};
private static final String[][] TEST = {
{WARNING_OUTPUT, "Error reading file:"}
};
private static final String[][] NEG_TEST = {
{ERROR_OUTPUT, "Error reading file:"}
};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestBadLinkOption tester = new TestBadLinkOption();
run(tester, ARGS, TEST, NEG_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 2,232 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestLinkOption.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java | /*
* Copyright (c) 2002, 2011, 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 4720957 5020118
* @summary Test to make sure that -link and -linkoffline link to
* right files.
* @author jamieh
* @library ../lib/
* @build JavadocTester TestLinkOption
* @run main TestLinkOption
*/
public class TestLinkOption extends JavadocTester {
private static final String BUG_ID = "4720957-5020118";
//Generate the documentation using -linkoffline and a URL as the first parameter.
private static final String[] ARGS1 = new String[] {
"-d", BUG_ID + "-1", "-sourcepath", SRC_DIR,
"-linkoffline", "http://java.sun.com/j2se/1.4/docs/api/",
SRC_DIR, "-package", "pkg", "java.lang"
};
private static final String[][] TEST1 = {
{BUG_ID + "-1" + FS + "pkg" + FS + "C.html",
"<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html?is-external=true\" " +
"title=\"class or interface in java.lang\"><code>Link to String Class</code></a>"
},
//Make sure the parameters are indented properly when the -link option is used.
{BUG_ID + "-1" + FS + "pkg" + FS + "C.html",
"(int p1," + NL +
" int p2," + NL +
" int p3)"
},
{BUG_ID + "-1" + FS + "pkg" + FS + "C.html",
"(int p1," + NL +
" int p2," + NL +
" <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" title=\"class or interface in java.lang\">" +
"Object</a> p3)"
},
{BUG_ID + "-1" + FS + "java" + FS + "lang" + FS + "StringBuilderChild.html",
"<pre>public abstract class <span class=\"strong\">StringBuilderChild</span>" + NL +
"extends <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" " +
"title=\"class or interface in java.lang\">Object</a></pre>"
},
};
private static final String[][] NEGATED_TEST1 = NO_TEST;
//Generate the documentation using -linkoffline and a relative path as the first parameter.
//We will try linking to the docs generated in test 1 with a relative path.
private static final String[] ARGS2 = new String[] {
"-d", BUG_ID + "-2", "-sourcepath", SRC_DIR,
"-linkoffline", "../" + BUG_ID + "-1", BUG_ID + "-1", "-package", "pkg2"
};
private static final String[][] TEST2 = {
{BUG_ID + "-2" + FS + "pkg2" + FS + "C2.html",
"This is a link to <a href=\"../../" + BUG_ID + "-1/pkg/C.html?is-external=true\" " +
"title=\"class or interface in pkg\"><code>Class C</code></a>."
}
};
private static final String[][] NEGATED_TEST2 = NO_TEST;
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestLinkOption tester = new TestLinkOption();
run(tester, ARGS1, TEST1, NEGATED_TEST1);
run(tester, ARGS2, TEST2, NEGATED_TEST2);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 4,504 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestNewLineInLink.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testLinkOption/TestNewLineInLink.java | /*
* Copyright (c) 2002, 2004, 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 4739870
* @summary Make sure that a new line may act as a separator between
* link and label.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestNewLineInLink
* @run main TestNewLineInLink
*/
public class TestNewLineInLink extends JavadocTester {
private static final String BUG_ID = "4739870";
private static final String[][] NEGATED_TEST =
new String[][] {
{ERROR_OUTPUT,
"illegal character"}
};
private static final String[] ARGS = new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR,
"-linkoffline", "http://www.java.sun.com/j2se/1.4/docs/api",
SRC_DIR, "testNewLineInLink"};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestNewLineInLink tester = new TestNewLineInLink();
run(tester, ARGS, new String[][] {}, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 2,315 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
StringBuilderChild.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testLinkOption/java/lang/StringBuilderChild.java | /*
* Copyright (c) 2004, 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 java.lang;
/**
* @author Jamie Ho
*/
public abstract class StringBuilderChild extends AbstractStringBuilder {
}
| 1,175 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testLinkOption/pkg/C.java | /*
* Copyright (c) 2002, 2003, 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 pkg;
/*****************************************************
* {@link java.lang.String Link to String Class}.
****************************************************/
public class C {
public Object method(int p1, int p2, int p3) {
return null;
}
public Object method(int p1, int p2, Object p3) {
return p3;
}
}
| 1,387 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testLinkOption/pkg2/C2.java | /*
* Copyright (c) 2002, 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;
/*******************************************
* This is a link to {@link pkg.C Class C}.
*******************************************/
public class C2 {}
| 1,222 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testLinkOption/testNewLineInLink/C.java | /*
* Copyright (c) 2002, 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 testNewLineInLink;
public class C {}
| 1,098 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestEnclosingClass.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testEnclosingClass/TestEnclosingClass.java | /*
* Copyright (c) 2004, 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 5008230
* @summary Check the outer class when documenting enclosing class/interface.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestEnclosingClass
* @run main TestEnclosingClass
*/
public class TestEnclosingClass extends JavadocTester {
//Test information.
private static final String BUG_ID = "5008230";
//Javadoc arguments.
private static final String[] ARGS = new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
};
//Input for string search tests.
private static final String[][] TEST = {
{BUG_ID + FS + "pkg" + FS + "MyClass.MyInterface.html", "Enclosing class:"}
};
private static final String[][] NEGATED_TEST = NO_TEST;
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestEnclosingClass tester = new TestEnclosingClass();
run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 2,323 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
MyClass.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testEnclosingClass/pkg/MyClass.java | /*
* Copyright (c) 2004, 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 pkg;
public class MyClass {
public interface MyInterface {}
}
| 1,127 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestHtmlTableTags.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java | /*
* Copyright (c) 2009, 2010, 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 6786688
* @summary HTML tables should have table summary, caption and table headers.
* @author Bhavesh Patel
* @library ../lib/
* @build JavadocTester
* @build TestHtmlTableTags
* @run main TestHtmlTableTags
*/
public class TestHtmlTableTags extends JavadocTester {
//Test information.
private static final String BUG_ID = "6786688";
//Javadoc arguments.
private static final String[] ARGS = new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
};
//Input for string tests for HTML table tags.
private static final String[][] TABLE_TAGS_TEST = {
/*
* Test for validating summary for HTML tables
*/
//Package summary
{BUG_ID + FS + "pkg1" + FS + "package-summary.html",
"<table class=\"packageSummary\" border=\"0\" cellpadding=\"3\"" +
" cellspacing=\"0\" summary=\"Class Summary table, " +
"listing classes, and an explanation\">"
},
{BUG_ID + FS + "pkg1" + FS + "package-summary.html",
"<table class=\"packageSummary\" border=\"0\" cellpadding=\"3\"" +
" cellspacing=\"0\" summary=\"Interface Summary table, " +
"listing interfaces, and an explanation\">"
},
{BUG_ID + FS + "pkg2" + FS + "package-summary.html",
"<table class=\"packageSummary\" border=\"0\" cellpadding=\"3\"" +
" cellspacing=\"0\" summary=\"Enum Summary table, " +
"listing enums, and an explanation\">"
},
{BUG_ID + FS + "pkg2" + FS + "package-summary.html",
"<table class=\"packageSummary\" border=\"0\" cellpadding=\"3\"" +
" cellspacing=\"0\" summary=\"Annotation Types Summary table, " +
"listing annotation types, and an explanation\">"
},
// Class documentation
{BUG_ID + FS + "pkg1" + FS + "C1.html",
"<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" " +
"cellspacing=\"0\" summary=\"Field Summary table, listing fields, " +
"and an explanation\">"
},
{BUG_ID + FS + "pkg1" + FS + "C1.html",
"<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" " +
"cellspacing=\"0\" summary=\"Method Summary table, listing methods, " +
"and an explanation\">"
},
{BUG_ID + FS + "pkg2" + FS + "C2.html",
"<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" " +
"cellspacing=\"0\" summary=\"Nested Class Summary table, listing " +
"nested classes, and an explanation\">"
},
{BUG_ID + FS + "pkg2" + FS + "C2.html",
"<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" " +
"cellspacing=\"0\" summary=\"Constructor Summary table, listing " +
"constructors, and an explanation\">"
},
{BUG_ID + FS + "pkg2" + FS + "C2.ModalExclusionType.html",
"<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" " +
"cellspacing=\"0\" summary=\"Enum Constant Summary table, listing " +
"enum constants, and an explanation\">"
},
{BUG_ID + FS + "pkg2" + FS + "C3.html",
"<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" " +
"cellspacing=\"0\" summary=\"Required Element Summary table, " +
"listing required elements, and an explanation\">"
},
{BUG_ID + FS + "pkg2" + FS + "C4.html",
"<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" " +
"cellspacing=\"0\" summary=\"Optional Element Summary table, " +
"listing optional elements, and an explanation\">"
},
// Class use documentation
{BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "I1.html",
"<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
"table, listing packages, and an explanation\">"
},
{BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
"<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
"table, listing fields, and an explanation\">"
},
{BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
"<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
"table, listing methods, and an explanation\">"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html",
"<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
"table, listing fields, and an explanation\">"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html",
"<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
"table, listing methods, and an explanation\">"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html",
"<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
"table, listing packages, and an explanation\">"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html",
"<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
"table, listing methods, and an explanation\">"
},
// Package use documentation
{BUG_ID + FS + "pkg1" + FS + "package-use.html",
"<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
"table, listing packages, and an explanation\">"
},
{BUG_ID + FS + "pkg1" + FS + "package-use.html",
"<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
"table, listing classes, and an explanation\">"
},
{BUG_ID + FS + "pkg2" + FS + "package-use.html",
"<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
"table, listing packages, and an explanation\">"
},
{BUG_ID + FS + "pkg2" + FS + "package-use.html",
"<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " +
"table, listing classes, and an explanation\">"
},
// Deprecated
{BUG_ID + FS + "deprecated-list.html",
"<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " +
"summary=\"Deprecated Fields table, listing deprecated fields, " +
"and an explanation\">"
},
{BUG_ID + FS + "deprecated-list.html",
"<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " +
"summary=\"Deprecated Methods table, listing deprecated methods, " +
"and an explanation\">"
},
// Constant values
{BUG_ID + FS + "constant-values.html",
"<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " +
"summary=\"Constant Field Values table, listing " +
"constant fields, and values\">"
},
// Overview Summary
{BUG_ID + FS + "overview-summary.html",
"<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" " +
"cellspacing=\"0\" summary=\"Packages table, " +
"listing packages, and an explanation\">"
},
/*
* Test for validating caption for HTML tables
*/
//Package summary
{BUG_ID + FS + "pkg1" + FS + "package-summary.html",
"<caption><span>Class Summary</span><span class=\"tabEnd\">" +
" </span></caption>"
},
{BUG_ID + FS + "pkg1" + FS + "package-summary.html",
"<caption><span>Interface Summary</span><span class=\"tabEnd\">" +
" </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "package-summary.html",
"<caption><span>Enum Summary</span><span class=\"tabEnd\">" +
" </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "package-summary.html",
"<caption><span>Annotation Types Summary</span><span class=\"tabEnd\">" +
" </span></caption>"
},
// Class documentation
{BUG_ID + FS + "pkg1" + FS + "C1.html",
"<caption><span>Fields</span><span class=\"tabEnd\"> </span></caption>"
},
{BUG_ID + FS + "pkg1" + FS + "C1.html",
"<caption><span>Methods</span><span class=\"tabEnd\"> </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "C2.html",
"<caption><span>Nested Classes</span><span class=\"tabEnd\"> </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "C2.html",
"<caption><span>Constructors</span><span class=\"tabEnd\"> </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "C2.ModalExclusionType.html",
"<caption><span>Enum Constants</span><span class=\"tabEnd\"> </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "C3.html",
"<caption><span>Required Elements</span><span class=\"tabEnd\"> " +
"</span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "C4.html",
"<caption><span>Optional Elements</span><span class=\"tabEnd\"> " +
"</span></caption>"
},
// Class use documentation
{BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "I1.html",
"<caption><span>Packages that use <a href=\"../../pkg1/I1.html\" " +
"title=\"interface in pkg1\">I1</a></span><span class=\"tabEnd\">" +
" </span></caption>"
},
{BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
"<caption><span>Fields in <a href=\"../../pkg2/package-summary.html\">" +
"pkg2</a> declared as <a href=\"../../pkg1/C1.html\" " +
"title=\"class in pkg1\">C1</a></span><span class=\"tabEnd\"> " +
"</span></caption>"
},
{BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
"<caption><span>Methods in <a href=\"../../pkg2/package-summary.html\">" +
"pkg2</a> that return <a href=\"../../pkg1/C1.html\" " +
"title=\"class in pkg1\">C1</a></span><span class=\"tabEnd\">" +
" </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html",
"<caption><span>Fields in <a href=\"../../pkg1/package-summary.html\">" +
"pkg1</a> declared as <a href=\"../../pkg2/C2.html\" " +
"title=\"class in pkg2\">C2</a></span><span class=\"tabEnd\">" +
" </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html",
"<caption><span>Methods in <a href=\"../../pkg1/package-summary.html\">" +
"pkg1</a> that return <a href=\"../../pkg2/C2.html\" " +
"title=\"class in pkg2\">C2</a></span><span class=\"tabEnd\">" +
" </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html",
"<caption><span>Methods in <a href=\"../../pkg2/package-summary.html\">" +
"pkg2</a> that return <a href=\"../../pkg2/C2.ModalExclusionType.html\" " +
"title=\"enum in pkg2\">C2.ModalExclusionType</a></span>" +
"<span class=\"tabEnd\"> </span></caption>"
},
// Package use documentation
{BUG_ID + FS + "pkg1" + FS + "package-use.html",
"<caption><span>Packages that use <a href=\"../pkg1/package-summary.html\">" +
"pkg1</a></span><span class=\"tabEnd\"> </span></caption>"
},
{BUG_ID + FS + "pkg1" + FS + "package-use.html",
"<caption><span>Classes in <a href=\"../pkg1/package-summary.html\">" +
"pkg1</a> used by <a href=\"../pkg1/package-summary.html\">pkg1</a>" +
"</span><span class=\"tabEnd\"> </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "package-use.html",
"<caption><span>Packages that use <a href=\"../pkg2/package-summary.html\">" +
"pkg2</a></span><span class=\"tabEnd\"> </span></caption>"
},
{BUG_ID + FS + "pkg2" + FS + "package-use.html",
"<caption><span>Classes in <a href=\"../pkg2/package-summary.html\">" +
"pkg2</a> used by <a href=\"../pkg1/package-summary.html\">pkg1</a>" +
"</span><span class=\"tabEnd\"> </span></caption>"
},
// Deprecated
{BUG_ID + FS + "deprecated-list.html",
"<caption><span>Deprecated Fields</span><span class=\"tabEnd\">" +
" </span></caption>"
},
{BUG_ID + FS + "deprecated-list.html",
"<caption><span>Deprecated Methods</span><span class=\"tabEnd\">" +
" </span></caption>"
},
// Constant values
{BUG_ID + FS + "constant-values.html",
"<caption><span>pkg1.<a href=\"pkg1/C1.html\" title=\"class in pkg1\">" +
"C1</a></span><span class=\"tabEnd\"> </span></caption>"
},
// Overview Summary
{BUG_ID + FS + "overview-summary.html",
"<caption><span>Packages</span><span class=\"tabEnd\"> </span></caption>"
},
/*
* Test for validating headers for HTML tables
*/
//Package summary
{BUG_ID + FS + "pkg1" + FS + "package-summary.html",
"<th class=\"colFirst\" scope=\"col\">" +
"Class</th>" + NL + "<th class=\"colLast\" scope=\"col\"" +
">Description</th>"
},
{BUG_ID + FS + "pkg1" + FS + "package-summary.html",
"<th class=\"colFirst\" scope=\"col\">" +
"Interface</th>" + NL + "<th class=\"colLast\" scope=\"col\"" +
">Description</th>"
},
{BUG_ID + FS + "pkg2" + FS + "package-summary.html",
"<th class=\"colFirst\" scope=\"col\">" +
"Enum</th>" + NL + "<th class=\"colLast\" scope=\"col\"" +
">Description</th>"
},
{BUG_ID + FS + "pkg2" + FS + "package-summary.html",
"<th class=\"colFirst\" scope=\"col\">" +
"Annotation Type</th>" + NL + "<th class=\"colLast\"" +
" scope=\"col\">Description</th>"
},
// Class documentation
{BUG_ID + FS + "pkg1" + FS + "C1.html",
"<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
"<th class=\"colLast\" scope=\"col\">Field and Description</th>"
},
{BUG_ID + FS + "pkg1" + FS + "C1.html",
"<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
"<th class=\"colLast\" scope=\"col\">Method and Description</th>"
},
{BUG_ID + FS + "pkg2" + FS + "C2.html",
"<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
"<th class=\"colLast\" scope=\"col\">Class and Description</th>"
},
{BUG_ID + FS + "pkg2" + FS + "C2.html",
"<th class=\"colOne\" scope=\"col\">Constructor and Description</th>"
},
{BUG_ID + FS + "pkg2" + FS + "C2.ModalExclusionType.html",
"<th class=\"colOne\" scope=\"col\">Enum Constant and Description</th>"
},
{BUG_ID + FS + "pkg2" + FS + "C3.html",
"<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
"<th class=\"colLast\" scope=\"col\">Required Element and Description</th>"
},
{BUG_ID + FS + "pkg2" + FS + "C4.html",
"<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
"<th class=\"colLast\" scope=\"col\">Optional Element and Description</th>"
},
// Class use documentation
{BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "I1.html",
"<th class=\"colFirst\" scope=\"col\">Package</th>" + NL +
"<th class=\"colLast\" scope=\"col\">Description</th>"
},
{BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
"<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
"<th class=\"colLast\" scope=\"col\">Field and Description</th>"
},
{BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
"<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
"<th class=\"colLast\" scope=\"col\">Method and Description</th>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html",
"<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
"<th class=\"colLast\" scope=\"col\">Field and Description</th>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html",
"<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
"<th class=\"colLast\" scope=\"col\">Method and Description</th>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html",
"<th class=\"colFirst\" scope=\"col\">Package</th>" + NL +
"<th class=\"colLast\" scope=\"col\">Description</th>"
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html",
"<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
"<th class=\"colLast\" scope=\"col\">Method and Description</th>"
},
// Package use documentation
{BUG_ID + FS + "pkg1" + FS + "package-use.html",
"<th class=\"colFirst\" scope=\"col\">Package</th>" + NL +
"<th class=\"colLast\" scope=\"col\">Description</th>"
},
{BUG_ID + FS + "pkg1" + FS + "package-use.html",
"<th class=\"colOne\" scope=\"col\">Class and Description</th>"
},
{BUG_ID + FS + "pkg2" + FS + "package-use.html",
"<th class=\"colFirst\" scope=\"col\">Package</th>" + NL +
"<th class=\"colLast\" scope=\"col\">Description</th>"
},
{BUG_ID + FS + "pkg2" + FS + "package-use.html",
"<th class=\"colOne\" scope=\"col\">Class and Description</th>"
},
// Deprecated
{BUG_ID + FS + "deprecated-list.html",
"<th class=\"colOne\" scope=\"col\">Field and Description</th>"
},
{BUG_ID + FS + "deprecated-list.html",
"<th class=\"colOne\" scope=\"col\">Method and Description</th>"
},
// Constant values
{BUG_ID + FS + "constant-values.html",
"<th class=\"colFirst\" scope=\"col\">" +
"Modifier and Type</th>" + NL + "<th" +
" scope=\"col\">Constant Field</th>" + NL +
"<th class=\"colLast\" scope=\"col\">Value</th>"
},
// Overview Summary
{BUG_ID + FS + "overview-summary.html",
"<th class=\"colFirst\" scope=\"col\">" +
"Package</th>" + NL + "<th class=\"colLast\" scope=\"col\"" +
">Description</th>"
}
};
private static final String[][] NEGATED_TEST = NO_TEST;
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestHtmlTableTags tester = new TestHtmlTableTags();
run(tester, ARGS, TABLE_TAGS_TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 20,867 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
package-info.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlTableTags/pkg2/package-info.java | /*
* Copyright (c) 2009, 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 package 2 used to test table tags.
*/
package pkg2;
| 1,117 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlTableTags/pkg2/C2.java | /*
* Copyright (c) 2009, 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;
import pkg1.*;
/**
* Another test class.
*
* @author Bhavesh Patel
*/
public class C2 {
/**
* A test field.
*/
public C1 field;
/**
* @deprecated don't use this field anymore.
*/
public C1 dep_field;
/**
* A sample enum.
*/
public static enum ModalExclusionType {
/**
* Test comment.
*/
NO_EXCLUDE,
/**
* Another comment.
*/
APPLICATION_EXCLUDE
};
/**
* A string constant.
*/
public static final String CONSTANT1 = "C2";
/**
* A sample method.
*
* @param param some parameter.
* @return a test object.
*/
public C1 method(C1 param) {
return param;
}
}
| 1,818 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C3.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlTableTags/pkg2/C3.java | /*
* Copyright (c) 2009, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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;
import java.lang.annotation.*;
/**
* Test Annotation class.
*
* @author Bhavesh Patel
*/
public @interface C3 {
/**
* Comment.
*/
String[] value();
}
| 1,396 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C4.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlTableTags/pkg2/C4.java | /*
* Copyright (c) 2009, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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;
import java.lang.annotation.*;
/*
* A sample interface.
*/
public @interface C4 {
boolean value() default true;
}
| 1,344 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
package-info.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlTableTags/pkg1/package-info.java | /*
* Copyright (c) 2009, 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 package 1 used to test table tags.
*/
package pkg1;
| 1,117 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
I1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlTableTags/pkg1/I1.java | /*
* Copyright (c) 2009, 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 pkg1;
/**
* A sample interface used to test table tags.
*
* @author Bhavesh Patel
*/
public interface I1 {
/**
* A test method.
*
* @param a blah.
* @param b blah.
*/
void method1(int a, int b);
/**
* Another test method.
*
* @param c blah.
*/
void method2(int c);
}
| 1,396 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlTableTags/pkg1/C1.java | /*
* Copyright (c) 2009, 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 pkg1;
import pkg2.*;
/**
* A test class.
*
* @author Bhavesh Patel
*/
public class C1 implements I1 {
/**
* Test field for class.
*/
public C2 field;
/**
* Constant value.
*/
public static final String CONSTANT1 = "C1";
/**
* A test constructor.
*/
C1() {
}
/**
* Method thats does some processing.
*
* @param param some parameter that is passed.
* @return a sample object.
*/
public C2 method(C2 param) {
return param;
}
/**
* Method that is implemented.
*
* @param a some random value.
* @param b some random value.
*/
public void method1(int a, int b) {
}
/**
* Another inherited method.
* @param c some value.
*/
public void method2(int c) {
}
/**
* @deprecated don't use this anymore.
*/
public void deprecatedMethod() {}
}
| 1,987 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestHrefInDocComment.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHrefInDocComment/TestHrefInDocComment.java | /*
* Copyright (c) 2002, 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 4638015
* @summary Determine if Hrefs are processed properly when they
* appear in doc comments.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestHrefInDocComment
* @run main TestHrefInDocComment
*/
public class TestHrefInDocComment extends JavadocTester {
private static final String BUG_ID = "4638015";
private static final String[][] TEST = NO_TEST;
private static final String[][] NEGATED_TEST = NO_TEST;
private static final String[] ARGS =
new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestHrefInDocComment tester = new TestHrefInDocComment();
if (run(tester, ARGS, TEST, NEGATED_TEST) != 0) {
throw new Error("Javadoc failed to execute properly with given source.");
}
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 2,243 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
I2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHrefInDocComment/pkg/I2.java | /*
* Copyright (c) 2002, 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 pkg;
/*****
* Just a dummy interface used to reproduce a bug.
*/
public interface I2 {
}
| 1,168 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
I1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHrefInDocComment/pkg/I1.java | /*
* Copyright (c) 2002, 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 pkg;
/**
* Here's the <a href="mailto:skeet@pobox.com">first</a>
* and here's the <a href="http://www.pobox.com">second</a>.
*/
public interface I1 {}
| 1,215 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testBadSourceFile/C2.java | /*
* Copyright (c) 2003, 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.
*/
/**
* @see C1#foo(int)
*/
public class C2 {}
| 1,099 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestBadSourceFile.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java | /*
* Copyright (c) 2003, 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 4835749
* @summary Make sure exception is not thrown if there is a bad source
* file in the same directory as the file being documented.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestBadSourceFile
* @run main TestBadSourceFile
*/
public class TestBadSourceFile extends JavadocTester {
//Test information.
private static final String BUG_ID = "4835749";
//Javadoc arguments.
private static final String[] ARGS = new String[] {
"-d", BUG_ID, SRC_DIR + FS + "C2.java"
};
//Input for string search tests.
private static final String[][] TEST = NO_TEST;
private static final String[][] NEGATED_TEST = NO_TEST;
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestBadSourceFile tester = new TestBadSourceFile();
int exitCode = run(tester, ARGS, TEST, NEGATED_TEST);
tester.checkExitCode(0, exitCode);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 2,350 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testBadSourceFile/C1.java | /*
* Copyright (c) 2003, 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 com.package1;
/**
* This is a comment.
*/
public class C1 {
public void foo(int p) {}
}
| 1,162 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestWarnings.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java | /*
* Copyright (c) 2004, 2010, 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 4515705 4804296 4702454 4697036
* @summary Make sure that first sentence warning only appears once.
* Make sure that only warnings/errors are printed when quiet is used.
* Make sure that links to private/unincluded methods do not cause
* a "link unresolved" warning.
* Make sure error message starts with "error -".
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestWarnings
* @run main TestWarnings
*/
public class TestWarnings extends JavadocTester {
//Test information.
private static final String BUG_ID = "4515705-4804296-4702454-4697036";
//Javadoc arguments.
private static final String[] ARGS = new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
};
private static final String[] ARGS2 = new String[] {
"-d", BUG_ID, "-private", "-sourcepath", SRC_DIR, "pkg"
};
//Input for string search tests.
private static final String[][] TEST = {
{WARNING_OUTPUT,
"X.java:11: warning - Missing closing '}' character for inline tag"},
{ERROR_OUTPUT,
"package.html: error - Body tag missing from HTML"},
};
private static final String[][] NEGATED_TEST = {
{BUG_ID + FS + "pkg" + FS + "X.html", "can't find m()"},
{BUG_ID + FS + "pkg" + FS + "X.html", "can't find X()"},
{BUG_ID + FS + "pkg" + FS + "X.html", "can't find f"},
};
private static final String[][] TEST2 = {
{BUG_ID + FS + "pkg" + FS + "X.html", "<a href=\"../pkg/X.html#m()\"><code>m()</code></a><br/>"},
{BUG_ID + FS + "pkg" + FS + "X.html", "<a href=\"../pkg/X.html#X()\"><code>X()</code></a><br/>"},
{BUG_ID + FS + "pkg" + FS + "X.html", "<a href=\"../pkg/X.html#f\"><code>f</code></a><br/>"},
};
private static final String[][] NEGATED_TEST2 = NO_TEST;
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestWarnings tester = new TestWarnings();
run(tester, ARGS, TEST, NEGATED_TEST);
run(tester, ARGS2, TEST2, NEGATED_TEST2);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 3,513 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
X.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testWarnings/pkg/X.java | /* /nodynamiccopyright/ */
package pkg;
import java.io.Serializable;
/**
* {@link com.package1.Class1#publicStaticMethod().
* Any label would be ignored.
*/
public class X implements Serializable {
private int f;
private X(){}
private void m() {}
/** @see X#m() */
private static class P implements Serializable {}
/**
* {@link #X()}<br/>
* {@link #m()}<br/>
* {@link #f}<br/>
* {@link java.lang.String#toString()}<br/>
*/
public void foo() {}
}
| 510 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestHelpFile.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHelpFile/TestHelpFile.java | /*
* Copyright (c) 2012, 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 7132631
* @summary Make sure that the help file is generated correctly.
* @author Bhavesh Patel
* @library ../lib/
* @build JavadocTester TestHelpFile
* @run main TestHelpFile
*/
public class TestHelpFile extends JavadocTester {
//Test information.
private static final String BUG_ID = "7132631";
//Javadoc arguments.
private static final String[] ARGS = new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR,
SRC_DIR + FS + "TestHelpFile.java"
};
private static final String[][] NEGATED_TEST = NO_TEST;
private static final String[][] TEST = {
{BUG_ID + FS + "help-doc.html",
"<a href=\"constant-values.html\">Constant Field Values</a>"
},
};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestHelpFile tester = new TestHelpFile();
run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 2,319 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
JavadocTester.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/lib/JavadocTester.java | /*
* Copyright (c) 2002, 2011, 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.
*/
import com.sun.javadoc.*;
import java.util.*;
import java.io.*;
/**
* Runs javadoc and then runs regression tests on the resulting output.
* This class currently contains three tests:
* <ul>
* <li> String search: Reads each file, complete with newlines,
* into a string. Lets you search for strings that contain
* newlines. String matching is case-sensitive.
* You can run javadoc multiple times with different arguments,
* generating output into different destination directories, and
* then perform a different array of tests on each one.
* To do this, the run method accepts a test array for testing
* that a string is found, and a negated test array for testing
* that a string is not found.
* <li> Run diffs: Iterate through the list of given file pairs
* and diff the pairs.
* <li> Check exit code: Check the exit code of Javadoc and
* record whether the test passed or failed.
* </ul>
*
* @author Doug Kramer
* @author Jamie Ho
* @since 1.4.2
*/
public abstract class JavadocTester {
protected static final String FS = System.getProperty("file.separator");
protected static final String PS = System.getProperty("path.separator");
protected static final String NL = System.getProperty("line.separator");
protected static final String SRC_DIR = System.getProperty("test.src", ".");
protected static final String JAVA_VERSION = System.getProperty("java.version");
protected static final String[][] NO_TEST = new String[][] {};
/**
* Use this as the file name in the test array when you want to search
* for a string in the error output.
*/
public static final String ERROR_OUTPUT = "ERROR_OUTPUT";
/**
* Use this as the file name in the test array when you want to search
* for a string in the notice output.
*/
public static final String NOTICE_OUTPUT = "NOTICE_OUTPUT";
/**
* Use this as the file name in the test array when you want to search
* for a string in the warning output.
*/
public static final String WARNING_OUTPUT = "WARNING_OUTPUT";
/**
* Use this as the file name in the test array when you want to search
* for a string in standard output.
*/
public static final String STANDARD_OUTPUT = "STANDARD_OUTPUT";
/**
* The default doclet.
*/
public static final String DEFAULT_DOCLET_CLASS = "com.sun.tools.doclets.formats.html.HtmlDoclet";
public static final String DEFAULT_DOCLET_CLASS_OLD = "com.sun.tools.doclets.standard.Standard";
/**
* The writer to write error messages.
*/
public StringWriter errors;
/**
* The writer to write notices.
*/
public StringWriter notices;
/**
* The writer to write warnings.
*/
public StringWriter warnings;
/**
* The buffer of warning output..
*/
public StringBuffer standardOut;
/**
* The current subtest number.
*/
private static int numTestsRun = 0;
/**
* The number of subtests passed.
*/
private static int numTestsPassed = 0;
/**
* The current run of javadoc
*/
private static int javadocRunNum = 0;
/**
* Whether or not to match newlines exactly.
* Set this value to false if the match strings
* contain text from javadoc comments containing
* non-platform newlines.
*/
protected boolean exactNewlineMatch = true;
/**
* Construct a JavadocTester.
*/
public JavadocTester() {
}
/**
* Return the bug id.
* @return the bug id
*/
public abstract String getBugId();
/**
* Return the name of the bug.
* @return the name of the bug
*/
public abstract String getBugName();
/**
* Execute the tests.
*
* @param tester the tester to execute
* @param args the arguments to pass to Javadoc
* @param testArray the array of tests
* @param negatedTestArray the array of negated tests
* @return the return code for the execution of Javadoc
*/
public static int run(JavadocTester tester, String[] args,
String[][] testArray, String[][] negatedTestArray) {
int returnCode = tester.runJavadoc(args);
tester.runTestsOnHTML(testArray, negatedTestArray);
return returnCode;
}
/**
* Execute Javadoc using the default doclet.
*
* @param args the arguments to pass to Javadoc
* @return the return code from the execution of Javadoc
*/
public int runJavadoc(String[] args) {
float javaVersion = Float.parseFloat(JAVA_VERSION.substring(0,3));
String docletClass = javaVersion < 1.5 ?
DEFAULT_DOCLET_CLASS_OLD : DEFAULT_DOCLET_CLASS;
return runJavadoc(docletClass, args);
}
/**
* Execute Javadoc.
*
* @param docletClass the doclet being tested.
* @param args the arguments to pass to Javadoc
* @return the return code from the execution of Javadoc
*/
public int runJavadoc(String docletClass, String[] args) {
javadocRunNum++;
if (javadocRunNum == 1) {
System.out.println("\n" + "Running javadoc...");
} else {
System.out.println("\n" + "Running javadoc (run "
+ javadocRunNum + ")...");
}
initOutputBuffers();
ByteArrayOutputStream stdout = new ByteArrayOutputStream();
PrintStream prevOut = System.out;
System.setOut(new PrintStream(stdout));
ByteArrayOutputStream stderr = new ByteArrayOutputStream();
PrintStream prevErr = System.err;
System.setErr(new PrintStream(stderr));
int returnCode = com.sun.tools.javadoc.Main.execute(
getBugName(),
new PrintWriter(errors, true),
new PrintWriter(warnings, true),
new PrintWriter(notices, true),
docletClass,
getClass().getClassLoader(),
args);
System.setOut(prevOut);
standardOut = new StringBuffer(stdout.toString());
System.setErr(prevErr);
errors.write(NL + stderr.toString());
printJavadocOutput();
return returnCode;
}
/**
* Create new string writer buffers
*/
private void initOutputBuffers() {
errors = new StringWriter();
notices = new StringWriter();
warnings = new StringWriter();
}
/**
* Run array of tests on the resulting HTML.
* This method accepts a testArray for testing that a string is found
* and a negatedTestArray for testing that a string is not found.
*
* @param testArray the array of tests
* @param negatedTestArray the array of negated tests
*/
public void runTestsOnHTML(String[][] testArray, String[][] negatedTestArray) {
runTestsOnHTML(testArray, false);
runTestsOnHTML(negatedTestArray, true);
}
/**
* Run the array of tests on the resulting HTML.
*
* @param testArray the array of tests
* @param isNegated true if test is negated; false otherwise
*/
private void runTestsOnHTML(String[][] testArray , boolean isNegated) {
for (int i = 0; i < testArray.length; i++) {
numTestsRun++;
System.out.print("Running subtest #" + numTestsRun + "... ");
// Get string to find
String stringToFind = testArray[i][1];
// Read contents of file into a string
String fileString;
try {
fileString = readFileToString(testArray[i][0]);
} catch (Error e) {
if (isNegated) {
numTestsPassed += 1;
System.out.println("Passed\n not found:\n"
+ stringToFind + " in non-existent " + testArray[i][0] + "\n");
continue;
}
throw e;
}
// Find string in file's contents
boolean isFound = findString(fileString, stringToFind);
if ((isNegated && !isFound) || (!isNegated && isFound) ) {
numTestsPassed += 1;
System.out.println( "Passed" + "\n"
+ (isNegated ? "not found:" : "found:") + "\n"
+ stringToFind + " in " + testArray[i][0] + "\n");
} else {
System.out.println( "FAILED" + "\n"
+ "for bug " + getBugId()
+ " (" + getBugName() + ")" + "\n"
+ "when searching for:" + "\n"
+ stringToFind
+ " in " + testArray[i][0] + "\n");
}
}
}
/**
* Iterate through the list of given file pairs and diff each file.
*
* @param filePairs the pairs of files to diff.
* @throws an Error is thrown if any differences are found between
* file pairs.
*/
public void runDiffs(String[][] filePairs) throws Error {
runDiffs(filePairs, true);
}
/**
* Iterate through the list of given file pairs and diff each file.
*
* @param filePairs the pairs of files to diff.
* @param throwErrorIFNoMatch flag to indicate whether or not to throw
* an error if the files do not match.
*
* @throws an Error is thrown if any differences are found between
* file pairs and throwErrorIFNoMatch is true.
*/
public void runDiffs(String[][] filePairs, boolean throwErrorIfNoMatch) throws Error {
for (int i = 0; i < filePairs.length; i++) {
diff(filePairs[i][0], filePairs[i][1], throwErrorIfNoMatch);
}
}
/**
* Check the exit code of Javadoc and record whether the test passed
* or failed.
*
* @param expectedExitCode The exit code that is required for the test
* to pass.
* @param actualExitCode The actual exit code from the previous run of
* Javadoc.
*/
public void checkExitCode(int expectedExitCode, int actualExitCode) {
numTestsRun++;
if (expectedExitCode == actualExitCode) {
System.out.println( "Passed" + "\n" + " got return code " +
actualExitCode);
numTestsPassed++;
} else {
System.out.println( "FAILED" + "\n" + "for bug " + getBugId()
+ " (" + getBugName() + ")" + "\n" + "Expected return code " +
expectedExitCode + " but got " + actualExitCode);
}
}
/**
* Print a summary of the test results.
*/
protected void printSummary() {
if ( numTestsRun != 0 && numTestsPassed == numTestsRun ) {
// Test passed
System.out.println("\n" + "All " + numTestsPassed
+ " subtests passed");
} else {
// Test failed
throw new Error("\n" + (numTestsRun - numTestsPassed)
+ " of " + (numTestsRun)
+ " subtests failed for bug " + getBugId()
+ " (" + getBugName() + ")" + "\n");
}
}
/**
* Print the output stored in the buffers.
*/
protected void printJavadocOutput() {
System.out.println(STANDARD_OUTPUT + " : \n" + getStandardOutput());
System.err.println(ERROR_OUTPUT + " : \n" + getErrorOutput());
System.err.println(WARNING_OUTPUT + " : \n" + getWarningOutput());
System.out.println(NOTICE_OUTPUT + " : \n" + getNoticeOutput());
}
/**
* Read the file and return it as a string.
*
* @param fileName the name of the file to read
* @return the file in string format
*/
public String readFileToString(String fileName) throws Error {
if (fileName.equals(ERROR_OUTPUT)) {
return getErrorOutput();
} else if (fileName.equals(NOTICE_OUTPUT)) {
return getNoticeOutput();
} else if (fileName.equals(WARNING_OUTPUT)) {
return getWarningOutput();
} else if (fileName.equals(STANDARD_OUTPUT)) {
return getStandardOutput();
}
try {
File file = new File(fileName);
if ( !file.exists() ) {
System.out.println("\n" + "FILE DOES NOT EXIST: " + fileName);
}
BufferedReader in = new BufferedReader(new FileReader(file));
// Create an array of characters the size of the file
char[] allChars = new char[(int)file.length()];
// Read the characters into the allChars array
in.read(allChars, 0, (int)file.length());
in.close();
// Convert to a string
String allCharsString = new String(allChars);
return allCharsString;
} catch (FileNotFoundException e) {
System.err.println(e);
throw new Error("File not found: " + fileName);
} catch (IOException e) {
System.err.println(e);
throw new Error("Error reading file: " + fileName);
}
}
/**
* Compare the two given files.
*
* @param file1 the first file to compare.
* @param file2 the second file to compare.
* @param throwErrorIFNoMatch flag to indicate whether or not to throw
* an error if the files do not match.
* @return true if the files are the same and false otherwise.
*/
public boolean diff(String file1, String file2, boolean throwErrorIFNoMatch) throws Error {
String file1Contents = readFileToString(file1);
String file2Contents = readFileToString(file2);
numTestsRun++;
if (file1Contents.trim().compareTo(file2Contents.trim()) == 0) {
System.out.println("Diff successful: " + file1 + ", " + file2);
numTestsPassed++;
return true;
} else if (throwErrorIFNoMatch) {
throw new Error("Diff failed: " + file1 + ", " + file2);
} else {
return false;
}
}
/**
* Search for the string in the given file and return true
* if the string was found.
* If exactNewlineMatch is false, newlines will be normalized
* before the comparison.
*
* @param fileString the contents of the file to search through
* @param stringToFind the string to search for
* @return true if the string was found
*/
private boolean findString(String fileString, String stringToFind) {
if (exactNewlineMatch) {
return fileString.indexOf(stringToFind) >= 0;
} else {
return fileString.replace(NL, "\n").indexOf(stringToFind.replace(NL, "\n")) >= 0;
}
}
/**
* Return the standard output.
* @return the standard output
*/
public String getStandardOutput() {
return standardOut.toString();
}
/**
* Return the error output.
* @return the error output
*/
public String getErrorOutput() {
return errors.getBuffer().toString();
}
/**
* Return the notice output.
* @return the notice output
*/
public String getNoticeOutput() {
return notices.getBuffer().toString();
}
/**
* Return the warning output.
* @return the warning output
*/
public String getWarningOutput() {
return warnings.getBuffer().toString();
}
/**
* A utility to copy a directory from one place to another.
* We may possibly want to move this to our doclet toolkit in
* the near future and maintain it from there.
*
* @param targetDir the directory to copy.
* @param destDir the destination to copy the directory to.
*/
public static void copyDir(String targetDir, String destDir) {
if (targetDir.endsWith("SCCS")) {
return;
}
try {
File targetDirObj = new File(targetDir);
File destDirParentObj = new File(destDir);
File destDirObj = new File(destDirParentObj, targetDirObj.getName());
if (! destDirParentObj.exists()) {
destDirParentObj.mkdir();
}
if (! destDirObj.exists()) {
destDirObj.mkdir();
}
String[] files = targetDirObj.list();
for (int i = 0; i < files.length; i++) {
File srcFile = new File(targetDirObj, files[i]);
File destFile = new File(destDirObj, files[i]);
if (srcFile.isFile()) {
System.out.println("Copying " + srcFile + " to " + destFile);
copyFile(destFile, srcFile);
} else if(srcFile.isDirectory()) {
copyDir(srcFile.getAbsolutePath(), destDirObj.getAbsolutePath());
}
}
} catch (IOException exc) {
throw new Error("Could not copy " + targetDir + " to " + destDir);
}
}
/**
* Copy source file to destination file.
*
* @throws SecurityException
* @throws IOException
*/
public static void copyFile(File destfile, File srcfile)
throws IOException {
byte[] bytearr = new byte[512];
int len = 0;
FileInputStream input = new FileInputStream(srcfile);
File destDir = destfile.getParentFile();
destDir.mkdirs();
FileOutputStream output = new FileOutputStream(destfile);
try {
while ((len = input.read(bytearr)) != -1) {
output.write(bytearr, 0, len);
}
} catch (FileNotFoundException exc) {
} catch (SecurityException exc) {
} finally {
input.close();
output.close();
}
}
}
| 19,109 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestDeprecatedDocs.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java | /*
* Copyright (c) 2003, 2011, 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 4927552
* @summary <DESC>
* @author jamieh
* @library ../lib/
* @build JavadocTester TestDeprecatedDocs
* @run main TestDeprecatedDocs
*/
public class TestDeprecatedDocs extends JavadocTester {
//Test information.
private static final String BUG_ID = "4927552";
//Javadoc arguments.
private static final String[] ARGS = new String[] {
"-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR, "pkg"
};
private static final String TARGET_FILE =
BUG_ID + FS + "deprecated-list.html";
private static final String TARGET_FILE2 =
BUG_ID + FS + "pkg" + FS + "DeprecatedClassByAnnotation.html";
//Input for string search tests.
private static final String[][] TEST = {
{TARGET_FILE, "annotation_test1 passes"},
{TARGET_FILE, "annotation_test2 passes"},
{TARGET_FILE, "annotation_test3 passes"},
{TARGET_FILE, "class_test1 passes"},
{TARGET_FILE, "class_test2 passes"},
{TARGET_FILE, "class_test3 passes"},
{TARGET_FILE, "class_test4 passes"},
{TARGET_FILE, "enum_test1 passes"},
{TARGET_FILE, "enum_test2 passes"},
{TARGET_FILE, "error_test1 passes"},
{TARGET_FILE, "error_test2 passes"},
{TARGET_FILE, "error_test3 passes"},
{TARGET_FILE, "error_test4 passes"},
{TARGET_FILE, "exception_test1 passes"},
{TARGET_FILE, "exception_test2 passes"},
{TARGET_FILE, "exception_test3 passes"},
{TARGET_FILE, "exception_test4 passes"},
{TARGET_FILE, "interface_test1 passes"},
{TARGET_FILE, "interface_test2 passes"},
{TARGET_FILE, "interface_test3 passes"},
{TARGET_FILE, "interface_test4 passes"},
{TARGET_FILE, "pkg.DeprecatedClassByAnnotation"},
{TARGET_FILE, "pkg.DeprecatedClassByAnnotation()"},
{TARGET_FILE, "pkg.DeprecatedClassByAnnotation.method()"},
{TARGET_FILE, "pkg.DeprecatedClassByAnnotation.field"},
{TARGET_FILE2, "<pre>@Deprecated" + NL +
"public class <span class=\"strong\">DeprecatedClassByAnnotation</span>" + NL +
"extends java.lang.Object</pre>"},
{TARGET_FILE2, "<pre>@Deprecated" + NL +
"public int field</pre>" + NL +
"<div class=\"block\"><span class=\"strong\">Deprecated.</span> </div>"},
{TARGET_FILE2, "<pre>@Deprecated" + NL +
"public DeprecatedClassByAnnotation()</pre>" + NL +
"<div class=\"block\"><span class=\"strong\">Deprecated.</span> </div>"},
{TARGET_FILE2, "<pre>@Deprecated" + NL +
"public void method()</pre>" + NL +
"<div class=\"block\"><span class=\"strong\">Deprecated.</span> </div>"},
};
private static final String[][] NEGATED_TEST = NO_TEST;
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestDeprecatedDocs tester = new TestDeprecatedDocs();
run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 4,473 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestException.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testDeprecatedDocs/pkg/TestException.java | /*
* Copyright (c) 2003, 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 pkg;
/**
* @deprecated exception_test1 passes.
*/
public class TestException extends Exception {
/**
* @deprecated exception_test2 passes.
*/
public int field;
/**
* @deprecated exception_test3 passes.
*/
public TestException() {}
/**
* @deprecated exception_test4 passes.
*/
public void method() {}
}
| 1,422 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestEnum.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testDeprecatedDocs/pkg/TestEnum.java | /*
* Copyright (c) 2003, 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 pkg;
/**
* @deprecated enum_test1 passes.
*/
public enum TestEnum {
/**
* @deprecated enum_test2 passes.
*/
ONE, TWO, THREE;
}
| 1,209 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestClass.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testDeprecatedDocs/pkg/TestClass.java | /*
* Copyright (c) 2003, 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 pkg;
/**
* @deprecated class_test1 passes.
*/
public class TestClass {
/**
* @deprecated class_test2 passes.
*/
public int field;
/**
* @deprecated class_test3 passes.
*/
public TestClass() {}
/**
* @deprecated class_test4 passes.
*/
public void method() {}
}
| 1,380 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestInterface.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testDeprecatedDocs/pkg/TestInterface.java | /*
* Copyright (c) 2003, 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 pkg;
/**
* @deprecated interface_test1 passes.
*/
public class TestInterface {
/**
* @deprecated interface_test2 passes.
*/
public int field;
/**
* @deprecated interface_test3 passes.
*/
public TestInterface() {}
/**
* @deprecated interface_test4 passes.
*/
public void method() {}
}
| 1,404 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
DeprecatedClassByAnnotation.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testDeprecatedDocs/pkg/DeprecatedClassByAnnotation.java | /*
* Copyright (c) 2004, 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 pkg;
@Deprecated()
public class DeprecatedClassByAnnotation {
@Deprecated()
public int field;
@Deprecated()
public DeprecatedClassByAnnotation() {}
@Deprecated()
public void method() {}
}
| 1,276 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestError.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testDeprecatedDocs/pkg/TestError.java | /*
* Copyright (c) 2003, 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 pkg;
/**
* @deprecated error_test1 passes.
*/
public class TestError extends Error {
/**
* @deprecated error_test2 passes.
*/
public int field;
/**
* @deprecated error_test3 passes.
*/
public TestError() {}
/**
* @deprecated error_test4 passes.
*/
public void method() {}
}
| 1,394 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestAnnotationType.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testDeprecatedDocs/pkg/TestAnnotationType.java | /*
* Copyright (c) 2003, 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 pkg;
import java.lang.annotation.*;
/**
* @deprecated annotation_test1 passes.
*/
@Documented public @interface TestAnnotationType {
/**
* @deprecated annotation_test2 passes.
*/
String optional() default "unknown";
/**
* @deprecated annotation_test3 passes.
*/
int required();
}
| 1,381 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Iface.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testThrowsInheritence/Iface.java | /*
* Copyright (c) 2002, 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.
*/
import java.io.IOException;
public interface Iface {
/**
* Iface doc.
*
* @throws java.io.EOFException Test 1 passes.
* @throws IOException if I/O exception occurs
*/
void foo() throws IOException;
}
| 1,286 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testThrowsInheritence/C.java | /*
* Copyright (c) 2002, 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.
*/
public class C implements I {
/**
* @throws NullPointerException Test 1 passes.
*/
public void method() throws NullPointerException {}
}
| 1,210 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestThrowsTagInheritence.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testThrowsInheritence/TestThrowsTagInheritence.java | /*
* Copyright (c) 2002, 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 4684827 4633969
* @summary This test verifies that throws tags in implementing class
* override the throws tags in interface. This test also verifies that throws tags are inherited properly
* the case where the name of one exception is not fully qualified.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestThrowsTagInheritence
* @run main TestThrowsTagInheritence
*/
public class TestThrowsTagInheritence extends JavadocTester {
private static final String BUG_ID = "4684827-4633969";
private static final String[][] TEST = {
//The class should not inherit the tag from the interface.
{BUG_ID + FS + "Foo.html", "Test 1 passes."}
};
private static final String[][] NEGATED_TEST = {
//The class should not inherit the tag from the interface.
{BUG_ID + FS + "C.html", "Test 1 fails."}
};
private static final String[] ARGS = new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR, SRC_DIR + FS + "C.java",
SRC_DIR + FS + "I.java", SRC_DIR + FS + "Foo.java",
SRC_DIR + FS + "Iface.java"
};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestThrowsTagInheritence tester = new TestThrowsTagInheritence();
run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 2,701 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
I.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testThrowsInheritence/I.java | /*
* Copyright (c) 2002, 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.
*/
public interface I {
/**
* @throws java.lang.NullPointerException Test 1 fails
*/
public void method() throws NullPointerException;
}
| 1,206 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Foo.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testThrowsInheritence/Foo.java | /*
* Copyright (c) 2002, 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.
*/
import java.io.*;
public class Foo implements Iface {
/**
* Foo doc.
*
* @throws EOFException {@inheritDoc}
*/
public void foo() throws IOException {
}
}
| 1,239 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestBreakIterator.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java | /*
* Copyright (c) 2002, 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 4165985
* @summary Determine the end of the first sentence using BreakIterator.
* If the first sentence of "method" is parsed correctly, the test passes.
* Correct Answer: "The class is empty (i.e. it has no members)."
* Wrong Answer: "The class is empty (i.e."
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestBreakIterator
* @run main TestBreakIterator
*/
public class TestBreakIterator extends JavadocTester {
private static final String BUG_ID = "4165985";
private static final String[][] TEST = {
{BUG_ID + FS + "pkg" + FS + "BreakIteratorTest.html",
"The class is empty (i.e. it has no members)."}};
private static final String[][] NEGATED_TEST = NO_TEST;
private static final String[] ARGS =
new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR,
"-breakiterator", "pkg"};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestBreakIterator tester = new TestBreakIterator();
run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 2,465 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
BreakIteratorTest.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testBreakIterator/pkg/BreakIteratorTest.java | /*
* Copyright (c) 2001, 2002, 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 pkg;
/**
* The class is empty (i.e. it has no members).
*/
public class BreakIteratorTest {
}
| 1,163 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestEncoding.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testEncoding/TestEncoding.java | /*
* Copyright (c) 2002, 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 4661481
* @summary This test determines if the value of the -encoding option is
* properly passed from Javadoc to the source file parser.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestEncoding
* @run main TestEncoding
*/
public class TestEncoding extends JavadocTester {
private static final String BUG_ID = "4661481";
private static final String[][] TEST = NO_TEST;
//If ??? is found in the output, the source file was not read with the correct encoding setting.
private static final String[][] NEGATED_TEST = {
{BUG_ID + FS + "EncodeTest.html", "???"}
};
private static final String[] ARGS =
new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR,
"-encoding", "SJIS", SRC_DIR + FS + "EncodeTest.java"
};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestEncoding tester = new TestEncoding();
run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 2,387 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestTagHolderMethod.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testTagHolderMethod/TestTagHolderMethod.java | /*
* Copyright (c) 2002, 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.
*/
import com.sun.javadoc.*;
/*
* @test
* @bug 4706525
* @summary Determine if the new Tag.holder() method works properly.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestTagHolderMethod
* @run main TestTagHolderMethod
*/
public class TestTagHolderMethod extends JavadocTester {
private static final String BUG_ID = "4706525";
public static final String[] ARGS = new String[] {
"-docletpath", SRC_DIR, "-doclet", "TestTagHolderMethod", "-sourcepath",
SRC_DIR, "pkg"};
/**
* Doclet entry point.
*/
public static boolean start(RootDoc root) throws Exception {
ClassDoc[] classes = root.classes();
for (int i = 0; i < classes.length; i++) {
checkHolders(classes[i].fields());
checkHolders(classes[i].constructors());
checkHolders(classes[i].methods());
checkHolders(classes[i].innerClasses());
}
return true;
}
private static void checkHolders(Doc[] holders) throws Exception {
for (int i = 0; i < holders.length; i++) {
Doc holder = holders[i];
Tag[] tags = holder.tags();
for (int j = 0; j < tags.length; j++) {
if (! tags[j].holder().name().equals(holder.name())) {
throw new Exception("The holder method does not return the correct Doc object.");
} else {
System.out.println(tags[j].name() + " is held by " + holder.name());
}
}
}
}
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
run(new TestTagHolderMethod(), ARGS, new String[][]{}, new String[][]{});
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 3,071 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testTagHolderMethod/pkg/C.java | /*
* Copyright (c) 2002, 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 pkg;
/**
* @author Jamie Ho
*/
public class C {
/**
* @see www.yahoo.com
*/
public int field;
/**
* @see www.yahoo.com
*/
public C() {}
/**
* @see www.yahoo.com
*/
public void method(){}
/**
* @see www.yahoo.com
*/
public class innerClass {}
}
| 1,385 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
AccessAsciiArt.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/AccessAsciiArt/AccessAsciiArt.java | /*
* Copyright (c) 2002, 2010, 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 4706779 4956908
* @summary Add text equivalent of class tree ASCII art for accessibility
* @author dkramer
* @run main AccessAsciiArt
*/
import com.sun.javadoc.*;
import java.util.*;
import java.io.*;
/**
* Runs javadoc and runs regression tests on the resulting HTML.
* It reads each file, complete with newlines, into a string to easily
* find strings that contain newlines.
*/
public class AccessAsciiArt {
private static final String BUGID = "4706779-4956908";
private static final String BUGNAME = "AccessAsciiArt";
private static final String FS = System.getProperty("file.separator");
private static final String PS = System.getProperty("path.separator");
private static final String TMPDEST_DIR1 = "." + FS + "docs1" + FS;
private static final String TMPDEST_DIR2 = "." + FS + "docs2" + FS;
// Subtest number. Needed because runResultsOnHTML is run twice,
// and subtestNum should increment across subtest runs.
public static int subtestNum = 0;
public static int numSubtestsPassed = 0;
// Entry point
public static void main(String[] args) {
// Directory that contains source files that javadoc runs on
String srcdir = System.getProperty("test.src", ".");
// Test for all cases except the split index page
runJavadoc(new String[] {"-d", TMPDEST_DIR1,
"-sourcepath", srcdir,
"p1", "p1.subpkg"});
runTestsOnHTML(testArray);
printSummary();
}
/** Run javadoc */
public static void runJavadoc(String[] javadocArgs) {
if (com.sun.tools.javadoc.Main.execute(javadocArgs) != 0) {
throw new Error("Javadoc failed to execute");
}
}
/**
* Assign value for [ stringToFind, filename ]
* NOTE: The standard doclet uses the same separator "\n" for all OS's
*/
private static final String[][] testArray = {
// Test the top line of the class tree
{
"<li><a href=\"../../p1/C.html\" title=\"class in p1\">p1.C</a></li>",
TMPDEST_DIR1 + "p1" + FS + "subpkg" + FS + "SSC.html" },
// Test the second line of the class tree
{
"<li><a href=\"../../p1/SC.html\" title=\"class in p1\">p1.SC</a></li>",
TMPDEST_DIR1 + "p1" + FS + "subpkg" + FS + "SSC.html" },
// Test the third line of the class tree
{
"<li>p1.subpkg.SSC</li>",
TMPDEST_DIR1 + "p1" + FS + "subpkg" + FS +"SSC.html" },
};
public static void runTestsOnHTML(String[][] testArray) {
for (int i = 0; i < testArray.length; i++) {
subtestNum += 1;
// Read contents of file into a string
String fileString = readFileToString(testArray[i][1]);
// Get string to find
String stringToFind = testArray[i][0];
// Find string in file's contents
if (findString(fileString, stringToFind) == -1) {
System.out.println("\nSub-test " + (subtestNum)
+ " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n"
+ "when searching for:\n"
+ stringToFind);
} else {
numSubtestsPassed += 1;
System.out.println("\nSub-test " + (subtestNum) + " passed:\n" + stringToFind);
}
}
}
public static void printSummary() {
if ( numSubtestsPassed == subtestNum ) {
System.out.println("\nAll " + numSubtestsPassed + " subtests passed");
} else {
throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum)
+ " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n");
}
}
// Read the file into a String
public static String readFileToString(String filename) {
try {
File file = new File(filename);
if ( !file.exists() ) {
System.out.println("\nFILE DOES NOT EXIST: " + filename);
}
BufferedReader in = new BufferedReader(new FileReader(file));
// Create an array of characters the size of the file
char[] allChars = new char[(int)file.length()];
// Read the characters into the allChars array
in.read(allChars, 0, (int)file.length());
in.close();
// Convert to a string
String allCharsString = new String(allChars);
return allCharsString;
} catch (FileNotFoundException e) {
System.err.println(e);
return "";
} catch (IOException e) {
System.err.println(e);
return "";
}
}
public static int findString(String fileString, String stringToFind) {
return fileString.indexOf(stringToFind);
}
}
| 6,001 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
SC.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/AccessAsciiArt/p1/SC.java | /*
* Copyright (c) 2002, 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 p1;
public class SC extends C {
}
| 1,095 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/AccessAsciiArt/p1/C.java | /*
* Copyright (c) 2002, 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 p1;
public class C implements SI {
}
| 1,098 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
SI.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/AccessAsciiArt/p1/SI.java | /*
* Copyright (c) 2002, 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 p1;
public interface SI extends I {
}
| 1,099 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
I.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/AccessAsciiArt/p1/I.java | /*
* Copyright (c) 2002, 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 p1;
public interface I {
}
| 1,088 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
SSC.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/AccessAsciiArt/p1/subpkg/SSC.java | /*
* Copyright (c) 2002, 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 p1.subpkg;
public class SSC extends p1.SC {
}
| 1,107 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
AccessSkipNav.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/AccessSkipNav/AccessSkipNav.java | /*
* Copyright (c) 2002, 2010, 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 4638136
* @summary Add ability to skip over nav bar for accessibility
* @author dkramer
* @run main AccessSkipNav
*/
import com.sun.javadoc.*;
import java.util.*;
import java.io.*;
/**
* Runs javadoc and runs regression tests on the resulting HTML.
* It reads each file, complete with newlines, into a string to easily
* find strings that contain newlines.
*/
public class AccessSkipNav {
private static final String BUGID = "4638136";
private static final String BUGNAME = "AccessSkipNav";
private static final String FS = System.getProperty("file.separator");
private static final String PS = System.getProperty("path.separator");
private static final String LS = System.getProperty("line.separator");
private static final String TMPDEST_DIR1 = "." + FS + "docs1" + FS;
private static final String TMPDEST_DIR2 = "." + FS + "docs2" + FS;
// Subtest number. Needed because runResultsOnHTML is run twice,
// and subtestNum should increment across subtest runs.
public static int subtestNum = 0;
public static int numSubtestsPassed = 0;
// Entry point
public static void main(String[] args) {
// Directory that contains source files that javadoc runs on
String srcdir = System.getProperty("test.src", ".");
// Test for all cases except the split index page
runJavadoc(new String[] {"-d", TMPDEST_DIR1,
"-sourcepath", srcdir,
"p1", "p2"});
runTestsOnHTML(testArray);
printSummary();
}
/** Run javadoc */
public static void runJavadoc(String[] javadocArgs) {
if (com.sun.tools.javadoc.Main.execute(javadocArgs) != 0) {
throw new Error("Javadoc failed to execute");
}
}
/**
* Assign value for [ stringToFind, filename ]
* NOTE: The standard doclet uses the same separator "\n" for all OS's
*/
private static final String[][] testArray = {
// Testing only for the presence of the <a href> and <a name>
// Top navbar <a href>
{ "<a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a>",
TMPDEST_DIR1 + "p1" + FS + "C1.html" },
// Top navbar <a name>
{ "<a name=\"skip-navbar_top\">" + LS +
"<!-- -->" + LS + "</a>",
TMPDEST_DIR1 + "p1" + FS + "C1.html" },
// Bottom navbar <a href>
{ "<a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a>",
TMPDEST_DIR1 + "p1" + FS + "C1.html" },
// Bottom navbar <a name>
{ "<a name=\"skip-navbar_bottom\">" + LS +
"<!-- -->" + LS + "</a>",
TMPDEST_DIR1 + "p1" + FS + "C1.html" }
};
public static void runTestsOnHTML(String[][] testArray) {
for (int i = 0; i < testArray.length; i++) {
subtestNum += 1;
// Read contents of file into a string
String fileString = readFileToString(testArray[i][1]);
// Get string to find
String stringToFind = testArray[i][0];
// Find string in file's contents
if (findString(fileString, stringToFind) == -1) {
System.out.println("\nSub-test " + (subtestNum)
+ " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n"
+ "when searching for:\n"
+ stringToFind);
} else {
numSubtestsPassed += 1;
System.out.println("\nSub-test " + (subtestNum) + " passed:\n" + stringToFind);
}
}
}
public static void printSummary() {
if ( numSubtestsPassed == subtestNum ) {
System.out.println("\nAll " + numSubtestsPassed + " subtests passed");
} else {
throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum)
+ " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n");
}
}
// Read the file into a String
public static String readFileToString(String filename) {
try {
File file = new File(filename);
if ( !file.exists() ) {
System.out.println("\nFILE DOES NOT EXIST: " + filename);
}
BufferedReader in = new BufferedReader(new FileReader(file));
// Create an array of characters the size of the file
char[] allChars = new char[(int)file.length()];
// Read the characters into the allChars array
in.read(allChars, 0, (int)file.length());
in.close();
// Convert to a string
String allCharsString = new String(allChars);
return allCharsString;
} catch (FileNotFoundException e) {
System.err.println(e);
return "";
} catch (IOException e) {
System.err.println(e);
return "";
}
}
public static int findString(String fileString, String stringToFind) {
return fileString.indexOf(stringToFind);
}
}
| 6,276 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/AccessSkipNav/p1/C1.java | /*
* Copyright (c) 2002, 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 p1;
public class C1 {
}
| 1,085 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/AccessSkipNav/p2/C2.java | /*
* Copyright (c) 2002, 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 p2;
public class C2 {
}
| 1,085 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestEmptyClass.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testEmptyClass/TestEmptyClass.java | /*
* Copyright (c) 2001, 2006, 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 4483401 4483407 4483409 4483413 4494343
* @summary Test to make sure that Javadoc behaves properly when
* run on a completely empty class (no comments or members).
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestEmptyClass
* @run main TestEmptyClass
*/
public class TestEmptyClass extends JavadocTester {
private static final String OUTPUT_DIR = "tmp";
private static final String[][] TEST = NO_TEST;
private static final String[][] NEGATED_TEST = {
//The overview tree should not link to classes that were not documented
{OUTPUT_DIR + FS + "overview-tree.html", "<A HREF=\"TestEmptyClass.html\">"},
//The index page should not link to classes that were not documented
{OUTPUT_DIR + FS + "index-all.html", "<A HREF=\"TestEmptyClass.html\">"},
};
private static final String[] ARGS =
new String[] {
"-classpath", SRC_DIR + FS + "src",
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR + FS + "src",
SRC_DIR + FS + "src" + FS + "Empty.java"
};
private static final String BUG_ID = "4483401 4483407 4483409 4483413 4494343";
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestEmptyClass tester = new TestEmptyClass();
int exitCode = run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
if (exitCode != 0) {
throw new Error("Error found while executing Javadoc");
}
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 2,863 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Empty.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testEmptyClass/src/Empty.java | /*
* Copyright (c) 2001, 2002, 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.
*/
public class Empty
{
}
| 1,081 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestStylesheet.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java | /*
* Copyright (c) 2005, 2011, 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 4494033 7028815 7052425
* @summary Run tests on doclet stylesheet.
* @author jamieh
* @library ../lib/
* @build JavadocTester TestStylesheet
* @run main TestStylesheet
*/
public class TestStylesheet extends JavadocTester {
//Test information.
private static final String BUG_ID = "4494033-7028815-7052425";
//Javadoc arguments.
private static final String[] ARGS = new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
};
//Input for string search tests.
private static final String[][] TEST = {
{BUG_ID + FS + "stylesheet.css",
"/* Javadoc style sheet */"},
{BUG_ID + FS + "stylesheet.css",
"/*" + NL + "Overall document style" + NL + "*/"},
{BUG_ID + FS + "stylesheet.css",
"/*" + NL + "Heading styles" + NL + "*/"},
{BUG_ID + FS + "stylesheet.css",
"/*" + NL + "Navigation bar styles" + NL + "*/"},
{BUG_ID + FS + "stylesheet.css",
"body {" + NL + " background-color:#ffffff;" + NL +
" color:#353833;" + NL +
" font-family:Arial, Helvetica, sans-serif;" + NL +
" font-size:76%;" + NL + " margin:0;" + NL + "}"},
{BUG_ID + FS + "stylesheet.css",
"ul {" + NL + " list-style-type:disc;" + NL + "}"},
// Test whether a link to the stylesheet file is inserted properly
// in the class documentation.
{BUG_ID + FS + "pkg" + FS + "A.html",
"<link rel=\"stylesheet\" type=\"text/css\" " +
"href=\"../stylesheet.css\" title=\"Style\">"}
};
private static final String[][] NEGATED_TEST = {
{BUG_ID + FS + "stylesheet.css",
"* {" + NL + " margin:0;" + NL + " padding:0;" + NL + "}"}
};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestStylesheet tester = new TestStylesheet();
run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 3,433 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
A.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testStylesheet/pkg/A.java | /*
* Copyright (c) 2005, 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 pkg;
public class A {}
| 1,084 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestClassTree.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java | /*
* Copyright (c) 2004, 2010, 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 4632553 4973607
* @summary No need to include type name (class, interface, etc.) before
* every single type in class tree.
* Make sure class tree includes heirarchy for enums and annotation
* types.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestClassTree
* @run main TestClassTree
*/
public class TestClassTree extends JavadocTester {
//Test information.
private static final String BUG_ID = "4632553-4973607";
//Javadoc arguments.
private static final String[] ARGS = new String[] {
"-d", BUG_ID, "-source", "1.5","-sourcepath", SRC_DIR, "pkg"
};
//Input for string search tests.
private static final String[][] TEST = {
{BUG_ID + FS + "pkg" + FS + "package-tree.html",
"<ul>" + NL + "<li type=\"circle\">pkg.<a href=\"../pkg/ParentClass.html\" " +
"title=\"class in pkg\"><span class=\"strong\">ParentClass</span></a>"},
{BUG_ID + FS + "pkg" + FS + "package-tree.html",
"<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>" + NL +
"<ul>" + NL + "<li type=\"circle\">pkg.<a href=\"../pkg/AnnotationType.html\" " +
"title=\"annotation in pkg\"><span class=\"strong\">AnnotationType</span></a> " +
"(implements java.lang.annotation.Annotation)</li>" + NL + "</ul>"},
{BUG_ID + FS + "pkg" + FS + "package-tree.html",
"<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>" + NL + "<ul>" + NL +
"<li type=\"circle\">java.lang.Object" + NL + "<ul>" + NL +
"<li type=\"circle\">java.lang.Enum<E> (implements java.lang." +
"Comparable<T>, java.io.Serializable)" + NL + "<ul>" + NL +
"<li type=\"circle\">pkg.<a href=\"../pkg/Coin.html\" " +
"title=\"enum in pkg\"><span class=\"strong\">Coin</span></a></li>" + NL +
"</ul>" + NL + "</li>" + NL + "</ul>" + NL + "</li>" + NL + "</ul>"
},
};
private static final String[][] NEGATED_TEST = {
{BUG_ID + FS + "pkg" + FS + "package-tree.html",
"<li type=\"circle\">class pkg.<a href=\"../pkg/ParentClass.html\" " +
"title=\"class in pkg\"><span class=\"strong\">ParentClass</span></a></li>"}
};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestClassTree tester = new TestClassTree();
run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 3,901 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
ParentClass.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testClassTree/pkg/ParentClass.java | /*
* Copyright (c) 2004, 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 pkg;
public class ParentClass {}
| 1,094 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
ChildClass.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testClassTree/pkg/ChildClass.java | /*
* Copyright (c) 2004, 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 pkg;
public class ChildClass extends ParentClass {}
| 1,113 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Coin.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testClassTree/pkg/Coin.java | /*
* Copyright (c) 2004, 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 pkg;
/**
* This is a sample Enum.
*
* @author Jamie Ho
*/
public enum Coin {
Penny, Nickel, Dime;
public Coin(int i) {}
}
| 1,192 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
AnnotationType.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testClassTree/pkg/AnnotationType.java | /*
* Copyright (c) 2004, 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 pkg;
import java.lang.annotation.*;
/**
* This is just a test annotation type.
*
* @author Jamie Ho.
* @since 1.5
*/
@Documented public @interface AnnotationType {
/**
* The copyright holder.
*/
String optional() default "unknown";
/**
* The year of the copyright.
*/
int required();
}
| 1,388 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testSerialVersionUID/C.java | /*
* Copyright (c) 2002, 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.
*/
public class C implements java.io.Serializable {
/** use serialVersionUID from JDK 1.0.2 for interoperability */
private static final long serialVersionUID = -111111111111111L;
}
| 1,239 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestSerialVersionUID.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testSerialVersionUID/TestSerialVersionUID.java | /*
* Copyright (c) 2002, 2003, 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 4525039
* @summary Test to make sure that the serialVersionUID is properly
* documented in the serialized form.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestSerialVersionUID
* @run main TestSerialVersionUID
*/
public class TestSerialVersionUID extends JavadocTester {
//Test information.
private static final String BUG_ID = "4525039";
private static final String OUTPUT_DIR = "docs-" + BUG_ID;
//Javadoc arguments.
private static final String[] ARGS = new String[] {
"-d", OUTPUT_DIR,
SRC_DIR + FS + "C.java"
};
//Input for string search tests.
private static final String[][] TEST = {
{OUTPUT_DIR + FS + "serialized-form.html", "-111111111111111L"}
};
private static final String[][] NEGATED_TEST = NO_TEST;
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestSerialVersionUID tester = new TestSerialVersionUID();
run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 2,424 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
ValidHtml.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/ValidHtml/ValidHtml.java | /*
* Copyright (c) 2002, 2010, 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 4275630 4749453 4625400 4753048 4415270
* @summary Generated HTML is invalid with frameset DTD.
* Displays unnecessary horizontal scroll bars.
* Missing whitespace in DOCTYPE declaration
* <NOFRAMES> not allowed outside <FRAMESET> element
* HTML table tags inserted in wrong place in pakcage use page
* @author dkramer
* @run main ValidHtml
*/
import com.sun.javadoc.*;
import java.util.*;
import java.io.*;
/**
* Runs javadoc and runs regression tests on the resulting HTML.
* It reads each file, complete with newlines, into a string to easily
* find strings that contain newlines.
*/
public class ValidHtml {
private static final String BUGID = "4275630";
private static final String BUGNAME = "ValidHtml";
private static final String FS = System.getProperty("file.separator");
private static final String PS = System.getProperty("path.separator");
private static final String LS = System.getProperty("line.separator");
private static final String TMPDEST_DIR1 = "." + FS + "docs1" + FS;
private static final String TMPDEST_DIR2 = "." + FS + "docs2" + FS;
// Subtest number. Needed because runResultsOnHTML is run twice,
// and subtestNum should increment across subtest runs.
public static int subtestNum = 0;
public static int numSubtestsPassed = 0;
// Entry point
public static void main(String[] args) {
// Directory that contains source files that javadoc runs on
String srcdir = System.getProperty("test.src", ".");
// Test for all cases except the split index page
runJavadoc(new String[]{"-d", TMPDEST_DIR1,
"-doctitle", "Document Title",
"-windowtitle", "Window Title",
"-use",
"-overview", (srcdir + FS + "overview.html"),
"-sourcepath", srcdir,
"p1", "p2"
});
runTestsOnHTML(testArray);
printSummary();
}
/** Run javadoc */
public static void runJavadoc(String[] javadocArgs) {
if (com.sun.tools.javadoc.Main.execute(javadocArgs) != 0) {
throw new Error("Javadoc failed to execute");
}
}
/**
* Assign value for [ stringToFind, filename ]
* NOTE: The standard doclet uses the same separator "\n" for all OS's
*/
private static final String[][] testArray = {
// Test the proper DOCTYPE element is present:
{
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">",
TMPDEST_DIR1 + "index.html"
},
// Test the proper DOCTYPE element is present:
{
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
TMPDEST_DIR1 + "overview-summary.html"
},
// Test the proper DOCTYPE element is present:
{
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
TMPDEST_DIR1 + "p1" + FS + "package-summary.html"
},
// Test the proper DOCTYPE element is present:
{
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
TMPDEST_DIR1 + "p1" + FS + "C.html"
},
// Test the proper DOCTYPE element is present:
{
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
TMPDEST_DIR1 + "overview-frame.html"
},
// Test the proper DOCTYPE element is present:
{
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
TMPDEST_DIR1 + "allclasses-frame.html"
},
// Test the proper DOCTYPE element is present:
{
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
TMPDEST_DIR1 + "p1" + FS + "package-frame.html"
},
// Test that <NOFRAMES> is inside <FRAMESET> element:
{
"</noframes>" + LS + "</frameset>",
TMPDEST_DIR1 + "index.html"
},
// Test the table elements are in the correct order:
{
"</td>" + LS + "</tr>",
TMPDEST_DIR1 + FS + "p1" + FS + "package-use.html"
}
};
public static void runTestsOnHTML(String[][] testArray) {
for (int i = 0; i < testArray.length; i++) {
subtestNum += 1;
// Read contents of file into a string
String fileString = readFileToString(testArray[i][1]);
// Get string to find
String stringToFind = testArray[i][0];
// Find string in file's contents
if (findString(fileString, stringToFind) == -1) {
System.out.println("\nSub-test " + (subtestNum) + " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n" + "when searching for:\n" + stringToFind);
} else {
numSubtestsPassed += 1;
System.out.println("\nSub-test " + (subtestNum) + " passed:\n" + stringToFind);
}
}
}
public static void printSummary() {
if (numSubtestsPassed == subtestNum) {
System.out.println("\nAll " + numSubtestsPassed + " subtests passed");
} else {
throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum) + " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n");
}
}
// Read the file into a String
public static String readFileToString(String filename) {
try {
File file = new File(filename);
if (!file.exists()) {
System.out.println("\nFILE DOES NOT EXIST: " + filename);
}
BufferedReader in = new BufferedReader(new FileReader(file));
// Create an array of characters the size of the file
char[] allChars = new char[(int) file.length()];
// Read the characters into the allChars array
in.read(allChars, 0, (int) file.length());
in.close();
// Convert to a string
String allCharsString = new String(allChars);
return allCharsString;
} catch (FileNotFoundException e) {
System.err.println(e);
return "";
} catch (IOException e) {
System.err.println(e);
return "";
}
}
public static int findString(String fileString, String stringToFind) {
return fileString.indexOf(stringToFind);
}
}
| 7,882 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/ValidHtml/p1/C.java | /*
* Copyright (c) 2002, 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 p1;
public class C {
/**
* @param classparam C type included for "use"test
* @return String "Hi"
*/
public String publicMethod(C classparam) {
return "Hi";
}
}
| 1,259 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/ValidHtml/p2/C2.java | /*
* Copyright (c) 2002, 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 p2;
public class C2 {
}
| 1,085 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testBackSlashInLink/C.java | /* /nodynamiccopyright/ */
/**
* This is a comment.
*/
public class C {}
| 77 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestBackSlashInLink.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java | /*
* Copyright (c) 2002, 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 4511110
* @summary Test to make sure that the link to source documentation
* has a forward slash. It would be wrong to use a back slash.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestBackSlashInLink
* @run main TestBackSlashInLink
*/
public class TestBackSlashInLink extends JavadocTester {
private static final String BUG_ID = "4511110";
private static final String[][] TEST = {
{BUG_ID + FS + "C.html", "src-html/C.html#line.7"}};
private static final String[][] NEGATED_TEST = NO_TEST;
private static final String[] ARGS =
new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR,
"-linksource", SRC_DIR + FS + "C.java"};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestBackSlashInLink tester = new TestBackSlashInLink();
run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 2,302 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
PackagesHeader.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java | /*
* Copyright (c) 2002, 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 4766385
* @summary Test that the header option for upper left frame
* is present for three sets of options: (1) -header,
* (2) -packagesheader, and (3) -header -packagesheader
* @author dkramer
* @library ../lib/
* @build JavadocTester
* @build PackagesHeader
* @run main PackagesHeader
*/
public class PackagesHeader extends JavadocTester {
//Test information.
private static final String BUG_ID = "4766385";
private static final String OUTPUT_DIR = "docs-" + BUG_ID;
private static final String OUTPUT_DIR1 = "docs1-" + BUG_ID + FS;
private static final String OUTPUT_DIR2 = "docs2-" + BUG_ID + FS;
private static final String OUTPUT_DIR3 = "docs3-" + BUG_ID + FS;
/**
* Assign value for [ fileToSearch, stringToFind ]
*/
private static final String[][] TESTARRAY1 = {
// Test that the -header shows up in the packages frame
{ OUTPUT_DIR1 + "overview-frame.html",
"Main Frame Header" }
};
private static final String[][] TESTARRAY2 = {
// Test that the -packagesheader string shows
// up in the packages frame
{ OUTPUT_DIR2 + "overview-frame.html",
"Packages Frame Header" }
};
private static final String[][] TESTARRAY3 = {
// Test that the both headers show up and are different
{ OUTPUT_DIR3 + "overview-frame.html",
"Packages Frame Header" },
{ OUTPUT_DIR3 + "overview-summary.html",
"Main Frame Header" }
};
// First test with -header only
private static final String[] JAVADOC_ARGS1 = new String[] {
"-d", OUTPUT_DIR1,
"-header", "Main Frame Header",
"-sourcepath", SRC_DIR,
"p1", "p2"};
// Second test with -packagesheader only
private static final String[] JAVADOC_ARGS2 = new String[] {
"-d", OUTPUT_DIR2,
"-packagesheader", "Packages Frame Header",
"-sourcepath", SRC_DIR,
"p1", "p2"};
// Third test with both -packagesheader and -header
private static final String[] JAVADOC_ARGS3 = new String[] {
"-d", OUTPUT_DIR3,
"-packagesheader", "Packages Frame Header",
"-header", "Main Frame Header",
"-sourcepath", SRC_DIR,
"p1", "p2"};
//Input for string search tests.
private static final String[][] NEGATED_TEST = NO_TEST;
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
JavadocTester tester = new PackagesHeader();
run(tester, JAVADOC_ARGS1, TESTARRAY1, NEGATED_TEST);
run(tester, JAVADOC_ARGS2, TESTARRAY2, NEGATED_TEST);
run(tester, JAVADOC_ARGS3, TESTARRAY3, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 4,194 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/PackagesHeader/p1/C1.java | /*
* Copyright (c) 2002, 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 p1;
public class C1 {
}
| 1,085 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/PackagesHeader/p2/C2.java | /*
* Copyright (c) 2002, 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 p2;
public class C2 {
}
| 1,085 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestHtmlDocument.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java | /*
* Copyright (c) 2010, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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 6851834
* @summary This test verifies the HTML document generation for javadoc output.
* @author Bhavesh Patel
* @build TestHtmlDocument
* @run main TestHtmlDocument
*/
import java.io.*;
import com.sun.tools.doclets.formats.html.markup.*;
/**
* The class reads each file, complete with newlines, into a string to easily
* compare the existing markup with the generated markup.
*/
public class TestHtmlDocument {
private static final String BUGID = "6851834";
private static final String BUGNAME = "TestHtmlDocument";
private static final String FS = System.getProperty("file.separator");
private static final String LS = System.getProperty("line.separator");
private static String srcdir = System.getProperty("test.src", ".");
// Entry point
public static void main(String[] args) throws IOException {
// Check whether the generated markup is same as the existing markup.
if (generateHtmlTree().equals(readFileToString(srcdir + FS + "testMarkup.html"))) {
System.out.println("\nTest passed for bug " + BUGID + " (" + BUGNAME + ")\n");
} else {
throw new Error("\nTest failed for bug " + BUGID + " (" + BUGNAME + ")\n");
}
}
// Generate the HTML output using the HTML document generation within doclet.
public static String generateHtmlTree() {
// Document type for the HTML document
DocType htmlDocType = DocType.Transitional();
HtmlTree html = new HtmlTree(HtmlTag.HTML);
HtmlTree head = new HtmlTree(HtmlTag.HEAD);
HtmlTree title = new HtmlTree(HtmlTag.TITLE);
// String content within the document
StringContent titleContent = new StringContent("Markup test");
title.addContent(titleContent);
head.addContent(title);
// Test META tag
HtmlTree meta = new HtmlTree(HtmlTag.META);
meta.addAttr(HtmlAttr.NAME, "keywords");
meta.addAttr(HtmlAttr.CONTENT, "testContent");
head.addContent(meta);
// Test invalid META tag
HtmlTree invmeta = new HtmlTree(HtmlTag.META);
head.addContent(invmeta);
// Test LINK tag
HtmlTree link = new HtmlTree(HtmlTag.LINK);
link.addAttr(HtmlAttr.REL, "testRel");
link.addAttr(HtmlAttr.HREF, "testLink.html");
head.addContent(link);
// Test invalid LINK tag
HtmlTree invlink = new HtmlTree(HtmlTag.LINK);
head.addContent(invlink);
html.addContent(head);
// Comment within the document
Comment bodyMarker = new Comment("======== START OF BODY ========");
html.addContent(bodyMarker);
HtmlTree body = new HtmlTree(HtmlTag.BODY);
Comment pMarker = new Comment("======== START OF PARAGRAPH ========");
body.addContent(pMarker);
HtmlTree p = new HtmlTree(HtmlTag.P);
StringContent bodyContent = new StringContent(
"This document is generated from sample source code and HTML " +
"files with examples of a wide variety of Java language constructs: packages, " +
"subclasses, subinterfaces, nested classes, nested interfaces," +
"inheriting from other packages, constructors, fields," +
"methods, and so forth. ");
p.addContent(bodyContent);
StringContent anchorContent = new StringContent("Click Here");
p.addContent(HtmlTree.A("testLink.html", anchorContent));
StringContent pContent = new StringContent(" to <test> out a link.");
p.addContent(pContent);
body.addContent(p);
HtmlTree p1 = new HtmlTree(HtmlTag.P);
// Test another version of A tag.
HtmlTree anchor = new HtmlTree(HtmlTag.A);
anchor.addAttr(HtmlAttr.HREF, "testLink.html");
anchor.addAttr(HtmlAttr.NAME, "Another version of a tag");
p1.addContent(anchor);
body.addContent(p1);
// Test for empty tags.
HtmlTree dl = new HtmlTree(HtmlTag.DL);
html.addContent(dl);
// Test for empty nested tags.
HtmlTree dlTree = new HtmlTree(HtmlTag.DL);
dlTree.addContent(new HtmlTree(HtmlTag.DT));
dlTree.addContent(new HtmlTree (HtmlTag.DD));
html.addContent(dlTree);
HtmlTree dlDisplay = new HtmlTree(HtmlTag.DL);
dlDisplay.addContent(new HtmlTree(HtmlTag.DT));
HtmlTree dd = new HtmlTree (HtmlTag.DD);
StringContent ddContent = new StringContent("Test DD");
dd.addContent(ddContent);
dlDisplay.addContent(dd);
body.addContent(dlDisplay);
StringContent emptyString = new StringContent("");
body.addContent(emptyString);
Comment emptyComment = new Comment("");
body.addContent(emptyComment);
HtmlTree hr = new HtmlTree(HtmlTag.HR);
body.addContent(hr);
html.addContent(body);
HtmlDocument htmlDoc = new HtmlDocument(htmlDocType, html);
return htmlDoc.toString();
}
// Read the file into a String
public static String readFileToString(String filename) throws IOException {
File file = new File(filename);
if ( !file.exists() ) {
System.out.println("\nFILE DOES NOT EXIST: " + filename);
}
BufferedReader in = new BufferedReader(new FileReader(file));
StringBuilder fileString = new StringBuilder();
// Create an array of characters the size of the file
try {
String line;
while ((line = in.readLine()) != null) {
fileString.append(line);
fileString.append(LS);
}
} finally {
in.close();
}
return fileString.toString();
}
}
| 6,967 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TemplateComplete.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/_template/TemplateComplete.java | /*
* Copyright (c) 2002, 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 0000000
* @summary <DESC>
* @author jamieh
* @library ../lib/
* @ignore This is a template for regression tests.
* @build JavadocTester
* @build <CLASS NAME>
* @run main <CLASS NAME>
*/
public class TemplateComplete extends JavadocTester {
//Test information.
private static final String BUG_ID = "<BUG ID>";
private static final String OUTPUT_DIR = "docs-" + BUG_ID;
//Javadoc arguments.
private static final String[] ARGS = new String[] {
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR
};
//Input for string search tests.
private static final String[][] TEST = NO_TEST;
private static final String[][] NEGATED_TEST = NO_TEST;
//Input for Javadoc return code test.
private static final int EXPECTED_EXIT_CODE = 0;
//Input for file diff test.
private static final String[][] FILES_TO_DIFF = {};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TemplateComplete tester = new TemplateComplete();
int actualExitCode = run(tester, ARGS, TEST, NEGATED_TEST);
tester.checkExitCode(EXPECTED_EXIT_CODE, actualExitCode);
tester.runDiffs(FILES_TO_DIFF, false);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 2,596 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Template.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/_template/Template.java | /*
* Copyright (c) 2002, 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 0000000
* @summary <DESC>
* @author jamieh
* @library ../lib/
* @ignore This is a template for regression tests.
* @build JavadocTester
* @build <CLASS NAME>
* @run main <CLASS NAME>
*/
public class Template extends JavadocTester {
//Test information.
private static final String BUG_ID = "<BUG ID>";
private static final String OUTPUT_DIR = "docs-" + BUG_ID;
//Javadoc arguments.
private static final String[] ARGS = new String[] {
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR
};
//Input for string search tests.
private static final String[][] TEST = NO_TEST;
private static final String[][] NEGATED_TEST = NO_TEST;
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
Template tester = new Template();
run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 2,252 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestHtmlDefinitionListTag.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java | /*
* Copyright (c) 2009, 2011, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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 6786690 6820360
* @summary This test verifies the nesting of definition list tags.
* @author Bhavesh Patel
* @library ../lib/
* @build JavadocTester TestHtmlDefinitionListTag
* @run main TestHtmlDefinitionListTag
*/
public class TestHtmlDefinitionListTag extends JavadocTester {
private static final String BUG_ID = "6786690-6820360";
// Test common to all runs of javadoc. The class signature should print
// properly enclosed definition list tags and the Annotation Type
// Optional Element should print properly nested definition list tags
// for default value.
private static final String[][] TEST_ALL = {
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<pre>public class " +
"<span class=\"strong\">C1</span>" + NL +
"extends java.lang.Object" + NL + "implements java.io.Serializable</pre>"},
{BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl>" + NL +
"<dt>Default:</dt>" + NL + "<dd>true</dd>" + NL +
"</dl>"}};
// Test for normal run of javadoc in which various ClassDocs and
// serialized form should have properly nested definition list tags
// enclosing comments, tags and deprecated information.
private static final String[][] TEST_CMNT_DEPR = {
{BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>" +
"<dt><span class=\"strong\">Since:</span></dt>" + NL +
" <dd>JDK1.0</dd></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Since:</span></dt>" + NL +
" <dd>JDK1.0</dd>" + NL + "<dt><span class=\"strong\">See Also:</span></dt>" +
"<dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\"><code>" +
"C2</code></a>, " + NL + "<a href=\"../serialized-form.html#pkg1.C1\">" +
"Serialized Form</a></dd></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Since:</span></dt>" + NL +
" <dd>1.4</dd>" + NL +
"<dt><span class=\"strong\">See Also:</span></dt><dd>" +
"<a href=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
"<code>setUndecorated(boolean)</code></a></dd></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>title" +
"</code> - the title</dd><dd><code>test</code> - boolean value" +
"</dd>" + NL + "<dt><span class=\"strong\">Throws:</span></dt>" + NL +
"<dd><code>java.lang.IllegalArgumentException</code> - if the " +
"<code>owner</code>'s" + NL +
" <code>GraphicsConfiguration</code> is not from a screen " +
"device</dd>" + NL + "<dd><code>HeadlessException</code></dd></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>undecorated" +
"</code> - <code>true</code> if no decorations are" + NL +
" to be enabled;" + NL + " <code>false</code> " +
"if decorations are to be enabled.</dd><dt><span class=\"strong\">Since:" +
"</span></dt>" + NL + " <dd>1.4</dd>" + NL +
"<dt><span class=\"strong\">See Also:</span></dt><dd>" +
"<a href=\"../pkg1/C1.html#readObject()\"><code>readObject()" +
"</code></a></dd></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Throws:</span></dt>" + NL +
"<dd><code>java.io.IOException</code></dd><dt><span class=\"strong\">See Also:" +
"</span></dt><dd><a href=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
"<code>setUndecorated(boolean)</code></a></dd></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl><dt><span class=\"strong\">Parameters:" +
"</span></dt><dd><code>set</code> - boolean</dd><dt><span class=\"strong\">" +
"Since:</span></dt>" + NL + " <dd>1.4</dd></dl>"},
{BUG_ID + FS + "serialized-form.html", "<dl><dt><span class=\"strong\">Throws:</span>" +
"</dt>" + NL + "<dd><code>" +
"java.io.IOException</code></dd><dt><span class=\"strong\">See Also:</span>" +
"</dt><dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
"<code>C1.setUndecorated(boolean)</code></a></dd></dl>"},
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
" <i>As of JDK version 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
"<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
"<div class=\"block\">This field indicates whether the C1 is " +
"undecorated.</div>" + NL + " " + NL + "<dl><dt><span class=\"strong\">Since:</span></dt>" + NL +
" <dd>1.4</dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
"</dt><dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
"<code>C1.setUndecorated(boolean)</code></a></dd></dl>"},
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
" <i>As of JDK version 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
"<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
"<div class=\"block\">Reads the object stream.</div>" + NL +
"<dl><dt><span class=\"strong\">Throws:" +
"</span></dt>" + NL + "<dd><code><code>" +
"IOException</code></code></dd>" + NL +
"<dd><code>java.io.IOException</code></dd></dl>"},
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
" </div>" + NL +
"<div class=\"block\">The name for this class.</div>"}};
// Test with -nodeprecated option. The ClassDocs should have properly nested
// definition list tags enclosing comments and tags. The ClassDocs should not
// display definition list for deprecated information. The serialized form
// should display properly nested definition list tags for comments, tags
// and deprecated information.
private static final String[][] TEST_NODEPR = {
{BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>" +
"<dt><span class=\"strong\">Since:</span></dt>" + NL +
" <dd>JDK1.0</dd></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Since:</span>" +
"</dt>" + NL + " <dd>JDK1.0</dd>" + NL + "<dt><span class=\"strong\">See Also:" +
"</span></dt><dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\">" +
"<code>C2</code></a>, " + NL + "<a href=\"../serialized-form.html#pkg1.C1\">" +
"Serialized Form</a></dd></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Parameters:" +
"</span></dt><dd><code>title</code> - the title</dd><dd><code>" +
"test</code> - boolean value</dd>" + NL + "<dt><span class=\"strong\">Throws:" +
"</span></dt>" + NL + "<dd><code>java.lang.IllegalArgumentException" +
"</code> - if the <code>owner</code>'s" + NL + " <code>GraphicsConfiguration" +
"</code> is not from a screen device</dd>" + NL + "<dd><code>" +
"HeadlessException</code></dd></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Parameters:" +
"</span></dt><dd><code>undecorated</code> - <code>true</code>" +
" if no decorations are" + NL + " to be enabled;" + NL +
" <code>false</code> if decorations are to be enabled." +
"</dd><dt><span class=\"strong\">Since:</span></dt>" + NL + " <dd>1.4</dd>" + NL +
"<dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../pkg1/C1.html#readObject()\">" +
"<code>readObject()</code></a></dd></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Throws:</span>" +
"</dt>" + NL + "<dd><code>java.io.IOException</code></dd><dt>" +
"<span class=\"strong\">See Also:</span></dt><dd><a href=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
"<code>setUndecorated(boolean)</code></a></dd></dl>"},
{BUG_ID + FS + "serialized-form.html", "<dl><dt><span class=\"strong\">Throws:</span>" +
"</dt>" + NL + "<dd><code>" +
"java.io.IOException</code></dd><dt><span class=\"strong\">See Also:</span>" +
"</dt><dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
"<code>C1.setUndecorated(boolean)</code></a></dd></dl>"},
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
" <i>As of JDK version 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
"<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
"<div class=\"block\">This field indicates whether the C1 is " +
"undecorated.</div>" + NL + " " + NL + "<dl><dt><span class=\"strong\">Since:</span></dt>" + NL +
" <dd>1.4</dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
"</dt><dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
"<code>C1.setUndecorated(boolean)</code></a></dd></dl>"},
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
" <i>As of JDK version 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
"<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
"<div class=\"block\">Reads the object stream.</div>" + NL +
"<dl><dt><span class=\"strong\">Throws:" +
"</span></dt>" + NL + "<dd><code><code>" +
"IOException</code></code></dd>" + NL +
"<dd><code>java.io.IOException</code></dd></dl>"},
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
" </div>" + NL + "<div class=\"block\">" +
"The name for this class.</div>"}};
// Test with -nocomment and -nodeprecated options. The ClassDocs whould
// not display definition lists for any member details.
private static final String[][] TEST_NOCMNT_NODEPR = {
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<pre>public void readObject()" + NL +
" throws java.io.IOException</pre>" + NL + "</li>"},
{BUG_ID + FS + "pkg1" + FS + "C2.html", "<pre>public C2()</pre>" + NL +
"</li>"},
{BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<pre>public " +
"static final <a href=\"../pkg1/C1.ModalExclusionType.html\" " +
"title=\"enum in pkg1\">C1.ModalExclusionType</a> " +
"APPLICATION_EXCLUDE</pre>" + NL + "</li>"},
{BUG_ID + FS + "serialized-form.html", "<pre>boolean " +
"undecorated</pre>" + NL + "<div class=\"block\"><span class=\"strong\">" +
"Deprecated.</span> <i>As of JDK version 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated(boolean)\"><code>" +
"setUndecorated(boolean)</code></a>.</i></div>" + NL + "</li>"},
{BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">" +
"Deprecated.</span> <i>As of JDK version" +
" 1.5, replaced by" + NL +
" <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
"<code>setUndecorated(boolean)</code></a>.</i></div>" + NL + "</li>"}};
// Test for valid HTML generation which should not comprise of empty
// definition list tags.
private static final String[][] NEGATED_TEST = {
{BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl></dl>"},
{BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>" + NL + "</dl>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "</dl>"},
{BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<dl></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<dl>" + NL + "</dl>"},
{BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl>" + NL + "</dl>"},
{BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "<dl></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "<dl>" + NL + "</dl>"},
{BUG_ID + FS + "pkg1" + FS + "C3.html", "<dl></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C3.html", "<dl>" + NL + "</dl>"},
{BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl>" + NL + "</dl>"},
{BUG_ID + FS + "pkg1" + FS + "C5.html", "<dl></dl>"},
{BUG_ID + FS + "pkg1" + FS + "C5.html", "<dl>" + NL + "</dl>"},
{BUG_ID + FS + "overview-tree.html", "<dl></dl>"},
{BUG_ID + FS + "overview-tree.html", "<dl>" + NL + "</dl>"},
{BUG_ID + FS + "serialized-form.html", "<dl></dl>"},
{BUG_ID + FS + "serialized-form.html", "<dl>" + NL + "</dl>"}};
private static final String[] ARGS1 =
new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"};
private static final String[] ARGS2 =
new String[] {
"-d", BUG_ID, "-nocomment", "-sourcepath", SRC_DIR, "pkg1"};
private static final String[] ARGS3 =
new String[] {
"-d", BUG_ID, "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"};
private static final String[] ARGS4 =
new String[] {
"-d", BUG_ID, "-nocomment", "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestHtmlDefinitionListTag tester = new TestHtmlDefinitionListTag();
tester.exactNewlineMatch = false;
run(tester, ARGS1, TEST_ALL, NEGATED_TEST);
run(tester, ARGS1, TEST_CMNT_DEPR, NEGATED_TEST);
run(tester, ARGS2, TEST_ALL, NEGATED_TEST);
run(tester, ARGS2, NO_TEST, TEST_CMNT_DEPR);
run(tester, ARGS3, TEST_ALL, NEGATED_TEST);
run(tester, ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR);
run(tester, ARGS4, TEST_ALL, NEGATED_TEST);
run(tester, ARGS4, TEST_NOCMNT_NODEPR, TEST_CMNT_DEPR);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 16,631 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
package-info.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/pkg1/package-info.java | /*
* Copyright (c) 2009, 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 package 1.
*
* @since JDK1.0
*/
package pkg1;
| 1,113 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/pkg1/C2.java | /*
* Copyright (c) 2009, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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 pkg1;
import java.io.ObjectInputStream;
import java.io.IOException;
import java.io.Serializable;
/**
* A class comment for testing.
*
* @author Bhavesh Patel
* @see C1
* @since JDK1.0
*/
public class C2 implements Serializable {
/**
* This field indicates title.
*/
String title;
public static enum ModalType {
NO_EXCLUDE
};
/**
* Constructor.
*
*/
public C2() {
}
public C2(String title) {
}
/**
* Set visible.
*
* @param set boolean
* @since 1.4
* @deprecated As of JDK version 1.5, replaced by
* {@link C1#setUndecorated(boolean) setUndecorated(boolean)}.
*/
@Deprecated
public void setVisible(boolean set) {
}
/**
* Reads the object stream.
*
* @param s ObjectInputStream
* @throws <code>IOException</code>
* @deprecated As of JDK version 1.5, replaced by
* {@link C1#setUndecorated(boolean) setUndecorated(boolean)}.
*/
@Deprecated
public void readObject(ObjectInputStream s) throws IOException {
}
}
| 2,333 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C5.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/pkg1/C5.java | /*
* Copyright (c) 2009, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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 pkg1;
import java.io.Serializable;
/**
* Test for Serializable
*
* @author Bhavesh Patel
* @deprecated This class is no longer used.
*/
@Deprecated
public abstract class C5 implements Serializable {
/**
* The name for this class.
*
* @serial
*/
private String name;
/**
* @serial
*/
private int publicKey;
/**
* Constructor for serialization only.
*/
protected C5() {
}
/**
* Prints general information.
*
*/
public void printInfo() {
}
}
| 1,763 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C3.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/pkg1/C3.java | /*
* Copyright (c) 2009, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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 pkg1;
import java.lang.annotation.*;
/**
* Test Annotation class.
*
* @author Bhavesh Patel
* @since 1.5
*/
@Retention(RetentionPolicy.SOURCE)
public @interface C3 {
/**
* Comment.
*/
String[] value();
}
| 1,445 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C4.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/pkg1/C4.java | /*
* Copyright (c) 2009, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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 pkg1;
import java.lang.annotation.*;
/*
* The @Inherited annotation has no effect when applied to an interface.
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Inherited
public @interface C4 {
boolean value() default true;
}
| 1,479 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/pkg1/C1.java | /*
* Copyright (c) 2009, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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 pkg1;
import java.io.IOException;
import java.io.Serializable;
/**
* A class comment for testing.
*
* @author Bhavesh Patel
* @see C2
* @since JDK1.0
*/
public class C1 implements Serializable {
/**
* This field indicates whether the C1 is undecorated.
*
* @see #setUndecorated(boolean)
* @since 1.4
* @serial
* @deprecated As of JDK version 1.5, replaced by
* {@link C1#setUndecorated(boolean) setUndecorated(boolean)}.
*/
@Deprecated
public boolean undecorated = false;
private String title;
/**
* This enum specifies the possible modal exclusion types.
*
* @since 1.6
*/
public static enum ModalExclusionType {
/**
* No modal exclusion.
*/
NO_EXCLUDE,
/**
* <code>APPLICATION_EXCLUDE</code> indicates that a top-level window
* won't be blocked by any application-modal dialogs. Also, it isn't
* blocked by document-modal dialogs from outside of its child hierarchy.
*/
APPLICATION_EXCLUDE
};
/**
* Constructor.
*
* @param title the title
* @param test boolean value
* @exception IllegalArgumentException if the <code>owner</code>'s
* <code>GraphicsConfiguration</code> is not from a screen device
* @exception HeadlessException
*/
public C1(String title, boolean test) {
}
public C1(String title) {
}
/**
* Method comments.
* @param undecorated <code>true</code> if no decorations are
* to be enabled;
* <code>false</code> if decorations are to be enabled.
* @see #readObject()
* @since 1.4
*/
public void setUndecorated(boolean undecorated) {
/* Make sure we don't run in the middle of peer creation.*/
}
/**
* @see #setUndecorated(boolean)
*/
public void readObject() throws IOException {
}
}
| 3,184 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestDupThrowsTags.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java | /*
* Copyright (c) 2002, 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 4525364
* @summary Determine if duplicate throws tags can be used.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestDupThrowsTags
* @run main TestDupThrowsTags
*/
public class TestDupThrowsTags extends JavadocTester {
private static final String BUG_ID = "4525364";
private static final String[] ARGS = new String[] {
"-d", BUG_ID, SRC_DIR + FS + "TestDupThrowsTags.java"
};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
String[][] tests = new String[4][2];
for (int i = 0; i < tests.length; i++) {
tests[i][0] = BUG_ID + FS + "TestDupThrowsTags.html";
tests[i][1] = "Test "+(i+1)+" passes";
}
TestDupThrowsTags tester = new TestDupThrowsTags();
run(tester, ARGS, tests, NO_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
/**
* @throws java.io.IOException Test 1 passes
* @throws java.io.IOException Test 2 passes
* @throws java.lang.NullPointerException Test 3 passes
* @throws java.io.IOException Test 4 passes
*/
public void method(){}
}
| 2,479 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestTopOption.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testTopOption/TestTopOption.java | /*
* Copyright (c) 2005, 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 6227616
* @summary Test the new -top option.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestTopOption
* @run main TestTopOption
*/
public class TestTopOption extends JavadocTester {
//Test information.
private static final String BUG_ID = "6227616";
//Javadoc arguments.
private static final String[] ARGS = new String[] {
"-overview", "SRC_DIR + FS + overview.html", "-use", "-top", "TOP TEXT", "-d", BUG_ID, "-sourcepath",
SRC_DIR, "pkg"
};
//Input for string search tests.
private static final String[][] TEST = {
{BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
"TOP TEXT"},
{BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
"TOP TEXT"},
{BUG_ID + FS + "pkg" + FS + "Cl.html",
"TOP TEXT"},
{BUG_ID + FS + "pkg" + FS + "class-use" + FS + "Cl.html",
"TOP TEXT"},
{BUG_ID + FS + "pkg" + FS + "package-summary.html",
"TOP TEXT"},
{BUG_ID + FS + "pkg" + FS + "package-use.html",
"TOP TEXT"},
{BUG_ID + FS + "overview-summary.html",
"TOP TEXT"},
{BUG_ID + FS + "overview-tree.html",
"TOP TEXT"},
{BUG_ID + FS + "constant-values.html",
"TOP TEXT"},
{BUG_ID + FS + "help-doc.html",
"TOP TEXT"},
};
private static final String[][] NEGATED_TEST = NO_TEST;
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestTopOption tester = new TestTopOption();
run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 3,053 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
AnnotationType.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testTopOption/pkg/AnnotationType.java | /*
* Copyright (c) 2005, 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 pkg;
import java.lang.annotation.*;
@Documented public @interface AnnotationType {
}
| 1,147 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Cl.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testTopOption/pkg/Cl.java | /*
* Copyright (c) 2005, 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 pkg;
public class Cl {
}
| 1,087 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestCRLineSeparator.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java | /*
* Copyright (c) 2004, 2009, 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 4979486
* @summary Make sure tool parses CR line separators properly.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestCRLineSeparator
* @run main TestCRLineSeparator
*/
import java.io.*;
import java.util.*;
public class TestCRLineSeparator extends JavadocTester {
//Test information.
private static final String BUG_ID = "4979486";
//Javadoc arguments.
private static final String[] ARGS = new String[] {
"-d", BUG_ID, "-sourcepath", ".", "pkg"
};
//Input for string search tests.
private static final String[][] TEST = {
{BUG_ID + FS + "pkg" + FS + "MyClass.html", "Line 1\n Line 2"}
};
private static final String[][] NEGATED_TEST = NO_TEST;
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) throws Exception {
initFiles(new File(SRC_DIR), new File("."), "pkg");
TestCRLineSeparator tester = new TestCRLineSeparator();
run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
// recursively copy files from fromDir to toDir, replacing newlines
// with \r
static void initFiles(File fromDir, File toDir, String f) throws IOException {
File from_f = new File(fromDir, f);
File to_f = new File(toDir, f);
if (from_f.isDirectory()) {
to_f.mkdirs();
for (String child: from_f.list()) {
initFiles(from_f, to_f, child);
}
} else {
List<String> lines = new ArrayList<String>();
BufferedReader in = new BufferedReader(new FileReader(from_f));
try {
String line;
while ((line = in.readLine()) != null)
lines.add(line);
} finally {
in.close();
}
BufferedWriter out = new BufferedWriter(new FileWriter(to_f));
try {
for (String line: lines) {
out.write(line);
out.write("\r");
}
} finally {
out.close();
}
}
}
}
| 3,514 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
MyClass.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testCRLineSeparator/pkg/MyClass.java | /*
* Copyright (c) 2004, 2009, 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 pkg;
/**
* Line 1
* Line 2
*/
public class MyClass {}
| 1,125 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestPrivateClasses.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java | /*
* Copyright (c) 2003, 2010, 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 4780441 4874845 4978816
* @summary Make sure that when the -private flag is not used, members
* inherited from package private class are documented in the child.
*
* Make sure that when a method inherits documentation from a method
* in a non-public class/interface, the non-public class/interface
* is not mentioned anywhere (not even in the signature or tree).
*
* Make sure that when a private interface method with generic parameters
* is implemented, the comments can be inherited properly.
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build TestPrivateClasses
* @run main TestPrivateClasses
*/
public class TestPrivateClasses extends JavadocTester {
//Test information.
private static final String BUG_ID = "4780441-4874845-4978816";
//Javadoc arguments.
private static final String[] ARGS1 = new String[] {
"-d", BUG_ID + "-1", "-sourcepath", SRC_DIR, "-source", "1.5", "pkg", "pkg2"
};
private static final String[] ARGS2 = new String[] {
"-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, "-private",
"-source", "1.5", "pkg", "pkg2"
};
// Test output when -private flag is not used.
private static final String[][] TEST1 = {
// Field inheritence from non-public superclass.
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
"<a href=\"../pkg/PublicChild.html#fieldInheritedFromParent\">" +
"fieldInheritedFromParent</a>"
},
// Method inheritence from non-public superclass.
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
"<a href=\"../pkg/PublicChild.html#methodInheritedFromParent(int)\">" +
"methodInheritedFromParent</a>"
},
// Field inheritence from non-public superinterface.
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
"<a href=\"../pkg/PublicInterface.html#fieldInheritedFromInterface\">" +
"fieldInheritedFromInterface</a>"
},
// Method inheritence from non-public superinterface.
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
"<a href=\"../pkg/PublicInterface.html#methodInterface(int)\">" +
"methodInterface</a>"
},
// private class does not show up in tree
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
"<ul class=\"inheritance\">" + NL + "<li>java.lang.Object</li>" + NL +
"<li>" + NL + "<ul class=\"inheritance\">" + NL + "<li>pkg.PublicChild</li>" + NL +
"</ul>" + NL + "</li>" + NL + "</ul>"
},
// Method is documented as though it is declared in the inheriting method.
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
"<pre>public void methodInheritedFromParent(int p1)"
},
//Make sure implemented interfaces from private superclass are inherited
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
"<dl>" + NL + "<dt>All Known Implementing Classes:</dt>" + NL +
"<dd><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">" +
"PublicChild</a></dd>" + NL + "</dl>"},
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
"<dl>" + NL + "<dt>All Implemented Interfaces:</dt>" + NL +
"<dd><a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" +
"PublicInterface</a></dd>" + NL + "</dl>"},
//Generic interface method test.
{BUG_ID + "-1" + FS + "pkg2" + FS + "C.html",
"This comment should get copied to the implementing class"},
};
private static final String[][] NEGATED_TEST1 = {
// Should not document that a method overrides method from private class.
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
"<strong>Overrides:</strong>"},
// Should not document that a method specified by private interface.
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
"<strong>Specified by:</strong>"},
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
"<strong>Specified by:</strong>"},
// Should not mention that any documentation was copied.
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
"Description copied from"},
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
"Description copied from"},
// Don't extend private classes or interfaces
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
"PrivateParent"},
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
"PrivateInterface"},
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
"PrivateInterface"},
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
"All Superinterfaces"},
// Make inherited constant are documented correctly.
{BUG_ID + "-1" + FS + "constant-values.html",
"PrivateInterface"},
//Do not inherit private interface method with generic parameters.
//This method has been implemented.
{BUG_ID + "-1" + FS + "pkg2" + FS + "C.html",
"<strong><a href=\"../pkg2/I.html#hello(T)\">hello</a></strong>"},
};
// Test output when -private flag is used.
private static final String[][] TEST2 = {
// Field inheritence from non-public superclass.
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
"Fields inherited from class pkg." +
"<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
"PrivateParent</a>"
},
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
"<a href=\"../pkg/PrivateParent.html#fieldInheritedFromParent\">" +
"fieldInheritedFromParent</a>"
},
// Field inheritence from non-public superinterface.
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
"Fields inherited from interface pkg." +
"<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
"PrivateInterface</a>"
},
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
"<a href=\"../pkg/PrivateInterface.html#fieldInheritedFromInterface\">" +
"fieldInheritedFromInterface</a>"
},
// Method inheritence from non-public superclass.
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
"Methods inherited from class pkg." +
"<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
"PrivateParent</a>"
},
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
"<a href=\"../pkg/PrivateParent.html#methodInheritedFromParent(int)\">" +
"methodInheritedFromParent</a>"
},
// Should document that a method overrides method from private class.
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
"<dt><strong>Overrides:</strong></dt>" + NL +
"<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent(char[], int, T, V, java.util.List)\">" +
"methodOverridenFromParent</a></code> in class <code>" +
"<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
"PrivateParent</a></code></dd>"},
// Should document that a method is specified by private interface.
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
"<dt><strong>Specified by:</strong></dt>" + NL +
"<dd><code><a href=\"../pkg/PrivateInterface.html#methodInterface(int)\">" +
"methodInterface</a></code> in interface <code>" +
"<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
"PrivateInterface</a></code></dd>"},
// Method inheritence from non-public superinterface.
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
"Methods inherited from interface pkg." +
"<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
"PrivateInterface</a>"
},
{BUG_ID + "-2" + FS + "pkg" + FS + "PrivateInterface.html",
"<a href=\"../pkg/PrivateInterface.html#methodInterface(int)\">" +
"methodInterface</a>"
},
// Should mention that any documentation was copied.
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
"Description copied from"},
// Extend documented private classes or interfaces
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
"extends"},
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
"extends"},
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
"All Superinterfaces"},
//Make sure implemented interfaces from private superclass are inherited
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
"<dl>" + NL + "<dt>All Known Implementing Classes:</dt>" + NL +
"<dd><a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
"PrivateParent</a>, " +
"<a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild" +
"</a></dd>" + NL + "</dl>"},
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
"<dl>" + NL + "<dt>All Implemented Interfaces:</dt>" + NL +
"<dd><a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
"PrivateInterface</a>, " +
"<a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" +
"PublicInterface</a></dd>" + NL + "</dl>"},
//Since private flag is used, we can document that private interface method
//with generic parameters has been implemented.
{BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
"<strong>Description copied from interface: <code>" +
"<a href=\"../pkg2/I.html#hello(T)\">I</a></code></strong>"},
{BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
"<dt><strong>Specified by:</strong></dt>" + NL +
"<dd><code><a href=\"../pkg2/I.html#hello(T)\">hello</a></code>" +
" in interface <code>" +
"<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>" +
"<java.lang.String></code></dd>"},
};
private static final String[][] NEGATED_TEST2 = NO_TEST;
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestPrivateClasses tester = new TestPrivateClasses();
run(tester, ARGS1, TEST1, NEGATED_TEST1);
run(tester, ARGS2, TEST2, NEGATED_TEST2);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 12,247 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
PrivateParent.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testPrivateClasses/pkg/PrivateParent.java | /*
* Copyright (c) 2003, 2004, 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 pkg;
import java.util.*;
class PrivateParent implements PublicInterface {
/**
* Comment from parent.
*/
public int fieldInheritedFromParent;
/**
* Comment from parent.
*
* @param p1 param from parent.
* @throws Exception exception from parent.
*/
public void methodInheritedFromParent(int p1) throws Exception {
}
/**
* Comment from parent.
*
* @param p1 param from parent.
* @param p2 param from parent.
* @throws Exception exception from parent.
*/
public <T extends List, V> PrivateParent methodOverridenFromParent(
char[] p1, int p2, T p3, V p4, List<String> p5)
throws Exception {
return this;
}
}
| 1,795 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
PublicChild.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testPrivateClasses/pkg/PublicChild.java | /*
* Copyright (c) 2003, 2004, 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 pkg;
import java.util.*;
public class PublicChild extends PrivateParent
implements PrivateInterface {
public <T extends List, V> PublicChild methodOverridenFromParent(
char[] p1, int p2, T p3, V p4, List<String> p5)
throws Exception {
return this;
}
/**
* {@inheritDoc}
*
* @param p1 {@inheritDoc}
* @throws Exception {@inheritDoc}
*/
public void methodInterface(int p1) throws Exception {
}
public void methodInterface2(int p1) throws Exception {
}
}
| 1,604 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
PublicInterface.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testPrivateClasses/pkg/PublicInterface.java | /*
* Copyright (c) 2003, 2004, 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 pkg;
public interface PublicInterface extends PrivateInterface {
}
| 1,136 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
PrivateInterface.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testPrivateClasses/pkg/PrivateInterface.java | /*
* Copyright (c) 2003, 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 pkg;
interface PrivateInterface {
/**
* Comment from parent.
*/
public static final int fieldInheritedFromInterface = 0;
/**
* Comment from interface.
* This is a link to myself: {@link #fieldInheritedFromInterface}
*
* @param p1 param from interface.
* @throws Exception exception from interface.
*
* @see #fieldInheritedFromInterface
*/
public void methodInterface(int p1) throws Exception;
/**
* Comment from interface.
*
* @param p1 param from interface.
* @throws Exception exception from interface.
*/
public void methodInterface2(int p1) throws Exception;
}
| 1,728 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
C.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testPrivateClasses/pkg2/C.java | /*
* Copyright (c) 2004, 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;
public class C implements I<String> {
public void hello(String param) { }
}
| 1,151 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
I.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testPrivateClasses/pkg2/I.java | /*
* Copyright (c) 2004, 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;
interface I<T> {
/**
* This comment should get copied to the implementing class
*/
void hello(T param);
}
| 1,207 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestNestedInlineTag.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java | /*
* Copyright (c) 2001, 2002, 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.
*/
/**
* This should be green, underlined and bold (Class): {@underline {@bold {@green My test}}} .
* @test
* @bug 0000000
* @summary Test for nested inline tags. *
* @author jamieh
* @library ../lib/
* @build JavadocTester
* @build testtaglets.UnderlineTaglet
* @build testtaglets.BoldTaglet
* @build testtaglets.GreenTaglet
* @build TestNestedInlineTag
* @run main TestNestedInlineTag
*/
public class TestNestedInlineTag extends JavadocTester {
/**
* This should be green, underlined and bold (Field): {@underline {@bold {@green My test}}} .
*/
public int field;
/**
* This should be green, underlined and bold (Constructor): {@underline {@bold {@green My test}}} .
*/
public TestNestedInlineTag(){}
/**
* This should be green, underlined and bold (Method): {@underline {@bold {@green My test}}} .
*/
public void method(){}
private static final String BUG_ID = "no-bug-id";
private static final String[][] TEST = {
//Test nested inline tag in class description.
{BUG_ID + FS + "TestNestedInlineTag.html",
"This should be green, underlined and bold (Class): <u><b><font color=\"green\">My test</font></b></u>"
},
//Test nested inline tag in field description.
{BUG_ID + FS + "TestNestedInlineTag.html",
"This should be green, underlined and bold (Field): <u><b><font color=\"green\">My test</font></b></u>"
},
//Test nested inline tag in constructor description.
{BUG_ID + FS + "TestNestedInlineTag.html",
"This should be green, underlined and bold (Constructor): <u><b><font color=\"green\">My test</font></b></u>"
},
//Test nested inline tag in method description.
{BUG_ID + FS + "TestNestedInlineTag.html",
"This should be green, underlined and bold (Method): <u><b><font color=\"green\">My test</font></b></u>"
}
};
private static final String[][] NEGATED_TEST = NO_TEST;
private static final String[] ARGS =
new String[] {
"-d", BUG_ID, "-sourcepath", SRC_DIR,
"-taglet", "testtaglets.UnderlineTaglet",
"-taglet", "testtaglets.BoldTaglet",
"-taglet", "testtaglets.GreenTaglet",
SRC_DIR + FS + "TestNestedInlineTag.java"
};
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestNestedInlineTag tester = new TestNestedInlineTag();
run(tester, ARGS, TEST, NEGATED_TEST);
tester.printSummary();
}
/**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}
| 3,904 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
UnderlineTaglet.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/UnderlineTaglet.java | /*
* Copyright (c) 2001, 2007, 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 testtaglets;
import com.sun.tools.doclets.internal.toolkit.*;
import com.sun.tools.doclets.internal.toolkit.taglets.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
import com.sun.javadoc.*;
import java.util.*;
/**
* An inline Taglet representing {@underline}
*
* @author Jamie Ho
* @since 1.4
*/
public class UnderlineTaglet extends BaseInlineTaglet {
public UnderlineTaglet() {
name = "underline";
}
public static void register(Map tagletMap) {
UnderlineTaglet tag = new UnderlineTaglet();
Taglet t = (Taglet) tagletMap.get(tag.getName());
if (t != null) {
tagletMap.remove(tag.getName());
}
tagletMap.put(tag.getName(), tag);
}
/**
* {@inheritDoc}
*/
public TagletOutput getTagletOutput(Tag tag, TagletWriter writer) {
ArrayList inlineTags = new ArrayList();
inlineTags.add(new TextTag(tag.holder(), "<u>"));
inlineTags.addAll(Arrays.asList(tag.inlineTags()));
inlineTags.add(new TextTag(tag.holder(), "</u>"));
return writer.commentTagsToOutput(tag, (Tag[]) inlineTags.toArray(new Tag[] {}));
}
}
| 2,222 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
GreenTaglet.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/GreenTaglet.java | /*
* Copyright (c) 2001, 2007, 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 testtaglets;
import com.sun.tools.doclets.internal.toolkit.*;
import com.sun.tools.doclets.internal.toolkit.taglets.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
import com.sun.javadoc.*;
import java.util.*;
/**
* An inline Taglet representing {@green}
*
* @author Jamie Ho
* @since 1.4
*/
public class GreenTaglet extends BaseInlineTaglet {
public GreenTaglet() {
name = "green";
}
public static void register(Map tagletMap) {
GreenTaglet tag = new GreenTaglet();
Taglet t = (Taglet) tagletMap.get(tag.getName());
if (t != null) {
tagletMap.remove(tag.getName());
}
tagletMap.put(tag.getName(), tag);
}
/**
* {@inheritDoc}
*/
public TagletOutput getTagletOutput(Tag tag, TagletWriter writer) {
ArrayList inlineTags = new ArrayList();
inlineTags.add(new TextTag(tag.holder(), "<font color=\"green\">"));
inlineTags.addAll(Arrays.asList(tag.inlineTags()));
inlineTags.add(new TextTag(tag.holder(), "</font>"));
return writer.commentTagsToOutput(tag, (Tag[]) inlineTags.toArray(new Tag[] {}));
}
}
| 2,219 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.