Path: blob/master/test/jdk/java/text/Collator/GermanTest.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 German 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 GermanTest extends CollatorTest {4546public static void main(String[] args) throws Exception {47new GermanTest().run(args);48}4950/*51* Shared data for TestPrimary() and TestTertiary()52*/53private static final String testSourceData[] = {54"Gr\u00F6\u00DFe",55"abc",56"T\u00F6ne",57"T\u00F6ne",58"T\u00F6ne",59"a\u0308bc",60"\u00E4bc",61"\u00E4bc",62"Stra\u00DFe",63"efg",64"\u00E4bc",65"Stra\u00DFe"66};6768private static final String testTargetData[] = {69"Grossist",70"a\u0308bc",71"Ton",72"Tod",73"Tofu",74"A\u0308bc",75"a\u0308bc",76"aebc",77"Strasse",78"efg",79"aebc",80"Strasse"81};8283/*84* Data for TestPrimary()85*/86private static final int[] primaryResults = {87-1, 0, 1, 1, 1, 0, 0, -1, 0, 0,88-1, 089};9091/*92* Data for TestTertiary()93*/94private static final int[] tertiaryResults = {95-1, -1, 1, 1, 1, -1, 0, -1, 1, 0,96-1, 197};9899public void TestPrimary() {100doTest(myCollation, Collator.PRIMARY,101testSourceData, testTargetData, primaryResults);102}103104public void TestTertiary() {105doTest(myCollation, Collator.TERTIARY,106testSourceData, testTargetData, tertiaryResults);107}108109private final Collator myCollation = Collator.getInstance(Locale.GERMAN);110}111112113