Path: blob/master/test/jdk/java/text/Collator/FinnishTest.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 Finnish 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 FinnishTest extends CollatorTest {4647public static void main(String[] args) throws Exception {48new FinnishTest().run(args);49}5051/*52* Data for TestPrimary()53*/54private static final String[] primarySourceData = {55"L\u00E5vi",56"wat"57};5859private static final String[] primaryTargetData = {60"L\u00E4we",61"vat"62};6364private static final int[] primaryResults = {65-1, 066};6768/*69* Data for TestTertiary()70*/71private static final String tertiarySourceData[] = {72"wat",73"vat",74"a\u00FCbeck"75};7677private static final String tertiaryTargetData[] = {78"vat",79"way",80"axbeck"81};8283private static final int[] tertiaryResults = {841, -1, 185};8687public void TestPrimary() {88doTest(myCollation, Collator.PRIMARY,89primarySourceData, primaryTargetData, primaryResults);90}9192public void TestTertiary() {93doTest(myCollation, Collator.TERTIARY,94tertiarySourceData, tertiaryTargetData, tertiaryResults);95}9697private final Collator myCollation = Collator.getInstance(new Locale("fi", "FI", ""));98}99100101