Path: blob/master/test/jdk/java/text/Collator/TurkishTest.java
41149 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* @modules jdk.localedata28*/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 TurkishTest extends CollatorTest {4647public static void main(String[] args) throws Exception {48new TurkishTest().run(args);49}5051/*52* Data for TestPrimary()53*/54private static final String[] primarySourceData = {55"\u00FCoid",56"vo\u0131d",57"idea",58"Idea",59"\u0130dea"60};6162private static final String[] primaryTargetData = {63"void",64"void",65"Idea",66"\u0130dea",67"\u0131dea"68};6970private static final int[] primaryResults = {71-1, -1, 1, -1, 172};7374/*75* Data for TestTertiary()76*/77private static final String[] tertiarySourceData = {78"s\u0327",79"v\u00E4t",80"old",81"\u00FCoid",82"h\u011Ealt",83"stres\u015E",84"vo\u0131d",85"idea",86"idea",87"\u0131dea"88};8990private static final String tertiaryTargetData[] = {91"u\u0308",92"vbt",93"\u00D6ay",94"void",95"halt",96"\u015Etre\u015Es",97"void",98"Idea",99"\u0130dea",100"Idea"101};102103private static final int[] tertiaryResults = {104-1, -1, -1, -1, 1, -1, -1, 1, -1, -1105};106107public void TestPrimary() {108doTest(myCollation, Collator.PRIMARY,109primarySourceData, primaryTargetData, primaryResults);110}111112public void TestTertiary() {113doTest(myCollation, Collator.TERTIARY,114tertiarySourceData, tertiaryTargetData, tertiaryResults);115}116117private final Collator myCollation = Collator.getInstance(new Locale("tr", "TR", ""));118}119120121