Java Code Examples for java.time.temporal.WeekFields#ISO

The following examples show how to use java.time.temporal.WeekFields#ISO . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TCKWeekFields.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="IsoWeekData")
public void test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) {
    WeekFields weekDef = WeekFields.ISO;
    TemporalField dowField = weekDef.dayOfWeek();
    TemporalField wowbyField = weekDef.weekOfWeekBasedYear();
    TemporalField yowbyField = weekDef.weekBasedYear();

    assertEquals(date.get(dowField), dow.getValue());
    assertEquals(date.get(wowbyField), week);
    assertEquals(date.get(yowbyField), wby);
}
 
Example 2
Source File: TCKWeekFields.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void test_equals() {
    WeekFields weekDef_iso = WeekFields.ISO;
    WeekFields weekDef_sundayStart = WeekFields.SUNDAY_START;

    assertTrue(weekDef_iso.equals(WeekFields.of(DayOfWeek.MONDAY, 4)));
    assertTrue(weekDef_sundayStart.equals(WeekFields.of(DayOfWeek.SUNDAY, 1)));
    assertEquals(weekDef_iso.hashCode(), WeekFields.of(DayOfWeek.MONDAY, 4).hashCode());
    assertEquals(weekDef_sundayStart.hashCode(), WeekFields.of(DayOfWeek.SUNDAY, 1).hashCode());

    assertFalse(weekDef_iso.equals(weekDef_sundayStart));
    assertNotEquals(weekDef_iso.hashCode(), weekDef_sundayStart.hashCode());
}
 
Example 3
Source File: TCKWeekFields.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="IsoWeekData")
public void test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) {
    WeekFields weekDef = WeekFields.ISO;
    TemporalField dowField = weekDef.dayOfWeek();
    TemporalField wowbyField = weekDef.weekOfWeekBasedYear();
    TemporalField yowbyField = weekDef.weekBasedYear();

    assertEquals(date.get(dowField), dow.getValue());
    assertEquals(date.get(wowbyField), week);
    assertEquals(date.get(yowbyField), wby);
}
 
Example 4
Source File: TCKWeekFields.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="IsoWeekData")
public void test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) {
    WeekFields weekDef = WeekFields.ISO;
    TemporalField dowField = weekDef.dayOfWeek();
    TemporalField wowbyField = weekDef.weekOfWeekBasedYear();
    TemporalField yowbyField = weekDef.weekBasedYear();

    assertEquals(date.get(dowField), dow.getValue());
    assertEquals(date.get(wowbyField), week);
    assertEquals(date.get(yowbyField), wby);
}
 
Example 5
Source File: TCKWeekFields.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="IsoWeekData")
public void test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) {
    WeekFields weekDef = WeekFields.ISO;
    TemporalField dowField = weekDef.dayOfWeek();
    TemporalField wowbyField = weekDef.weekOfWeekBasedYear();
    TemporalField yowbyField = weekDef.weekBasedYear();

    assertEquals(date.get(dowField), dow.getValue());
    assertEquals(date.get(wowbyField), week);
    assertEquals(date.get(yowbyField), wby);
}
 
Example 6
Source File: TCKWeekFields.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void test_equals() {
    WeekFields weekDef_iso = WeekFields.ISO;
    WeekFields weekDef_sundayStart = WeekFields.SUNDAY_START;

    assertTrue(weekDef_iso.equals(WeekFields.of(DayOfWeek.MONDAY, 4)));
    assertTrue(weekDef_sundayStart.equals(WeekFields.of(DayOfWeek.SUNDAY, 1)));
    assertEquals(weekDef_iso.hashCode(), WeekFields.of(DayOfWeek.MONDAY, 4).hashCode());
    assertEquals(weekDef_sundayStart.hashCode(), WeekFields.of(DayOfWeek.SUNDAY, 1).hashCode());

    assertFalse(weekDef_iso.equals(weekDef_sundayStart));
    assertNotEquals(weekDef_iso.hashCode(), weekDef_sundayStart.hashCode());
}
 
Example 7
Source File: TCKWeekFields.java    From j2objc with Apache License 2.0 5 votes vote down vote up
@Test
@UseDataProvider("data_week")
public void test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) {
    WeekFields weekDef = WeekFields.ISO;
    TemporalField dowField = weekDef.dayOfWeek();
    TemporalField wowbyField = weekDef.weekOfWeekBasedYear();
    TemporalField yowbyField = weekDef.weekBasedYear();

    assertEquals(date.get(dowField), dow.getValue());
    assertEquals(date.get(wowbyField), week);
    assertEquals(date.get(yowbyField), wby);
}
 
Example 8
Source File: TCKWeekFields.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="IsoWeekData")
public void test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) {
    WeekFields weekDef = WeekFields.ISO;
    TemporalField dowField = weekDef.dayOfWeek();
    TemporalField wowbyField = weekDef.weekOfWeekBasedYear();
    TemporalField yowbyField = weekDef.weekBasedYear();

    assertEquals(date.get(dowField), dow.getValue());
    assertEquals(date.get(wowbyField), week);
    assertEquals(date.get(yowbyField), wby);
}
 
Example 9
Source File: TCKWeekFields.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="IsoWeekData")
public void test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) {
    WeekFields weekDef = WeekFields.ISO;
    TemporalField dowField = weekDef.dayOfWeek();
    TemporalField wowbyField = weekDef.weekOfWeekBasedYear();
    TemporalField yowbyField = weekDef.weekBasedYear();

    assertEquals(date.get(dowField), dow.getValue());
    assertEquals(date.get(wowbyField), week);
    assertEquals(date.get(yowbyField), wby);
}
 
Example 10
Source File: TCKWeekFields.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void test_equals() {
    WeekFields weekDef_iso = WeekFields.ISO;
    WeekFields weekDef_sundayStart = WeekFields.SUNDAY_START;

    assertTrue(weekDef_iso.equals(WeekFields.of(DayOfWeek.MONDAY, 4)));
    assertTrue(weekDef_sundayStart.equals(WeekFields.of(DayOfWeek.SUNDAY, 1)));
    assertEquals(weekDef_iso.hashCode(), WeekFields.of(DayOfWeek.MONDAY, 4).hashCode());
    assertEquals(weekDef_sundayStart.hashCode(), WeekFields.of(DayOfWeek.SUNDAY, 1).hashCode());

    assertFalse(weekDef_iso.equals(weekDef_sundayStart));
    assertNotEquals(weekDef_iso.hashCode(), weekDef_sundayStart.hashCode());
}
 
Example 11
Source File: TCKWeekFields.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="IsoWeekData")
public void test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) {
    WeekFields weekDef = WeekFields.ISO;
    TemporalField dowField = weekDef.dayOfWeek();
    TemporalField wowbyField = weekDef.weekOfWeekBasedYear();
    TemporalField yowbyField = weekDef.weekBasedYear();

    assertEquals(date.get(dowField), dow.getValue());
    assertEquals(date.get(wowbyField), week);
    assertEquals(date.get(yowbyField), wby);
}
 
Example 12
Source File: TestTimeStampDissector.java    From logparser with Apache License 2.0 5 votes vote down vote up
@Test
public void ensureDefaultLocaleFollowsISOWeekFields() {
    WeekFields localeWeekFields = WeekFields.of(new TimeStampDissector().getLocale());
    WeekFields isoWeekFields    = WeekFields.ISO;
    assertEquals(localeWeekFields.getFirstDayOfWeek(), isoWeekFields.getFirstDayOfWeek());
    assertEquals(localeWeekFields.getMinimalDaysInFirstWeek(), isoWeekFields.getMinimalDaysInFirstWeek());
}
 
Example 13
Source File: TCKWeekFields.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="IsoWeekData")
public void test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) {
    WeekFields weekDef = WeekFields.ISO;
    TemporalField dowField = weekDef.dayOfWeek();
    TemporalField wowbyField = weekDef.weekOfWeekBasedYear();
    TemporalField yowbyField = weekDef.weekBasedYear();

    assertEquals(date.get(dowField), dow.getValue());
    assertEquals(date.get(wowbyField), week);
    assertEquals(date.get(yowbyField), wby);
}
 
Example 14
Source File: TCKWeekFields.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="IsoWeekData")
public void test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) {
    WeekFields weekDef = WeekFields.ISO;
    TemporalField dowField = weekDef.dayOfWeek();
    TemporalField wowbyField = weekDef.weekOfWeekBasedYear();
    TemporalField yowbyField = weekDef.weekBasedYear();

    assertEquals(date.get(dowField), dow.getValue());
    assertEquals(date.get(wowbyField), week);
    assertEquals(date.get(yowbyField), wby);
}
 
Example 15
Source File: TCKWeekFields.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="IsoWeekData")
public void test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) {
    WeekFields weekDef = WeekFields.ISO;
    TemporalField dowField = weekDef.dayOfWeek();
    TemporalField wowbyField = weekDef.weekOfWeekBasedYear();
    TemporalField yowbyField = weekDef.weekBasedYear();

    assertEquals(date.get(dowField), dow.getValue());
    assertEquals(date.get(wowbyField), week);
    assertEquals(date.get(yowbyField), wby);
}
 
Example 16
Source File: TCKWeekFields.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void test_equals() {
    WeekFields weekDef_iso = WeekFields.ISO;
    WeekFields weekDef_sundayStart = WeekFields.SUNDAY_START;

    assertTrue(weekDef_iso.equals(WeekFields.of(DayOfWeek.MONDAY, 4)));
    assertTrue(weekDef_sundayStart.equals(WeekFields.of(DayOfWeek.SUNDAY, 1)));
    assertEquals(weekDef_iso.hashCode(), WeekFields.of(DayOfWeek.MONDAY, 4).hashCode());
    assertEquals(weekDef_sundayStart.hashCode(), WeekFields.of(DayOfWeek.SUNDAY, 1).hashCode());

    assertFalse(weekDef_iso.equals(weekDef_sundayStart));
    assertNotEquals(weekDef_iso.hashCode(), weekDef_sundayStart.hashCode());
}
 
Example 17
Source File: TCKWeekFields.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void test_equals() {
    WeekFields weekDef_iso = WeekFields.ISO;
    WeekFields weekDef_sundayStart = WeekFields.SUNDAY_START;

    assertTrue(weekDef_iso.equals(WeekFields.of(DayOfWeek.MONDAY, 4)));
    assertTrue(weekDef_sundayStart.equals(WeekFields.of(DayOfWeek.SUNDAY, 1)));
    assertEquals(weekDef_iso.hashCode(), WeekFields.of(DayOfWeek.MONDAY, 4).hashCode());
    assertEquals(weekDef_sundayStart.hashCode(), WeekFields.of(DayOfWeek.SUNDAY, 1).hashCode());

    assertFalse(weekDef_iso.equals(weekDef_sundayStart));
    assertNotEquals(weekDef_iso.hashCode(), weekDef_sundayStart.hashCode());
}
 
Example 18
Source File: TCKWeekFields.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void test_equals() {
    WeekFields weekDef_iso = WeekFields.ISO;
    WeekFields weekDef_sundayStart = WeekFields.SUNDAY_START;

    assertTrue(weekDef_iso.equals(WeekFields.of(DayOfWeek.MONDAY, 4)));
    assertTrue(weekDef_sundayStart.equals(WeekFields.of(DayOfWeek.SUNDAY, 1)));
    assertEquals(weekDef_iso.hashCode(), WeekFields.of(DayOfWeek.MONDAY, 4).hashCode());
    assertEquals(weekDef_sundayStart.hashCode(), WeekFields.of(DayOfWeek.SUNDAY, 1).hashCode());

    assertFalse(weekDef_iso.equals(weekDef_sundayStart));
    assertNotEquals(weekDef_iso.hashCode(), weekDef_sundayStart.hashCode());
}
 
Example 19
Source File: TCKWeekFields.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="IsoWeekData")
public void test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) {
    WeekFields weekDef = WeekFields.ISO;
    TemporalField dowField = weekDef.dayOfWeek();
    TemporalField wowbyField = weekDef.weekOfWeekBasedYear();
    TemporalField yowbyField = weekDef.weekBasedYear();

    assertEquals(date.get(dowField), dow.getValue());
    assertEquals(date.get(wowbyField), week);
    assertEquals(date.get(yowbyField), wby);
}
 
Example 20
Source File: TCKWeekFields.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void test_equals() {
    WeekFields weekDef_iso = WeekFields.ISO;
    WeekFields weekDef_sundayStart = WeekFields.SUNDAY_START;

    assertTrue(weekDef_iso.equals(WeekFields.of(DayOfWeek.MONDAY, 4)));
    assertTrue(weekDef_sundayStart.equals(WeekFields.of(DayOfWeek.SUNDAY, 1)));
    assertEquals(weekDef_iso.hashCode(), WeekFields.of(DayOfWeek.MONDAY, 4).hashCode());
    assertEquals(weekDef_sundayStart.hashCode(), WeekFields.of(DayOfWeek.SUNDAY, 1).hashCode());

    assertFalse(weekDef_iso.equals(weekDef_sundayStart));
    assertNotEquals(weekDef_iso.hashCode(), weekDef_sundayStart.hashCode());
}