< prev index next >

test/jdk/java/text/Format/DateFormat/WeekDateTest.java

Print this page
rev 54350 : 8205432: Replace the placeholder Japanese era name
Reviewed-by: rriggs

*** 1,7 **** /* ! * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 135,147 **** private static void noWeekDateSupport() throws Exception { // Tests with Japanese Imperial Calendar that doesn't support week dates. Calendar jcal = Calendar.getInstance(TimeZone.getTimeZone("GMT"), new Locale("ja", "JP", "JP")); ! String format = "2-W01-2"; // 2019-12-31 == N1-12-31 int expectedYear = 2019; ! // Check the current era, Heisei or NewEra if (System.currentTimeMillis() < 1556668800000L) { format = "21-W01-3"; // 2008-12-31 == H20-12-31 expectedYear = 2008; } jcal.setFirstDayOfWeek(MONDAY); --- 135,147 ---- private static void noWeekDateSupport() throws Exception { // Tests with Japanese Imperial Calendar that doesn't support week dates. Calendar jcal = Calendar.getInstance(TimeZone.getTimeZone("GMT"), new Locale("ja", "JP", "JP")); ! String format = "2-W01-2"; // 2019-12-31 == R1-12-31 int expectedYear = 2019; ! // Check the current era, Heisei or Reiwa if (System.currentTimeMillis() < 1556668800000L) { format = "21-W01-3"; // 2008-12-31 == H20-12-31 expectedYear = 2008; } jcal.setFirstDayOfWeek(MONDAY);
< prev index next >