Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/jdk/java/text/Collator/GermanTest.java
41149 views
1
/*
2
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
/*
25
* @test
26
* @library /java/text/testlib
27
* @summary test German Collation
28
*/
29
/*
30
(C) Copyright Taligent, Inc. 1996 - All Rights Reserved
31
(C) Copyright IBM Corp. 1996 - All Rights Reserved
32
33
The original version of this source code and documentation is copyrighted and
34
owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These materials are
35
provided under terms of a License Agreement between Taligent and Sun. This
36
technology is protected by multiple US and International patents. This notice and
37
attribution to Taligent may not be removed.
38
Taligent is a registered trademark of Taligent, Inc.
39
*/
40
41
import java.util.Locale;
42
import java.text.Collator;
43
44
// Quick dummy program for printing out test results
45
public class GermanTest extends CollatorTest {
46
47
public static void main(String[] args) throws Exception {
48
new GermanTest().run(args);
49
}
50
51
/*
52
* Shared data for TestPrimary() and TestTertiary()
53
*/
54
private static final String testSourceData[] = {
55
"Gr\u00F6\u00DFe",
56
"abc",
57
"T\u00F6ne",
58
"T\u00F6ne",
59
"T\u00F6ne",
60
"a\u0308bc",
61
"\u00E4bc",
62
"\u00E4bc",
63
"Stra\u00DFe",
64
"efg",
65
"\u00E4bc",
66
"Stra\u00DFe"
67
};
68
69
private static final String testTargetData[] = {
70
"Grossist",
71
"a\u0308bc",
72
"Ton",
73
"Tod",
74
"Tofu",
75
"A\u0308bc",
76
"a\u0308bc",
77
"aebc",
78
"Strasse",
79
"efg",
80
"aebc",
81
"Strasse"
82
};
83
84
/*
85
* Data for TestPrimary()
86
*/
87
private static final int[] primaryResults = {
88
-1, 0, 1, 1, 1, 0, 0, -1, 0, 0,
89
-1, 0
90
};
91
92
/*
93
* Data for TestTertiary()
94
*/
95
private static final int[] tertiaryResults = {
96
-1, -1, 1, 1, 1, -1, 0, -1, 1, 0,
97
-1, 1
98
};
99
100
public void TestPrimary() {
101
doTest(myCollation, Collator.PRIMARY,
102
testSourceData, testTargetData, primaryResults);
103
}
104
105
public void TestTertiary() {
106
doTest(myCollation, Collator.TERTIARY,
107
testSourceData, testTargetData, tertiaryResults);
108
}
109
110
private final Collator myCollation = Collator.getInstance(Locale.GERMAN);
111
}
112
113