author | naoto |
Tue, 25 Sep 2018 13:57:24 -0700 | |
changeset 51874 | a0426bc28519 |
parent 50643 | f2d94a0619a2 |
permissions | -rw-r--r-- |
43064
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
1 |
/* |
50643
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. |
43064
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
4 |
* |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
8 |
* |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
13 |
* accompanied this code). |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
14 |
* |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
18 |
* |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
21 |
* questions. |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
22 |
*/ |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
23 |
|
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
24 |
/* |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
25 |
* This file is available under and governed by the GNU General Public |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
26 |
* License version 2 only, as published by the Free Software Foundation. |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
27 |
* However, the following notice accompanied the original version of this |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
28 |
* file: |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
29 |
* |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
30 |
* Copyright (c) 2009-2012, Stephen Colebourne & Michael Nascimento Santos |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
31 |
* |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
32 |
* All rights reserved. |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
33 |
* |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
34 |
* Redistribution and use in source and binary forms, with or without |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
35 |
* modification, are permitted provided that the following conditions are met: |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
36 |
* |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
37 |
* * Redistributions of source code must retain the above copyright notice, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
38 |
* this list of conditions and the following disclaimer. |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
39 |
* |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
40 |
* * Redistributions in binary form must reproduce the above copyright notice, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
41 |
* this list of conditions and the following disclaimer in the documentation |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
42 |
* and/or other materials provided with the distribution. |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
43 |
* |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
44 |
* * Neither the name of JSR-310 nor the names of its contributors |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
45 |
* may be used to endorse or promote products derived from this software |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
46 |
* without specific prior written permission. |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
47 |
* |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
48 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
49 |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
50 |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
51 |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
52 |
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
53 |
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
54 |
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
55 |
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
56 |
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
57 |
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
58 |
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
59 |
*/ |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
60 |
|
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
61 |
/* |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
62 |
* @test |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
63 |
* @modules jdk.localedata |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
64 |
*/ |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
65 |
package test.java.time.format; |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
66 |
|
50643
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
67 |
import java.time.chrono.ChronoLocalDate; |
43064
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
68 |
import java.time.chrono.Chronology; |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
69 |
import java.time.chrono.IsoChronology; |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
70 |
import java.time.chrono.JapaneseChronology; |
50643
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
71 |
import java.time.chrono.JapaneseEra; |
43064
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
72 |
import java.time.chrono.MinguoChronology; |
50643
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
73 |
import java.time.chrono.ThaiBuddhistChronology; |
43064
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
74 |
import java.time.format.DateTimeFormatter; |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
75 |
import java.time.format.DateTimeFormatterBuilder; |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
76 |
import java.time.format.FormatStyle; |
51874
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
77 |
import java.time.format.ResolverStyle; |
43064
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
78 |
import java.time.LocalDate; |
50643
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
79 |
import java.time.temporal.ChronoField; |
43064
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
80 |
import java.time.temporal.Temporal; |
51874
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
81 |
import java.time.temporal.TemporalAccessor; |
43064
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
82 |
|
50643
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
83 |
import java.util.HashMap; |
43064
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
84 |
import java.util.Locale; |
50643
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
85 |
import java.util.Map; |
43064
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
86 |
|
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
87 |
import static org.testng.Assert.assertEquals; |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
88 |
|
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
89 |
import org.testng.annotations.BeforeMethod; |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
90 |
import org.testng.annotations.DataProvider; |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
91 |
import org.testng.annotations.Test; |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
92 |
|
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
93 |
/** |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
94 |
* Test DateTimeFormatterBuilder. |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
95 |
*/ |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
96 |
@Test |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
97 |
public class TestDateTimeFormatterBuilderWithLocale { |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
98 |
|
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
99 |
private DateTimeFormatterBuilder builder; |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
100 |
|
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
101 |
@BeforeMethod |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
102 |
public void setUp() { |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
103 |
builder = new DateTimeFormatterBuilder(); |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
104 |
} |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
105 |
|
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
106 |
//----------------------------------------------------------------------- |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
107 |
@DataProvider(name="patternPrint") |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
108 |
Object[][] data_patternPrint() { |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
109 |
return new Object[][] { |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
110 |
{"Q", date(2012, 2, 10), "1"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
111 |
{"QQ", date(2012, 2, 10), "01"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
112 |
{"QQQ", date(2012, 2, 10), "Q1"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
113 |
{"QQQQ", date(2012, 2, 10), "1st quarter"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
114 |
{"QQQQQ", date(2012, 2, 10), "1"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
115 |
}; |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
116 |
} |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
117 |
|
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
118 |
@Test(dataProvider="patternPrint") |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
119 |
public void test_appendPattern_patternPrint(String input, Temporal temporal, String expected) throws Exception { |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
120 |
DateTimeFormatter f = builder.appendPattern(input).toFormatter(Locale.UK); |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
121 |
String test = f.format(temporal); |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
122 |
assertEquals(test, expected); |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
123 |
} |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
124 |
|
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
125 |
//----------------------------------------------------------------------- |
50643
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
126 |
@DataProvider(name="mapTextLookup") |
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
127 |
Object[][] data_mapTextLookup() { |
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
128 |
return new Object[][] { |
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
129 |
{IsoChronology.INSTANCE.date(1, 1, 1), Locale.ENGLISH}, |
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
130 |
{JapaneseChronology.INSTANCE.date(JapaneseEra.HEISEI, 1, 1, 8), Locale.ENGLISH}, |
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
131 |
{MinguoChronology.INSTANCE.date(1, 1, 1), Locale.ENGLISH}, |
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
132 |
{ThaiBuddhistChronology.INSTANCE.date(1, 1, 1), Locale.ENGLISH}, |
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
133 |
}; |
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
134 |
} |
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
135 |
|
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
136 |
@Test(dataProvider="mapTextLookup") |
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
137 |
public void test_appendText_mapTextLookup(ChronoLocalDate date, Locale locale) { |
51874
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
138 |
final String firstYear = "firstYear"; |
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
139 |
final String firstMonth = "firstMonth"; |
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
140 |
final String firstYearMonth = firstYear + firstMonth; |
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
141 |
final long first = 1L; |
50643
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
142 |
|
51874
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
143 |
DateTimeFormatter formatter = builder |
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
144 |
.appendText(ChronoField.YEAR_OF_ERA, Map.of(first, firstYear)) |
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
145 |
.appendText(ChronoField.MONTH_OF_YEAR, Map.of(first, firstMonth)) |
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
146 |
.toFormatter(locale) |
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
147 |
.withResolverStyle(ResolverStyle.STRICT); |
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
148 |
|
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
149 |
assertEquals(date.format(formatter), firstYearMonth); |
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
150 |
|
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
151 |
TemporalAccessor ta = formatter.parse(firstYearMonth); |
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
152 |
assertEquals(ta.getLong(ChronoField.YEAR_OF_ERA), first); |
a0426bc28519
8210633: Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
naoto
parents:
50643
diff
changeset
|
153 |
assertEquals(ta.getLong(ChronoField.MONTH_OF_YEAR), first); |
50643
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
154 |
} |
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
155 |
|
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
156 |
|
f2d94a0619a2
8042131: DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
naoto
parents:
47216
diff
changeset
|
157 |
//----------------------------------------------------------------------- |
43064
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
158 |
@DataProvider(name="localePatterns") |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
159 |
Object[][] localizedDateTimePatterns() { |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
160 |
return new Object[][] { |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
161 |
// French Locale and ISO Chronology |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
162 |
{FormatStyle.FULL, FormatStyle.FULL, IsoChronology.INSTANCE, Locale.FRENCH, "EEEE d MMMM y '\u00e0' HH:mm:ss zzzz"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
163 |
{FormatStyle.LONG, FormatStyle.LONG, IsoChronology.INSTANCE, Locale.FRENCH, "d MMMM y '\u00e0' HH:mm:ss z"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
164 |
{FormatStyle.MEDIUM, FormatStyle.MEDIUM, IsoChronology.INSTANCE, Locale.FRENCH, "d MMM y '\u00e0' HH:mm:ss"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
165 |
{FormatStyle.SHORT, FormatStyle.SHORT, IsoChronology.INSTANCE, Locale.FRENCH, "dd/MM/y HH:mm"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
166 |
{FormatStyle.FULL, null, IsoChronology.INSTANCE, Locale.FRENCH, "EEEE d MMMM y"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
167 |
{FormatStyle.LONG, null, IsoChronology.INSTANCE, Locale.FRENCH, "d MMMM y"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
168 |
{FormatStyle.MEDIUM, null, IsoChronology.INSTANCE, Locale.FRENCH, "d MMM y"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
169 |
{FormatStyle.SHORT, null, IsoChronology.INSTANCE, Locale.FRENCH, "dd/MM/y"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
170 |
{null, FormatStyle.FULL, IsoChronology.INSTANCE, Locale.FRENCH, "HH:mm:ss zzzz"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
171 |
{null, FormatStyle.LONG, IsoChronology.INSTANCE, Locale.FRENCH, "HH:mm:ss z"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
172 |
{null, FormatStyle.MEDIUM, IsoChronology.INSTANCE, Locale.FRENCH, "HH:mm:ss"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
173 |
{null, FormatStyle.SHORT, IsoChronology.INSTANCE, Locale.FRENCH, "HH:mm"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
174 |
|
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
175 |
// Japanese Locale and JapaneseChronology |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
176 |
{FormatStyle.FULL, FormatStyle.FULL, JapaneseChronology.INSTANCE, Locale.JAPANESE, "Gy\u5e74M\u6708d\u65e5EEEE H\u6642mm\u5206ss\u79d2 zzzz"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
177 |
{FormatStyle.LONG, FormatStyle.LONG, JapaneseChronology.INSTANCE, Locale.JAPANESE, "Gy\u5e74M\u6708d\u65e5 H:mm:ss z"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
178 |
{FormatStyle.MEDIUM, FormatStyle.MEDIUM, JapaneseChronology.INSTANCE, Locale.JAPANESE, "Gy\u5e74M\u6708d\u65e5 H:mm:ss"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
179 |
{FormatStyle.SHORT, FormatStyle.SHORT, JapaneseChronology.INSTANCE, Locale.JAPANESE, "GGGGGy/M/d H:mm"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
180 |
{FormatStyle.FULL, null, JapaneseChronology.INSTANCE, Locale.JAPANESE, "Gy\u5e74M\u6708d\u65e5EEEE"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
181 |
{FormatStyle.LONG, null, JapaneseChronology.INSTANCE, Locale.JAPANESE, "Gy\u5e74M\u6708d\u65e5"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
182 |
{FormatStyle.MEDIUM, null, JapaneseChronology.INSTANCE, Locale.JAPANESE, "Gy\u5e74M\u6708d\u65e5"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
183 |
{FormatStyle.SHORT, null, JapaneseChronology.INSTANCE, Locale.JAPANESE, "GGGGGy/M/d"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
184 |
{null, FormatStyle.FULL, JapaneseChronology.INSTANCE, Locale.JAPANESE, "H\u6642mm\u5206ss\u79d2 zzzz"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
185 |
{null, FormatStyle.LONG, JapaneseChronology.INSTANCE, Locale.JAPANESE, "H:mm:ss z"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
186 |
{null, FormatStyle.MEDIUM, JapaneseChronology.INSTANCE, Locale.JAPANESE, "H:mm:ss"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
187 |
{null, FormatStyle.SHORT, JapaneseChronology.INSTANCE, Locale.JAPANESE, "H:mm"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
188 |
|
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
189 |
// Chinese Local and Chronology |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
190 |
{FormatStyle.FULL, FormatStyle.FULL, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5EEEE zzzz ah:mm:ss"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
191 |
{FormatStyle.LONG, FormatStyle.LONG, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5 z ah:mm:ss"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
192 |
{FormatStyle.MEDIUM, FormatStyle.MEDIUM, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5 ah:mm:ss"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
193 |
{FormatStyle.SHORT, FormatStyle.SHORT, MinguoChronology.INSTANCE, Locale.CHINESE, "Gyy/M/d ah:mm"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
194 |
{FormatStyle.FULL, null, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5EEEE"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
195 |
{FormatStyle.LONG, null, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
196 |
{FormatStyle.MEDIUM, null, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
197 |
{FormatStyle.SHORT, null, MinguoChronology.INSTANCE, Locale.CHINESE, "Gyy/M/d"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
198 |
{null, FormatStyle.FULL, MinguoChronology.INSTANCE, Locale.CHINESE, "zzzz ah:mm:ss"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
199 |
{null, FormatStyle.LONG, MinguoChronology.INSTANCE, Locale.CHINESE, "z ah:mm:ss"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
200 |
{null, FormatStyle.MEDIUM, MinguoChronology.INSTANCE, Locale.CHINESE, "ah:mm:ss"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
201 |
{null, FormatStyle.SHORT, MinguoChronology.INSTANCE, Locale.CHINESE, "ah:mm"}, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
202 |
}; |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
203 |
} |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
204 |
|
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
205 |
@Test(dataProvider="localePatterns") |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
206 |
public void test_getLocalizedDateTimePattern(FormatStyle dateStyle, FormatStyle timeStyle, |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
207 |
Chronology chrono, Locale locale, String expected) { |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
208 |
String actual = DateTimeFormatterBuilder.getLocalizedDateTimePattern(dateStyle, timeStyle, chrono, locale); |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
209 |
assertEquals(actual, expected, "Pattern " + convertNonAscii(actual)); |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
210 |
} |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
211 |
|
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
212 |
/** |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
213 |
* Returns a string that includes non-ascii characters after expanding |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
214 |
* the non-ascii characters to their Java language \\uxxxx form. |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
215 |
* @param input an input string |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
216 |
* @return the encoded string. |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
217 |
*/ |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
218 |
private String convertNonAscii(String input) { |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
219 |
StringBuilder sb = new StringBuilder(input.length() * 6); |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
220 |
for (int i = 0; i < input.length(); i++) { |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
221 |
char ch = input.charAt(i); |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
222 |
if (ch < 255) { |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
223 |
sb.append(ch); |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
224 |
} else { |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
225 |
sb.append("\\u"); |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
226 |
sb.append(Integer.toHexString(ch)); |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
227 |
} |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
228 |
} |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
229 |
return sb.toString(); |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
230 |
} |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
231 |
|
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
232 |
private static Temporal date(int y, int m, int d) { |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
233 |
return LocalDate.of(y, m, d); |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
234 |
} |
d1e364d05bf0
8171958: Several tests from java/time/test/java/time/format requiring jdk.localedata for execution
skovalev
parents:
diff
changeset
|
235 |
} |