Path: blob/master/test/langtools/jdk/javadoc/doclet/constantValues/TestConstantValuesDriver.java
40971 views
/*1* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/*24* @test25* @bug 4504730 4526070 5077317 816236326* @summary Test the generation of constant-values.html.27* @library ../../lib28* @modules jdk.javadoc/jdk.javadoc.internal.tool29* @build javadoc.tester.*30* @run main TestConstantValuesDriver31*/32import javadoc.tester.JavadocTester;3334public class TestConstantValuesDriver extends JavadocTester {3536public static void main(String... args) throws Exception {37TestConstantValuesDriver tester = new TestConstantValuesDriver();38tester.runTests();39}4041@Test42public void test() {43javadoc("-d", "out",44testSrc("TestConstantValues.java"),45testSrc("TestConstantValues2.java"),46testSrc("A.java"));47checkExit(Exit.OK);4849checkOutput("constant-values.html", true,50"TEST1PASSES",51"TEST2PASSES",52"TEST3PASSES",53"TEST4PASSES",54"""55<code>"<Hello World>"</code>""",56"""57<code id="TestConstantValues.BYTE_MAX_VALUE">public static final byte</code></div>58<div class="col-second even-row-color"><code><a href="TestConstantValues.html#BYTE_MAX_VALUE">BYTE_MAX_VALUE</a></code></div>59<div class="col-last even-row-color"><code>0x7f</code></div>""",60"""61<code id="TestConstantValues.BYTE_MIN_VALUE">public static final byte</code></div>62<div class="col-second odd-row-color"><code><a href="TestConstantValues.html#BYTE_MIN_VALUE">BYTE_MIN_VALUE</a></code></div>63<div class="col-last odd-row-color"><code>0x81</code></div>""",64"""65<code id="TestConstantValues.CHAR_MAX_VALUE">public static final char</code></div>66<div class="col-second even-row-color"><code><a href="TestConstantValues.html#CHAR_MAX_VALUE">CHAR_MAX_VALUE</a></code></div>67<div class="col-last even-row-color"><code>'\\uffff'</code></div>""",68"""69<code id="TestConstantValues.DOUBLE_MAX_VALUE">public static final double</code></div>""",70"""71<div class="col-second odd-row-color"><code><a href="TestConstantValues.html#DOUBLE_MAX_VALUE">\72DOUBLE_MAX_VALUE</a></code></div>73<div class="col-last odd-row-color"><code>1.7976931348623157E308</code></div>""",74"""75<code id="TestConstantValues.DOUBLE_MIN_VALUE">public static final double</code></div>76<div class="col-second even-row-color"><code><a href="TestConstantValues.html#DOUBLE_MIN_VALUE">\77DOUBLE_MIN_VALUE</a></code></div>""",78"""79<code id="TestConstantValues.GOODBYE">public static final boolean</code></div>80<div class="col-second odd-row-color"><code><a href="TestConstantValues.html#GOODBYE">GOODBYE</a></code></div>""",81"""82<code id="TestConstantValues.HELLO">public static final boolean</code></div>83<div class="col-second even-row-color"><code><a href="TestConstantValues.html#HELLO">HELLO</a></code></div>84<div class="col-last even-row-color"><code>true</code></div>"""85);86}87}888990