Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/java/text/Collator/TurkishTest.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* @library /java/text/testlib26* @summary test Turkish Collation27*/28/*29(C) Copyright Taligent, Inc. 1996 - All Rights Reserved30(C) Copyright IBM Corp. 1996 - All Rights Reserved3132The original version of this source code and documentation is copyrighted and33owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These materials are34provided under terms of a License Agreement between Taligent and Sun. This35technology is protected by multiple US and International patents. This notice and36attribution to Taligent may not be removed.37Taligent is a registered trademark of Taligent, Inc.38*/3940import java.util.Locale;41import java.text.Collator;4243// Quick dummy program for printing out test results44public class TurkishTest extends CollatorTest {4546public static void main(String[] args) throws Exception {47new TurkishTest().run(args);48}4950/*51* Data for TestPrimary()52*/53private static final String[] primarySourceData = {54"\u00FCoid",55"vo\u0131d",56"idea",57"Idea",58"\u0130dea"59};6061private static final String[] primaryTargetData = {62"void",63"void",64"Idea",65"\u0130dea",66"\u0131dea"67};6869private static final int[] primaryResults = {70-1, -1, 1, -1, 171};7273/*74* Data for TestTertiary()75*/76private static final String[] tertiarySourceData = {77"s\u0327",78"v\u00E4t",79"old",80"\u00FCoid",81"h\u011Ealt",82"stres\u015E",83"vo\u0131d",84"idea",85"idea",86"\u0131dea"87};8889private static final String tertiaryTargetData[] = {90"u\u0308",91"vbt",92"\u00D6ay",93"void",94"halt",95"\u015Etre\u015Es",96"void",97"Idea",98"\u0130dea",99"Idea"100};101102private static final int[] tertiaryResults = {103-1, -1, -1, -1, 1, -1, -1, 1, -1, -1104};105106public void TestPrimary() {107doTest(myCollation, Collator.PRIMARY,108primarySourceData, primaryTargetData, primaryResults);109}110111public void TestTertiary() {112doTest(myCollation, Collator.TERTIARY,113tertiarySourceData, tertiaryTargetData, tertiaryResults);114}115116private final Collator myCollation = Collator.getInstance(new Locale("tr", "TR", ""));117}118119120