Path: blob/master/test/langtools/jdk/javadoc/doclet/testBreakIterator/TestBreakIterator.java
40971 views
/*1* Copyright (c) 2002, 2019, 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 416598526* @summary Determine the end of the first sentence using BreakIterator.27* If the first sentence of "method" is parsed correctly, the test passes.28* Correct Answer: "This is a class (i.e. it is indeed a class)."29* Wrong Answer: "This is a class (i.e."30* @library ../../lib31* @modules jdk.javadoc/jdk.javadoc.internal.tool32* @build javadoc.tester.*33* @run main TestBreakIterator34*/3536import javadoc.tester.JavadocTester;3738public class TestBreakIterator extends JavadocTester {3940public static void main(String... args) throws Exception {41TestBreakIterator tester = new TestBreakIterator();42tester.runTests();43}4445@Test46public void test() {47javadoc("-d", "out",48"-sourcepath", testSrc,49"-breakiterator",50"pkg");51checkExit(Exit.OK);5253checkOutput("pkg/BreakIteratorTest.html", true,54"""55<div class="block">This is a class (i.e. it is indeed a class).</div>""");5657checkOutput("pkg/BreakIteratorTest.html", true,58"""59<div class="block">tests the breakiterator (i.e. how the firstSentence is broken up).</div>""");6061checkOutput("pkg/BreakIteratorTest.html", true,62"""63<div class="block">with an inline tag <code>jdk.javadoc.taglet.Taglet</code> does it work.</div>""");6465checkOutput("pkg/BreakIteratorTest.html", true,66"""67<div class="block">with a block tag</div>""");6869checkOutput("pkg/BreakIteratorTest.html", true,70"""71<div class="block">with an anchor for the72<a href="../index-all.html">top level index</a>.</div>""");7374checkOutput("pkg/BreakIteratorTest.html", true,75"""76<div class="block">A constant indicating that the keyLocation is indeterminate77or not relevant.</div>""");78}79}808182