Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/jdk/java/util/Calendar/CalendarTestScripts/JapaneseRollTests.java
41152 views
1
/*
2
* Copyright (c) 2018, 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
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
* JapaneseRollDayOfWeekTestGenerator.java
40
* @run main/timeout=120/othervm JapaneseRollTests
41
*/
42
43
import java.io.File;
44
import java.io.FilenameFilter;
45
import java.nio.file.Path;
46
import java.nio.file.Paths;
47
import java.util.ArrayList;
48
import java.util.Arrays;
49
import java.util.List;
50
51
public class JapaneseRollTests {
52
private static List<String> TZ_TEST_LIST = Arrays.asList(
53
"tz_japan.cts", "tz_pst.cts");
54
private static Path srcPath = Paths.get(System.getProperty("test.src"));
55
private static Path testPath = Paths.get(System.getProperty("test.classes"));
56
57
public static void main(String[] args) throws Throwable {
58
List<String> modeList = getFileNameList("params");
59
//Test only 3 years by default
60
String[] jpyear ={"3"};
61
JapaneseRollDayOfWeekTestGenerator.generateTestScript(jpyear);
62
63
for (String tz : TZ_TEST_LIST) {
64
for(String mode:modeList){
65
String[] ts = { srcPath + "/timezones/" + tz,
66
srcPath + "/params/" + mode,
67
testPath + "/rolldow.cts"};
68
69
CalendarTestEngine.main(ts);
70
}
71
}
72
}
73
74
private static List<String> getFileNameList(String type ){
75
List<String> fileList = new ArrayList<>();
76
File dir = new File(srcPath + "/"+ type);
77
File[] testFiles = dir.listFiles(new FilenameFilter() {
78
public boolean accept(File dir, String name) {
79
return name.toLowerCase().endsWith(".cts");
80
}
81
});
82
for (File f:testFiles) {
83
fileList.add(f.getName());
84
}
85
86
return fileList;
87
}
88
}
89
90