Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/jdk/java/util/Calendar/CalendarTestScripts/JapaneseTests.java
41152 views
1
/*
2
* Copyright (c) 2018, 2021, 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
* @summary tests Japanese Calendar.
27
* @bug 4609228 8187649
28
* @modules java.base/sun.util
29
* java.base/sun.util.calendar
30
* @compile
31
* CalendarAdapter.java
32
* CalendarTestEngine.java
33
* CalendarTestException.java
34
* Exceptions.java
35
* GregorianAdapter.java
36
* Result.java
37
* Symbol.java
38
* Variable.java
39
* @run main/othervm/timeout=120 JapaneseTests
40
*/
41
42
import java.io.File;
43
import java.io.FilenameFilter;
44
import java.nio.file.Path;
45
import java.nio.file.Paths;
46
import java.util.ArrayList;
47
import java.util.Arrays;
48
import java.util.List;
49
50
public class JapaneseTests {
51
52
private static List<String> SET_LENIENT = Arrays.asList(
53
"japanese_minmax.cts",
54
"japanese_add.cts",
55
"japanese_roll.cts",
56
"japanese_exceptions.cts");
57
private static List<String> DEFAULT_LENIENT = Arrays.asList(
58
"japanese.cts",
59
"japanese_normalization.cts");
60
61
private static Path srcPath = Paths.get(System.getProperty("test.src"));
62
63
public static void main(String[] args) throws Throwable {
64
List<String> tzList = getFileNameList("timezones");
65
List<String> modeList = getFileNameList("params");
66
67
for (String jaTest: DEFAULT_LENIENT) {
68
for (String tz : tzList) {
69
String[] ts = { srcPath + "/timezones/" + tz,
70
srcPath + "/japanese/" + jaTest};
71
CalendarTestEngine.main(ts);
72
}
73
}
74
75
for (String jaTest: SET_LENIENT) {
76
for (String tz : tzList) {
77
for (String mode : modeList) {
78
String[] ts = { srcPath + "/timezones/" + tz,
79
srcPath + "/params/" + mode,
80
srcPath + "/japanese/" + jaTest };
81
CalendarTestEngine.main(ts);
82
}
83
}
84
}
85
}
86
87
private static List<String> getFileNameList(String type ){
88
List<String> fileList = new ArrayList<>();
89
File dir = new File(srcPath + "/"+ type);
90
File[] testFiles = dir.listFiles(new FilenameFilter() {
91
public boolean accept(File dir, String name) {
92
return name.toLowerCase().endsWith(".cts");
93
}
94
});
95
for (File f:testFiles) {
96
fileList.add(f.getName());
97
}
98
return fileList;
99
}
100
}
101
102