Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/java/text/Collator/FrenchTest.java
47182 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 French 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 FrenchTest extends CollatorTest {4546public static void main(String[] args) throws Exception {47new FrenchTest().run(args);48}4950private static final String[] tertiarySourceData = {51"abc",52"COTE",53"p\u00EAche",54"p\u00EAcher",55"p\u00E9cher",56"p\u00E9cher",57"Hello"58};5960private static final String[] tertiaryTargetData = {61"ABC",62"c\u00f4te",63"p\u00E9ch\u00E9",64"p\u00E9ch\u00E9",65"p\u00EAche",66"p\u00EAcher",67"hellO"68};6970private static final int[] tertiaryResults = {71-1, -1, -1, 1, 1, -1, 172};7374private static final String[] testData = {75"a",76"A",77"e",78"E",79"\u00e9",80"\u00e8",81"\u00ea",82"\u00eb",83"ea",84"x"85};8687public void TestTertiary() {88doTest(myCollation, Collator.TERTIARY,89tertiarySourceData, tertiaryTargetData, tertiaryResults);9091for (int i = 0; i < testData.length-1; i++) {92for (int j = i+1; j < testData.length; j++) {93doTest(myCollation, testData[i], testData[j], -1);94}95}96}9798private final Collator myCollation = Collator.getInstance(Locale.FRANCE);99}100101102