2702N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 2702N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2702N/A * This code is free software; you can redistribute it and/or modify it 2702N/A * under the terms of the GNU General Public License version 2 only, as 2702N/A * published by the Free Software Foundation. 2702N/A * This code is distributed in the hope that it will be useful, but WITHOUT 2702N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2702N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2702N/A * version 2 for more details (a copy is included in the LICENSE file that 2702N/A * You should have received a copy of the GNU General Public License version 2702N/A * 2 along with this work; if not, write to the Free Software Foundation, 2702N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2702N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2702N/A * or visit www.oracle.com if you need additional information or have any 2702N/A * @summary Unit test for week date support 2702N/A // Week dates are in the ISO numbering for day-of-week. 2702N/A // Calendar year-date, Week year-date 2715N/A {{
2005,
01,
01}, {
2004,
53,
6}},
2715N/A {{
2005,
01,
02}, {
2004,
53,
7}},
2715N/A {{
2005,
12,
31}, {
2005,
52,
6}},
2715N/A {{
2007,
01,
01}, {
2007,
01,
1}},
2715N/A {{
2007,
12,
30}, {
2007,
52,
7}},
2715N/A {{
2007,
12,
31}, {
2008,
01,
1}},
2715N/A {{
2008,
01,
01}, {
2008,
01,
2}},
2715N/A {{
2008,
12,
29}, {
2009,
01,
1}},
2715N/A {{
2008,
12,
31}, {
2009,
01,
3}},
2715N/A {{
2009,
01,
01}, {
2009,
01,
4}},
2715N/A {{
2009,
12,
31}, {
2009,
53,
4}},
2715N/A {{
2010,
01,
03}, {
2009,
53,
7}},
2715N/A {{
2009,
12,
31}, {
2009,
53,
4}},
2715N/A {{
2010,
01,
01}, {
2009,
53,
5}},
2715N/A {{
2010,
01,
02}, {
2009,
53,
6}},
2715N/A {{
2010,
01,
03}, {
2009,
53,
7}},
2715N/A {{
2008,
12,
28}, {
2008,
52,
7}},
2715N/A {{
2008,
12,
29}, {
2009,
01,
1}},
2715N/A {{
2008,
12,
30}, {
2009,
01,
2}},
2715N/A {{
2008,
12,
31}, {
2009,
01,
3}},
2715N/A {{
2009,
01,
01}, {
2009,
01,
4}}
2715N/A {{
2008,
12,
28}, {
2009,
0,
7}},
2715N/A {{
2008,
12,
21}, {
2009, -
1,
7}},
2715N/A {{
2009,
1,
4}, {
2008,
53,
7}},
2702N/A // Convert ISO 8601 day-of-week to Calendar.DAY_OF_WEEK. 2702N/A "got=%4d-W%02d-%d, expected=%4d-W%02d-%d (not ISO day-of-week)",
2702N/A // Test getWeeksInWeekYear(). 2702N/A // If we avoid the first week of January and the last week of 2702N/A // December, getWeeksInWeekYear() and 2702N/A // getActualMaximum(WEEK_OF_YEAR) values should be the same. 2702N/A +
"getActualMaximum(WEEK_OF_YEAR) = %d%n",
2715N/A // Test lenient mode with out of range values. 2715N/A // Convert ISO 8601 day-of-week to Calendar.DAY_OF_WEEK. 2715N/A // Use the raw dayOfWeek value as invalid data 2702N/A // Use GMT to avoid any surprises related DST transitions. 2702N/A // Setup the ISO 8601 compatible parameters