Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/java/text/Collator/DanishTest.java
47182 views
/*1* Copyright (c) 1997, 2016, 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 4930708 4174436 500849826* @library /java/text/testlib27* @summary test Danish Collation28*/29/*30(C) Copyright Taligent, Inc. 1996 - All Rights Reserved31(C) Copyright IBM Corp. 1996 - All Rights Reserved3233The original version of this source code and documentation is copyrighted and34owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These materials are35provided under terms of a License Agreement between Taligent and Sun. This36technology is protected by multiple US and International patents. This notice and37attribution to Taligent may not be removed.38Taligent is a registered trademark of Taligent, Inc.39*/4041import java.util.Locale;42import java.text.Collator;4344// Quick dummy program for printing out test results45public class DanishTest extends CollatorTest {4647public static void main(String[] args) throws Exception {48new DanishTest().run(args);49}5051/*52* Data for TestPrimary()53*/54private static final String[] primarySourceData = {55"Lvi",56"L\u00E4vi",57"L\u00FCbeck",58"ANDR\u00C9",59"ANDRE",60"ANNONCERER"61};6263private static final String[] primaryTargetData = {64"Lwi",65"L\u00F6wi",66"Lybeck",67"ANDR\u00E9",68"ANDR\u00C9",69"ANN\u00D3NCERER"70};7172private static final int[] primaryResults = {73-1, -1, 0, 0, 0, 074};7576/*77* Data for TestTertiary()78*/79private static final String[] tertiarySourceData = {80"Luc",81"luck",82"L\u00FCbeck",83"L\u00E4vi",84"L\u00F6ww"85};8687private static final String[] tertiaryTargetData = {88"luck",89"L\u00FCbeck",90"lybeck",91"L\u00F6we",92"mast"93};9495private static final int[] tertiaryResults = {96-1, -1, 1, -1, -197};9899/*100* Data for TestExtra()101*/102private static final String[] testData = {103"A/S",104"ANDRE",105"ANDR\u00C9", // E-acute106"ANDR\u00C8", // E-grave107"ANDR\u00E9", // e-acute108"ANDR\u00EA", // e-circ109"Andre",110"Andr\u00E9", // e-acute111"\u00C1NDRE", // A-acute112"\u00C0NDRE", // A-grave113"andre",114"\u00E1ndre", // a-acute115"\u00E0ndre", // a-grave116"ANDREAS",117"ANNONCERER",118"ANN\u00D3NCERER", // O-acute119"annoncerer",120"ann\u00F3ncerer", // o-acute121"AS",122"A\u00e6RO", // ae-ligature123"CA",124"\u00C7A", // C-cedilla125"CB",126"\u00C7C", // C-cedilla127"D.S.B.",128"DA",129"DB",130"\u00D0ORA", // capital eth131"DSB",132"\u00D0SB", // capital eth133"DSC",134"EKSTRA_ARBEJDE",135"EKSTRABUD",136"H\u00D8ST", // could the 0x00D8 be 0x2205?137"HAAG",138"H\u00C5NDBOG", // A-ring139"HAANDV\u00C6RKSBANKEN", // AE-ligature140"INTERNETFORBINDELSE",141"Internetforbindelse",142"\u00CDNTERNETFORBINDELSE", // I-acute143"internetforbindelse",144"\u00EDnternetforbindelse", // i-acute145"Karl",146"karl",147"NIELSEN",148"NIELS J\u00D8RGEN", // O-slash149"NIELS-J\u00D8RGEN", // O-slash150"OERVAL",151"\u0152RVAL", // OE-ligature152"\u0153RVAL", // oe-ligature153"R\u00C9E, A", // E-acute154"REE, B",155"R\u00C9E, L", // E-acute156"REE, V",157"SCHYTT, B",158"SCHYTT, H",159"SCH\u00DCTT, H", // U-diaeresis160"SCHYTT, L",161"SCH\u00DCTT, M", // U-diaeresis162"SS",163"ss",164"\u00DF", // sharp S165"SSA",166"\u00DFA", // sharp S167"STOREK\u00C6R", // AE-ligature168"STORE VILDMOSE",169"STORMLY",170"STORM PETERSEN",171"THORVALD",172"THORVARDUR",173"\u00DEORVAR\u0110UR", // capital thorn, capital d-stroke(like eth) (sami)174"THYGESEN",175"VESTERG\u00C5RD, A",176"VESTERGAARD, A",177"VESTERG\u00C5RD, B", // 50178"Westmalle",179"YALLE",180"Yderligere",181"\u00DDderligere", // Y-acute182"\u00DCderligere", // U-diaeresis183"\u00FDderligere", // y-acute184"\u00FCderligere", // u-diaeresis185"U\u0308ruk-hai",186"ZORO",187"\u00C6BLE", // AE-ligature188"\u00E6BLE", // ae-ligature189"\u00C4BLE", // A-diaeresis190"\u00E4BLE", // a-diaeresis191"\u00D8BERG", // O-stroke192"\u00F8BERG", // o-stroke193"\u00D6BERG", // O-diaeresis194"\u00F6BERG" // o-diaeresis195};196197public void TestPrimary() {198doTest(myCollation, Collator.PRIMARY,199primarySourceData, primaryTargetData, primaryResults);200}201202public void TestTertiary() {203doTest(myCollation, Collator.TERTIARY,204tertiarySourceData, tertiaryTargetData, tertiaryResults);205206for (int i = 0; i < testData.length-1; i++) {207for (int j = i+1; j < testData.length; j++) {208doTest(myCollation, testData[i], testData[j], -1);209}210}211}212213private final Collator myCollation = Collator.getInstance(new Locale("da", "", ""));214}215216217