Path: blob/master/test/jdk/java/text/Collator/SpanishTest.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 Spanish 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 SpanishTest extends CollatorTest {4546public static void main(String[] args) throws Exception {47new SpanishTest().run(args);48}4950/*51* TestPrimary()52*/53private static final String[] primarySourceData = {54"alias",55"acHc",56"acc",57"Hello"58};5960private static final String[] primaryTargetData = {61"allias",62"aCHc",63"aCHc",64"hellO"65};6667private static final int[] primaryResults = {68-1, 0, -1, 069};7071/*72* TestTertiary()73*/74private static final String[] tertiarySourceData = {75"alias",76"Elliot",77"Hello",78"acHc",79"acc"80};8182private static final String[] tertiaryTargetData = {83"allias",84"Emiot",85"hellO",86"aCHc",87"aCHc"88};8990private static final int[] tertiaryResults = {91-1, -1, 1, -1, -192};9394public void TestPrimary() {95doTest(myCollation, Collator.PRIMARY,96primarySourceData, primaryTargetData, primaryResults);97}9899public void TestTertiary() {100doTest(myCollation, Collator.TERTIARY,101tertiarySourceData, tertiaryTargetData, tertiaryResults);102}103104private final Collator myCollation = Collator.getInstance(new Locale("es", "ES", ""));105}106107108