Path: blob/master/test/jdk/java/text/Collator/FrenchTest.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 French 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 FrenchTest extends CollatorTest {4647public static void main(String[] args) throws Exception {48new FrenchTest().run(args);49}5051private static final String[] tertiarySourceData = {52"abc",53"COTE",54"p\u00EAche",55"p\u00EAcher",56"p\u00E9cher",57"p\u00E9cher",58"Hello"59};6061private static final String[] tertiaryTargetData = {62"ABC",63"c\u00f4te",64"p\u00E9ch\u00E9",65"p\u00E9ch\u00E9",66"p\u00EAche",67"p\u00EAcher",68"hellO"69};7071private static final int[] tertiaryResults = {72-1, -1, -1, 1, 1, -1, 173};7475private static final String[] testData = {76"a",77"A",78"e",79"E",80"\u00e9",81"\u00e8",82"\u00ea",83"\u00eb",84"ea",85"x"86};8788public void TestTertiary() {89doTest(myCollation, Collator.TERTIARY,90tertiarySourceData, tertiaryTargetData, tertiaryResults);9192for (int i = 0; i < testData.length-1; i++) {93for (int j = i+1; j < testData.length; j++) {94doTest(myCollation, testData[i], testData[j], -1);95}96}97}9899private final Collator myCollation = Collator.getInstance(Locale.FRANCE);100}101102103