1 /*
 2  * Copyright (c) 1997, 2022, 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 Finnish 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
35 owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These materials are
36 provided under terms of a License Agreement between Taligent and Sun. This
37 technology is protected by multiple US and International patents. This notice and
38 attribution to Taligent may not be removed.
39   Taligent is a registered trademark of Taligent, Inc.
40 */
41 
42 import java.util.Locale;
43 import java.text.Collator;
44 
45 // Quick dummy program for printing out test results
46 public class FinnishTest extends CollatorTest {
47 
48     public static void main(String[] args) throws Exception {
49         new FinnishTest().run(args);
50     }
51 
52     /*
53      * Data for TestPrimary()
54      */
55     private static final String[] primarySourceData = {
56         "L\u00E5vi",
57         "wat"
58     };
59 
60     private static final String[] primaryTargetData = {
61         "L\u00E4we",
62         "vat"
63     };
64 
65     private static final int[] primaryResults = {
66         -1,  0
67     };
68 
69     /*
70      * Data for TestTertiary()
71      */
72     private static final String tertiarySourceData[] = {
73         "wat",
74         "vat",
75         "a\u00FCbeck"
76     };
77 
78     private static final String tertiaryTargetData[] = {
79         "vat",
80         "way",
81         "axbeck"
82     };
83 
84     private static final int[] tertiaryResults = {
85          1, -1,  1
86     };
87 
88     public void TestPrimary() {
89         doTest(myCollation, Collator.PRIMARY,
90                primarySourceData, primaryTargetData, primaryResults);
91     }
92 
93     public void TestTertiary() {
94         doTest(myCollation, Collator.TERTIARY,
95               tertiarySourceData, tertiaryTargetData, tertiaryResults);
96     }
97 
98     private final Collator myCollation = Collator.getInstance(Locale.of("fi", "FI"));
99 }