1/*
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24/*
25 * @test
26 * @library /java/text/testlib
27 * @summary test Turkish Collation
28 * @modules jdk.localedata
29 */
30/*
31(C) Copyright Taligent, Inc. 1996 - All Rights Reserved
32(C) Copyright IBM Corp. 1996 - All Rights Reserved
33
34  The original version of this source code and documentation is copyrighted and
35owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These materials are
36provided under terms of a License Agreement between Taligent and Sun. This
37technology is protected by multiple US and International patents. This notice and
38attribution to Taligent may not be removed.
39  Taligent is a registered trademark of Taligent, Inc.
40*/
41
42import java.util.Locale;
43import java.text.Collator;
44
45// Quick dummy program for printing out test results
46public class TurkishTest extends CollatorTest {
47
48    public static void main(String[] args) throws Exception {
49        new TurkishTest().run(args);
50    }
51
52    /*
53     * Data for TestPrimary()
54     */
55    private static final String[] primarySourceData = {
56        "\u00FCoid",
57        "vo\u0131d",
58        "idea",
59        "Idea",
60        "\u0130dea"
61    };
62
63    private static final String[] primaryTargetData = {
64        "void",
65        "void",
66        "Idea",
67        "\u0130dea",
68        "\u0131dea"
69    };
70
71    private static final int[] primaryResults = {
72        -1,  -1,  1, -1, 1
73    };
74
75    /*
76     * Data for TestTertiary()
77     */
78    private static final String[] tertiarySourceData = {
79        "s\u0327",
80        "v\u00E4t",
81        "old",
82        "\u00FCoid",
83        "h\u011Ealt",
84        "stres\u015E",
85        "vo\u0131d",
86        "idea",
87       "idea",
88       "\u0131dea"
89    };
90
91    private static final String tertiaryTargetData[] = {
92        "u\u0308",
93        "vbt",
94        "\u00D6ay",
95        "void",
96        "halt",
97        "\u015Etre\u015Es",
98        "void",
99        "Idea",
100       "\u0130dea",
101       "Idea"
102    };
103
104    private static final int[] tertiaryResults = {
105        -1, -1, -1, -1,  1, -1, -1,  1, -1, -1
106    };
107
108    public void TestPrimary() {
109        doTest(myCollation, Collator.PRIMARY,
110               primarySourceData, primaryTargetData, primaryResults);
111    }
112
113    public void TestTertiary() {
114        doTest(myCollation, Collator.TERTIARY,
115               tertiarySourceData, tertiaryTargetData, tertiaryResults);
116    }
117
118    private final Collator myCollation = Collator.getInstance(new Locale("tr", "TR", ""));
119}
120