test/java/time/tck/java/time/temporal/TCKIsoFields.java

Print this page




  39  *    and/or other materials provided with the distribution.
  40  *
  41  *  * Neither the name of JSR-310 nor the names of its contributors
  42  *    may be used to endorse or promote products derived from this software
  43  *    without specific prior written permission.
  44  *
  45  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  46  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  47  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  48  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  49  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  50  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  51  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  52  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  53  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  54  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  55  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  56  */
  57 package tck.java.time.temporal;
  58 
  59 import java.time.format.DateTimeBuilder;
  60 import java.time.temporal.*;
  61 
  62 import static java.time.DayOfWeek.FRIDAY;
  63 import static java.time.DayOfWeek.MONDAY;
  64 import static java.time.DayOfWeek.SATURDAY;
  65 import static java.time.DayOfWeek.SUNDAY;
  66 import static java.time.DayOfWeek.THURSDAY;
  67 import static java.time.DayOfWeek.TUESDAY;
  68 import static java.time.DayOfWeek.WEDNESDAY;
  69 import static java.time.temporal.ChronoField.DAY_OF_WEEK;
  70 import static java.time.temporal.ChronoField.YEAR;
  71 import static org.testng.Assert.assertEquals;
  72 import static org.testng.Assert.assertTrue;
  73 
  74 import java.time.DayOfWeek;
  75 import java.time.LocalDate;




  76 
  77 import org.testng.annotations.DataProvider;
  78 import org.testng.annotations.Test;
  79 
  80 /**
  81  * Test.
  82  */
  83 @Test(groups={"tck"})
  84 public class TCKISOFields {
  85 
  86     @DataProvider(name="quarter")
  87     Object[][] data_quarter() {
  88         return new Object[][] {
  89                 {LocalDate.of(1969, 12, 29), 90, 4},
  90                 {LocalDate.of(1969, 12, 30), 91, 4},
  91                 {LocalDate.of(1969, 12, 31), 92, 4},
  92 
  93                 {LocalDate.of(1970, 1, 1), 1, 1},
  94                 {LocalDate.of(1970, 1, 2), 2, 1},
  95                 {LocalDate.of(1970, 2, 28), 59, 1},
  96                 {LocalDate.of(1970, 3, 1), 60, 1},
  97                 {LocalDate.of(1970, 3, 31), 90, 1},
  98 
  99                 {LocalDate.of(1970, 4, 1), 1, 2},
 100                 {LocalDate.of(1970, 6, 30), 91, 2},
 101 
 102                 {LocalDate.of(1970, 7, 1), 1, 3},
 103                 {LocalDate.of(1970, 9, 30), 92, 3},
 104 
 105                 {LocalDate.of(1970, 10, 1), 1, 4},
 106                 {LocalDate.of(1970, 12, 31), 92, 4},
 107 
 108                 {LocalDate.of(1972, 2, 28), 59, 1},
 109                 {LocalDate.of(1972, 2, 29), 60, 1},
 110                 {LocalDate.of(1972, 3, 1), 61, 1},
 111                 {LocalDate.of(1972, 3, 31), 91, 1},
 112         };
 113     }
 114 
 115     //-----------------------------------------------------------------------
 116     // DAY_OF_QUARTER
 117     //-----------------------------------------------------------------------
 118     @Test(dataProvider="quarter")
 119     public void test_DOQ(LocalDate date, int doq, int qoy) {
 120         assertEquals(ISOFields.DAY_OF_QUARTER.doGet(date), doq);
 121         assertEquals(date.get(ISOFields.DAY_OF_QUARTER), doq);
 122     }
 123 
 124     //-----------------------------------------------------------------------
 125     // QUARTER_OF_YEAR
 126     //-----------------------------------------------------------------------
 127     @Test(dataProvider="quarter")
 128     public void test_QOY(LocalDate date, int doq, int qoy) {
 129         assertEquals(ISOFields.QUARTER_OF_YEAR.doGet(date), qoy);
 130         assertEquals(date.get(ISOFields.QUARTER_OF_YEAR), qoy);
 131     }
 132 
 133     //-----------------------------------------------------------------------
 134     // builder
 135     //-----------------------------------------------------------------------
 136     @Test(dataProvider="quarter")
 137     public void test_builder_quarters(LocalDate date, int doq, int qoy) {
 138         DateTimeBuilder builder = new DateTimeBuilder();
 139         builder.addFieldValue(ISOFields.DAY_OF_QUARTER, doq);
 140         builder.addFieldValue(ISOFields.QUARTER_OF_YEAR, qoy);
 141         builder.addFieldValue(YEAR, date.getYear());
 142         builder.resolve();
 143         assertEquals(builder.query(LocalDate::from), date);








































 144     }
 145 
 146     //-----------------------------------------------------------------------
 147     //-----------------------------------------------------------------------
 148     //-----------------------------------------------------------------------
 149     @DataProvider(name="week")
 150     Object[][] data_week() {
 151         return new Object[][] {
 152                 {LocalDate.of(1969, 12, 29), MONDAY, 1, 1970},
 153                 {LocalDate.of(2012, 12, 23), SUNDAY, 51, 2012},
 154                 {LocalDate.of(2012, 12, 24), MONDAY, 52, 2012},
 155                 {LocalDate.of(2012, 12, 27), THURSDAY, 52, 2012},
 156                 {LocalDate.of(2012, 12, 28), FRIDAY, 52, 2012},
 157                 {LocalDate.of(2012, 12, 29), SATURDAY, 52, 2012},
 158                 {LocalDate.of(2012, 12, 30), SUNDAY, 52, 2012},
 159                 {LocalDate.of(2012, 12, 31), MONDAY, 1, 2013},
 160                 {LocalDate.of(2013, 1, 1), TUESDAY, 1, 2013},
 161                 {LocalDate.of(2013, 1, 2), WEDNESDAY, 1, 2013},
 162                 {LocalDate.of(2013, 1, 6), SUNDAY, 1, 2013},
 163                 {LocalDate.of(2013, 1, 7), MONDAY, 2, 2013},
 164         };
 165     }
 166 
 167     //-----------------------------------------------------------------------
 168     // WEEK_OF_WEEK_BASED_YEAR
 169     //-----------------------------------------------------------------------
 170     @Test(dataProvider="week")
 171     public void test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) {
 172         assertEquals(date.getDayOfWeek(), dow);
 173         assertEquals(ISOFields.WEEK_OF_WEEK_BASED_YEAR.doGet(date), week);
 174         assertEquals(date.get(ISOFields.WEEK_OF_WEEK_BASED_YEAR), week);
 175     }
 176 
 177     //-----------------------------------------------------------------------
 178     // WEEK_BASED_YEAR
 179     //-----------------------------------------------------------------------
 180     @Test(dataProvider="week")
 181     public void test_WBY(LocalDate date, DayOfWeek dow, int week, int wby) {
 182         assertEquals(date.getDayOfWeek(), dow);
 183         assertEquals(ISOFields.WEEK_BASED_YEAR.doGet(date), wby);
 184         assertEquals(date.get(ISOFields.WEEK_BASED_YEAR), wby);
 185     }
 186 
 187     //-----------------------------------------------------------------------
 188     // builder
 189     //-----------------------------------------------------------------------
 190     @Test(dataProvider="week")
 191     public void test_builder_weeks(LocalDate date, DayOfWeek dow, int week, int wby) {
 192         DateTimeBuilder builder = new DateTimeBuilder();
 193         builder.addFieldValue(ISOFields.WEEK_BASED_YEAR, wby);
 194         builder.addFieldValue(ISOFields.WEEK_OF_WEEK_BASED_YEAR, week);
 195         builder.addFieldValue(DAY_OF_WEEK, dow.getValue());
 196         builder.resolve();
 197         assertEquals(builder.query(LocalDate::from), date);
 198     }
 199 
 200     //-----------------------------------------------------------------------
 201     public void test_loop() {
 202         // loop round at least one 400 year cycle, including before 1970
 203         LocalDate date = LocalDate.of(1960, 1, 5);  // Tuseday of week 1 1960
 204         int year = 1960;
 205         int wby = 1960;
 206         int weekLen = 52;
 207         int week = 1;
 208         while (date.getYear() < 2400) {
 209             DayOfWeek loopDow = date.getDayOfWeek();
 210             if (date.getYear() != year) {
 211                 year = date.getYear();
 212             }
 213             if (loopDow == MONDAY) {
 214                 week++;
 215                 if ((week == 53 && weekLen == 52) || week == 54) {
 216                     week = 1;
 217                     LocalDate firstDayOfWeekBasedYear = date.plusDays(14).withDayOfYear(1);
 218                     DayOfWeek firstDay = firstDayOfWeekBasedYear.getDayOfWeek();
 219                     weekLen = (firstDay == THURSDAY || (firstDay == WEDNESDAY && firstDayOfWeekBasedYear.isLeapYear()) ? 53 : 52);
 220                     wby++;
 221                 }
 222             }
 223             assertEquals(ISOFields.WEEK_OF_WEEK_BASED_YEAR.doRange(date), ValueRange.of(1, weekLen), "Failed on " + date + " " + date.getDayOfWeek());
 224             assertEquals(ISOFields.WEEK_OF_WEEK_BASED_YEAR.doGet(date), week, "Failed on " + date + " " + date.getDayOfWeek());
 225             assertEquals(date.get(ISOFields.WEEK_OF_WEEK_BASED_YEAR), week, "Failed on " + date + " " + date.getDayOfWeek());
 226             assertEquals(ISOFields.WEEK_BASED_YEAR.doGet(date), wby, "Failed on " + date + " " + date.getDayOfWeek());
 227             assertEquals(date.get(ISOFields.WEEK_BASED_YEAR), wby, "Failed on " + date + " " + date.getDayOfWeek());
 228             date = date.plusDays(1);
 229         }
 230     }
 231 
 232     // TODO: more tests
 233 }


  39  *    and/or other materials provided with the distribution.
  40  *
  41  *  * Neither the name of JSR-310 nor the names of its contributors
  42  *    may be used to endorse or promote products derived from this software
  43  *    without specific prior written permission.
  44  *
  45  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  46  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  47  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  48  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  49  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  50  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  51  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  52  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  53  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  54  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  55  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  56  */
  57 package tck.java.time.temporal;
  58 



  59 import static java.time.DayOfWeek.FRIDAY;
  60 import static java.time.DayOfWeek.MONDAY;
  61 import static java.time.DayOfWeek.SATURDAY;
  62 import static java.time.DayOfWeek.SUNDAY;
  63 import static java.time.DayOfWeek.THURSDAY;
  64 import static java.time.DayOfWeek.TUESDAY;
  65 import static java.time.DayOfWeek.WEDNESDAY;
  66 import static java.time.temporal.ChronoField.DAY_OF_WEEK;
  67 import static java.time.temporal.ChronoField.YEAR;
  68 import static org.testng.Assert.assertEquals;

  69 
  70 import java.time.DayOfWeek;
  71 import java.time.LocalDate;
  72 import java.time.format.DateTimeFormatter;
  73 import java.time.format.DateTimeFormatterBuilder;
  74 import java.time.temporal.IsoFields;
  75 import java.time.temporal.ValueRange;
  76 
  77 import org.testng.annotations.DataProvider;
  78 import org.testng.annotations.Test;
  79 
  80 /**
  81  * Test.
  82  */
  83 @Test(groups={"tck"})
  84 public class TCKIsoFields {
  85 
  86     @DataProvider(name="quarter")
  87     Object[][] data_quarter() {
  88         return new Object[][] {
  89                 {LocalDate.of(1969, 12, 29), 90, 4},
  90                 {LocalDate.of(1969, 12, 30), 91, 4},
  91                 {LocalDate.of(1969, 12, 31), 92, 4},
  92 
  93                 {LocalDate.of(1970, 1, 1), 1, 1},
  94                 {LocalDate.of(1970, 1, 2), 2, 1},
  95                 {LocalDate.of(1970, 2, 28), 59, 1},
  96                 {LocalDate.of(1970, 3, 1), 60, 1},
  97                 {LocalDate.of(1970, 3, 31), 90, 1},
  98 
  99                 {LocalDate.of(1970, 4, 1), 1, 2},
 100                 {LocalDate.of(1970, 6, 30), 91, 2},
 101 
 102                 {LocalDate.of(1970, 7, 1), 1, 3},
 103                 {LocalDate.of(1970, 9, 30), 92, 3},
 104 
 105                 {LocalDate.of(1970, 10, 1), 1, 4},
 106                 {LocalDate.of(1970, 12, 31), 92, 4},
 107 
 108                 {LocalDate.of(1972, 2, 28), 59, 1},
 109                 {LocalDate.of(1972, 2, 29), 60, 1},
 110                 {LocalDate.of(1972, 3, 1), 61, 1},
 111                 {LocalDate.of(1972, 3, 31), 91, 1},
 112         };
 113     }
 114 
 115     //-----------------------------------------------------------------------
 116     // DAY_OF_QUARTER
 117     //-----------------------------------------------------------------------
 118     @Test(dataProvider="quarter")
 119     public void test_DOQ(LocalDate date, int doq, int qoy) {
 120         assertEquals(IsoFields.DAY_OF_QUARTER.getFrom(date), doq);
 121         assertEquals(date.get(IsoFields.DAY_OF_QUARTER), doq);
 122     }
 123 
 124     //-----------------------------------------------------------------------
 125     // QUARTER_OF_YEAR
 126     //-----------------------------------------------------------------------
 127     @Test(dataProvider="quarter")
 128     public void test_QOY(LocalDate date, int doq, int qoy) {
 129         assertEquals(IsoFields.QUARTER_OF_YEAR.getFrom(date), qoy);
 130         assertEquals(date.get(IsoFields.QUARTER_OF_YEAR), qoy);
 131     }
 132 
 133     //-----------------------------------------------------------------------
 134     // parse quarters
 135     //-----------------------------------------------------------------------
 136     @Test(dataProvider="quarter")
 137     public void test_parse_quarters(LocalDate date, int doq, int qoy) {
 138         DateTimeFormatter f = new DateTimeFormatterBuilder()
 139                 .appendValue(YEAR).appendLiteral('-')
 140                 .appendValue(IsoFields.QUARTER_OF_YEAR).appendLiteral('-')
 141                 .appendValue(IsoFields.DAY_OF_QUARTER).toFormatter();
 142         LocalDate parsed = LocalDate.parse(date.getYear() + "-" + qoy + "-" + doq, f);
 143         assertEquals(parsed, date);
 144     }
 145 
 146     //-----------------------------------------------------------------------
 147     // quarters between
 148     //-----------------------------------------------------------------------
 149     @DataProvider(name="quartersBetween")
 150     Object[][] data_quartersBetween() {
 151         return new Object[][] {
 152                 {LocalDate.of(2000, 1, 1), LocalDate.of(2000, 1, 1), 0},
 153                 {LocalDate.of(2000, 1, 1), LocalDate.of(2000, 1, 2), 0},
 154                 {LocalDate.of(2000, 1, 1), LocalDate.of(2000, 2, 1), 0},
 155                 {LocalDate.of(2000, 1, 1), LocalDate.of(2000, 3, 1), 0},
 156                 {LocalDate.of(2000, 1, 1), LocalDate.of(2000, 3, 31), 0},
 157                 {LocalDate.of(2000, 1, 1), LocalDate.of(2000, 4, 1), 1},
 158                 {LocalDate.of(2000, 1, 1), LocalDate.of(2000, 4, 2), 1},
 159                 {LocalDate.of(2000, 1, 1), LocalDate.of(2000, 6, 30), 1},
 160                 {LocalDate.of(2000, 1, 1), LocalDate.of(2000, 7, 1), 2},
 161                 {LocalDate.of(2000, 1, 1), LocalDate.of(2000, 10, 1), 3},
 162                 {LocalDate.of(2000, 1, 1), LocalDate.of(2000, 12, 31), 3},
 163                 {LocalDate.of(2000, 1, 1), LocalDate.of(2001, 1, 1), 4},
 164                 {LocalDate.of(2000, 1, 1), LocalDate.of(2002, 1, 1), 8},
 165 
 166                 {LocalDate.of(2000, 1, 1), LocalDate.of(1999, 12, 31), 0},
 167                 {LocalDate.of(2000, 1, 1), LocalDate.of(1999, 10, 2), 0},
 168                 {LocalDate.of(2000, 1, 1), LocalDate.of(1999, 10, 1), -1},
 169                 {LocalDate.of(2000, 1, 1), LocalDate.of(1999, 7, 2), -1},
 170                 {LocalDate.of(2000, 1, 1), LocalDate.of(1999, 7, 1), -2},
 171                 {LocalDate.of(2000, 1, 1), LocalDate.of(1999, 4, 2), -2},
 172                 {LocalDate.of(2000, 1, 1), LocalDate.of(1999, 4, 1), -3},
 173                 {LocalDate.of(2000, 1, 1), LocalDate.of(1999, 1, 2), -3},
 174                 {LocalDate.of(2000, 1, 1), LocalDate.of(1999, 1, 1), -4},
 175                 {LocalDate.of(2000, 1, 1), LocalDate.of(1998, 12, 31), -4},
 176                 {LocalDate.of(2000, 1, 1), LocalDate.of(1998, 10, 2), -4},
 177                 {LocalDate.of(2000, 1, 1), LocalDate.of(1998, 10, 1), -5},
 178         };
 179     }
 180 
 181     @Test(dataProvider="quartersBetween")
 182     public void test_quarters_between(LocalDate start, LocalDate end, long expected) {
 183         assertEquals(IsoFields.QUARTER_YEARS.between(start, end), expected);
 184     }
 185 
 186     //-----------------------------------------------------------------------
 187     //-----------------------------------------------------------------------
 188     //-----------------------------------------------------------------------
 189     @DataProvider(name="week")
 190     Object[][] data_week() {
 191         return new Object[][] {
 192                 {LocalDate.of(1969, 12, 29), MONDAY, 1, 1970},
 193                 {LocalDate.of(2012, 12, 23), SUNDAY, 51, 2012},
 194                 {LocalDate.of(2012, 12, 24), MONDAY, 52, 2012},
 195                 {LocalDate.of(2012, 12, 27), THURSDAY, 52, 2012},
 196                 {LocalDate.of(2012, 12, 28), FRIDAY, 52, 2012},
 197                 {LocalDate.of(2012, 12, 29), SATURDAY, 52, 2012},
 198                 {LocalDate.of(2012, 12, 30), SUNDAY, 52, 2012},
 199                 {LocalDate.of(2012, 12, 31), MONDAY, 1, 2013},
 200                 {LocalDate.of(2013, 1, 1), TUESDAY, 1, 2013},
 201                 {LocalDate.of(2013, 1, 2), WEDNESDAY, 1, 2013},
 202                 {LocalDate.of(2013, 1, 6), SUNDAY, 1, 2013},
 203                 {LocalDate.of(2013, 1, 7), MONDAY, 2, 2013},
 204         };
 205     }
 206 
 207     //-----------------------------------------------------------------------
 208     // WEEK_OF_WEEK_BASED_YEAR
 209     //-----------------------------------------------------------------------
 210     @Test(dataProvider="week")
 211     public void test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) {
 212         assertEquals(date.getDayOfWeek(), dow);
 213         assertEquals(IsoFields.WEEK_OF_WEEK_BASED_YEAR.getFrom(date), week);
 214         assertEquals(date.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR), week);
 215     }
 216 
 217     //-----------------------------------------------------------------------
 218     // WEEK_BASED_YEAR
 219     //-----------------------------------------------------------------------
 220     @Test(dataProvider="week")
 221     public void test_WBY(LocalDate date, DayOfWeek dow, int week, int wby) {
 222         assertEquals(date.getDayOfWeek(), dow);
 223         assertEquals(IsoFields.WEEK_BASED_YEAR.getFrom(date), wby);
 224         assertEquals(date.get(IsoFields.WEEK_BASED_YEAR), wby);
 225     }
 226 
 227     //-----------------------------------------------------------------------
 228     // parse weeks
 229     //-----------------------------------------------------------------------
 230     @Test(dataProvider="week")
 231     public void test_parse_weeks(LocalDate date, DayOfWeek dow, int week, int wby) {
 232         DateTimeFormatter f = new DateTimeFormatterBuilder()
 233                 .appendValue(IsoFields.WEEK_BASED_YEAR).appendLiteral('-')
 234                 .appendValue(IsoFields.WEEK_OF_WEEK_BASED_YEAR).appendLiteral('-')
 235                 .appendValue(DAY_OF_WEEK).toFormatter();
 236         LocalDate parsed = LocalDate.parse(wby + "-" + week + "-" + dow.getValue(), f);
 237         assertEquals(parsed, date);
 238     }
 239 
 240     //-----------------------------------------------------------------------
 241     public void test_loop() {
 242         // loop round at least one 400 year cycle, including before 1970
 243         LocalDate date = LocalDate.of(1960, 1, 5);  // Tuseday of week 1 1960
 244         int year = 1960;
 245         int wby = 1960;
 246         int weekLen = 52;
 247         int week = 1;
 248         while (date.getYear() < 2400) {
 249             DayOfWeek loopDow = date.getDayOfWeek();
 250             if (date.getYear() != year) {
 251                 year = date.getYear();
 252             }
 253             if (loopDow == MONDAY) {
 254                 week++;
 255                 if ((week == 53 && weekLen == 52) || week == 54) {
 256                     week = 1;
 257                     LocalDate firstDayOfWeekBasedYear = date.plusDays(14).withDayOfYear(1);
 258                     DayOfWeek firstDay = firstDayOfWeekBasedYear.getDayOfWeek();
 259                     weekLen = (firstDay == THURSDAY || (firstDay == WEDNESDAY && firstDayOfWeekBasedYear.isLeapYear()) ? 53 : 52);
 260                     wby++;
 261                 }
 262             }
 263             assertEquals(IsoFields.WEEK_OF_WEEK_BASED_YEAR.rangeRefinedBy(date), ValueRange.of(1, weekLen), "Failed on " + date + " " + date.getDayOfWeek());
 264             assertEquals(IsoFields.WEEK_OF_WEEK_BASED_YEAR.getFrom(date), week, "Failed on " + date + " " + date.getDayOfWeek());
 265             assertEquals(date.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR), week, "Failed on " + date + " " + date.getDayOfWeek());
 266             assertEquals(IsoFields.WEEK_BASED_YEAR.getFrom(date), wby, "Failed on " + date + " " + date.getDayOfWeek());
 267             assertEquals(date.get(IsoFields.WEEK_BASED_YEAR), wby, "Failed on " + date + " " + date.getDayOfWeek());
 268             date = date.plusDays(1);
 269         }
 270     }
 271 
 272     // TODO: more tests
 273 }