Java Code Examples for java.time.temporal.ChronoField#YEAR

The following examples show how to use java.time.temporal.ChronoField#YEAR . 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: CronAdjuster.java    From smarthome with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * A cron part consists of a number of sub expressions separated by a comma.
 * The sub expressions are parsed and combined. If this is a pattern that sets the time
 * a new {@link Field} object is created and added to the fields list.
 *
 * @param cronExpression The cronExpresion itself
 * @param part the part to be parsed
 * @param chronoField the chronoField is part belongs to
 * @param names a map with chronoField names that can be part of the pattern and are mapped to numbers
 */
private void parse(String cronExpression, String part, ChronoField chronoField, Map<String, Integer> names) {
    // Check wild card.
    if ("*".equals(part) || "?".equals(part)) {
        return; // No field needed all values accepted
    }

    final List<Checker> checkers = new ArrayList<>();
    // Parse each sub expression
    final String[] split = part.split(",");
    for (String sub : split) {
        checkers.add(parseSub(cronExpression, chronoField, sub, names));
    }

    // If this is the year check, we create a conjunction with a check for the maximum year
    if (chronoField == ChronoField.YEAR) {
        checkers.add(CronAdjuster::checkMaxYear);
    }
    fields.add(new Field(chronoField, or(checkers)));
}
 
Example 2
Source File: TestChronoField.java    From j2objc with Apache License 2.0 5 votes vote down vote up
Object[][] data_localeDisplayNames() {
    return new Object[][] {
            {ChronoField.ERA},
            {ChronoField.YEAR},
            {ChronoField.MONTH_OF_YEAR},
            {ChronoField.DAY_OF_WEEK},
            // {ChronoField.ALIGNED_WEEK_OF_YEAR},
            {ChronoField.DAY_OF_MONTH},
            {ChronoField.AMPM_OF_DAY},
            {ChronoField.HOUR_OF_DAY},
            {ChronoField.MINUTE_OF_HOUR},
            {ChronoField.SECOND_OF_MINUTE},
    };
}
 
Example 3
Source File: TestChronoField.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "localeDisplayNames")
Object[][] data_localeDisplayNames() {
    return new Object[][] {
            {ChronoField.ERA},
            {ChronoField.YEAR},
            {ChronoField.MONTH_OF_YEAR},
            {ChronoField.DAY_OF_WEEK},
            // {ChronoField.ALIGNED_WEEK_OF_YEAR},
            {ChronoField.DAY_OF_MONTH},
            {ChronoField.AMPM_OF_DAY},
            {ChronoField.HOUR_OF_DAY},
            {ChronoField.MINUTE_OF_HOUR},
            {ChronoField.SECOND_OF_MINUTE},
    };
}
 
Example 4
Source File: TestChronoField.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "localeDisplayNames")
Object[][] data_localeDisplayNames() {
    return new Object[][] {
            {ChronoField.ERA},
            {ChronoField.YEAR},
            {ChronoField.MONTH_OF_YEAR},
            {ChronoField.DAY_OF_WEEK},
            // {ChronoField.ALIGNED_WEEK_OF_YEAR},
            {ChronoField.DAY_OF_MONTH},
            {ChronoField.AMPM_OF_DAY},
            {ChronoField.HOUR_OF_DAY},
            {ChronoField.MINUTE_OF_HOUR},
            {ChronoField.SECOND_OF_MINUTE},
    };
}
 
Example 5
Source File: TestChronoField.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "localeDisplayNames")
Object[][] data_localeDisplayNames() {
    return new Object[][] {
            {ChronoField.ERA},
            {ChronoField.YEAR},
            {ChronoField.MONTH_OF_YEAR},
            {ChronoField.DAY_OF_WEEK},
            // {ChronoField.ALIGNED_WEEK_OF_YEAR},
            {ChronoField.DAY_OF_MONTH},
            {ChronoField.AMPM_OF_DAY},
            {ChronoField.HOUR_OF_DAY},
            {ChronoField.MINUTE_OF_HOUR},
            {ChronoField.SECOND_OF_MINUTE},
    };
}
 
Example 6
Source File: TCKMinguoChronology.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "resolve_yearOfEra")
Object[][] data_resolve_yearOfEra() {
    return new Object[][] {
            // era only
            {ResolverStyle.STRICT, -1, null, null, null, null},
            {ResolverStyle.SMART, -1, null, null, null, null},
            {ResolverStyle.LENIENT, -1, null, null, null, null},

            {ResolverStyle.STRICT, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.SMART, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.LENIENT, 0, null, null, ChronoField.ERA, 0},

            {ResolverStyle.STRICT, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.SMART, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.LENIENT, 1, null, null, ChronoField.ERA, 1},

            {ResolverStyle.STRICT, 2, null, null, null, null},
            {ResolverStyle.SMART, 2, null, null, null, null},
            {ResolverStyle.LENIENT, 2, null, null, null, null},

            // era and year-of-era
            {ResolverStyle.STRICT, -1, 2012, null, null, null},
            {ResolverStyle.SMART, -1, 2012, null, null, null},
            {ResolverStyle.LENIENT, -1, 2012, null, null, null},

            {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, 2, 2012, null, null, null},
            {ResolverStyle.SMART, 2, 2012, null, null, null},
            {ResolverStyle.LENIENT, 2, 2012, null, null, null},

            // year-of-era only
            {ResolverStyle.STRICT, null, 2012, null, ChronoField.YEAR_OF_ERA, 2012},
            {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.SMART, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE},

            // year-of-era and year
            {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, 2012, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, null, 2012, -2011, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, null, 2012, 2013, null, null},
            {ResolverStyle.SMART, null, 2012, 2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, 2013, null, null},

            {ResolverStyle.STRICT, null, 2012, -2013, null, null},
            {ResolverStyle.SMART, null, 2012, -2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, -2013, null, null},
    };
}
 
Example 7
Source File: TCKThaiBuddhistChronology.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "resolve_yearOfEra")
Object[][] data_resolve_yearOfEra() {
    return new Object[][] {
            // era only
            {ResolverStyle.STRICT, -1, null, null, null, null},
            {ResolverStyle.SMART, -1, null, null, null, null},
            {ResolverStyle.LENIENT, -1, null, null, null, null},

            {ResolverStyle.STRICT, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.SMART, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.LENIENT, 0, null, null, ChronoField.ERA, 0},

            {ResolverStyle.STRICT, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.SMART, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.LENIENT, 1, null, null, ChronoField.ERA, 1},

            {ResolverStyle.STRICT, 2, null, null, null, null},
            {ResolverStyle.SMART, 2, null, null, null, null},
            {ResolverStyle.LENIENT, 2, null, null, null, null},

            // era and year-of-era
            {ResolverStyle.STRICT, -1, 2012, null, null, null},
            {ResolverStyle.SMART, -1, 2012, null, null, null},
            {ResolverStyle.LENIENT, -1, 2012, null, null, null},

            {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, 2, 2012, null, null, null},
            {ResolverStyle.SMART, 2, 2012, null, null, null},
            {ResolverStyle.LENIENT, 2, 2012, null, null, null},

            // year-of-era only
            {ResolverStyle.STRICT, null, 2012, null, ChronoField.YEAR_OF_ERA, 2012},
            {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.SMART, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE},

            // year-of-era and year
            {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, 2012, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, null, 2012, -2011, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, null, 2012, 2013, null, null},
            {ResolverStyle.SMART, null, 2012, 2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, 2013, null, null},

            {ResolverStyle.STRICT, null, 2012, -2013, null, null},
            {ResolverStyle.SMART, null, 2012, -2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, -2013, null, null},
    };
}
 
Example 8
Source File: TCKIsoChronology.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "resolve_yearOfEra")
Object[][] data_resolve_yearOfEra() {
    return new Object[][] {
            // era only
            {ResolverStyle.STRICT, -1, null, null, null, null},
            {ResolverStyle.SMART, -1, null, null, null, null},
            {ResolverStyle.LENIENT, -1, null, null, null, null},

            {ResolverStyle.STRICT, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.SMART, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.LENIENT, 0, null, null, ChronoField.ERA, 0},

            {ResolverStyle.STRICT, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.SMART, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.LENIENT, 1, null, null, ChronoField.ERA, 1},

            {ResolverStyle.STRICT, 2, null, null, null, null},
            {ResolverStyle.SMART, 2, null, null, null, null},
            {ResolverStyle.LENIENT, 2, null, null, null, null},

            // era and year-of-era
            {ResolverStyle.STRICT, -1, 2012, null, null, null},
            {ResolverStyle.SMART, -1, 2012, null, null, null},
            {ResolverStyle.LENIENT, -1, 2012, null, null, null},

            {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, 2, 2012, null, null, null},
            {ResolverStyle.SMART, 2, 2012, null, null, null},
            {ResolverStyle.LENIENT, 2, 2012, null, null, null},

            // year-of-era only
            {ResolverStyle.STRICT, null, 2012, null, ChronoField.YEAR_OF_ERA, 2012},
            {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.SMART, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE},

            // year-of-era and year
            {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, 2012, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, null, 2012, -2011, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, null, 2012, 2013, null, null},
            {ResolverStyle.SMART, null, 2012, 2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, 2013, null, null},

            {ResolverStyle.STRICT, null, 2012, -2013, null, null},
            {ResolverStyle.SMART, null, 2012, -2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, -2013, null, null},
    };
}
 
Example 9
Source File: TCKMinguoChronology.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "resolve_yearOfEra")
Object[][] data_resolve_yearOfEra() {
    return new Object[][] {
            // era only
            {ResolverStyle.STRICT, -1, null, null, null, null},
            {ResolverStyle.SMART, -1, null, null, null, null},
            {ResolverStyle.LENIENT, -1, null, null, null, null},

            {ResolverStyle.STRICT, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.SMART, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.LENIENT, 0, null, null, ChronoField.ERA, 0},

            {ResolverStyle.STRICT, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.SMART, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.LENIENT, 1, null, null, ChronoField.ERA, 1},

            {ResolverStyle.STRICT, 2, null, null, null, null},
            {ResolverStyle.SMART, 2, null, null, null, null},
            {ResolverStyle.LENIENT, 2, null, null, null, null},

            // era and year-of-era
            {ResolverStyle.STRICT, -1, 2012, null, null, null},
            {ResolverStyle.SMART, -1, 2012, null, null, null},
            {ResolverStyle.LENIENT, -1, 2012, null, null, null},

            {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, 2, 2012, null, null, null},
            {ResolverStyle.SMART, 2, 2012, null, null, null},
            {ResolverStyle.LENIENT, 2, 2012, null, null, null},

            // year-of-era only
            {ResolverStyle.STRICT, null, 2012, null, ChronoField.YEAR_OF_ERA, 2012},
            {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.SMART, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE},

            // year-of-era and year
            {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, 2012, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, null, 2012, -2011, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, null, 2012, 2013, null, null},
            {ResolverStyle.SMART, null, 2012, 2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, 2013, null, null},

            {ResolverStyle.STRICT, null, 2012, -2013, null, null},
            {ResolverStyle.SMART, null, 2012, -2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, -2013, null, null},
    };
}
 
Example 10
Source File: TCKThaiBuddhistChronology.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "resolve_yearOfEra")
Object[][] data_resolve_yearOfEra() {
    return new Object[][] {
            // era only
            {ResolverStyle.STRICT, -1, null, null, null, null},
            {ResolverStyle.SMART, -1, null, null, null, null},
            {ResolverStyle.LENIENT, -1, null, null, null, null},

            {ResolverStyle.STRICT, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.SMART, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.LENIENT, 0, null, null, ChronoField.ERA, 0},

            {ResolverStyle.STRICT, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.SMART, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.LENIENT, 1, null, null, ChronoField.ERA, 1},

            {ResolverStyle.STRICT, 2, null, null, null, null},
            {ResolverStyle.SMART, 2, null, null, null, null},
            {ResolverStyle.LENIENT, 2, null, null, null, null},

            // era and year-of-era
            {ResolverStyle.STRICT, -1, 2012, null, null, null},
            {ResolverStyle.SMART, -1, 2012, null, null, null},
            {ResolverStyle.LENIENT, -1, 2012, null, null, null},

            {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, 2, 2012, null, null, null},
            {ResolverStyle.SMART, 2, 2012, null, null, null},
            {ResolverStyle.LENIENT, 2, 2012, null, null, null},

            // year-of-era only
            {ResolverStyle.STRICT, null, 2012, null, ChronoField.YEAR_OF_ERA, 2012},
            {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.SMART, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE},

            // year-of-era and year
            {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, 2012, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, null, 2012, -2011, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, null, 2012, 2013, null, null},
            {ResolverStyle.SMART, null, 2012, 2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, 2013, null, null},

            {ResolverStyle.STRICT, null, 2012, -2013, null, null},
            {ResolverStyle.SMART, null, 2012, -2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, -2013, null, null},
    };
}
 
Example 11
Source File: TCKIsoChronology.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "resolve_yearOfEra")
Object[][] data_resolve_yearOfEra() {
    return new Object[][] {
            // era only
            {ResolverStyle.STRICT, -1, null, null, null, null},
            {ResolverStyle.SMART, -1, null, null, null, null},
            {ResolverStyle.LENIENT, -1, null, null, null, null},

            {ResolverStyle.STRICT, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.SMART, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.LENIENT, 0, null, null, ChronoField.ERA, 0},

            {ResolverStyle.STRICT, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.SMART, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.LENIENT, 1, null, null, ChronoField.ERA, 1},

            {ResolverStyle.STRICT, 2, null, null, null, null},
            {ResolverStyle.SMART, 2, null, null, null, null},
            {ResolverStyle.LENIENT, 2, null, null, null, null},

            // era and year-of-era
            {ResolverStyle.STRICT, -1, 2012, null, null, null},
            {ResolverStyle.SMART, -1, 2012, null, null, null},
            {ResolverStyle.LENIENT, -1, 2012, null, null, null},

            {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, 2, 2012, null, null, null},
            {ResolverStyle.SMART, 2, 2012, null, null, null},
            {ResolverStyle.LENIENT, 2, 2012, null, null, null},

            // year-of-era only
            {ResolverStyle.STRICT, null, 2012, null, ChronoField.YEAR_OF_ERA, 2012},
            {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.SMART, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE},

            // year-of-era and year
            {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, 2012, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, null, 2012, -2011, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, null, 2012, 2013, null, null},
            {ResolverStyle.SMART, null, 2012, 2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, 2013, null, null},

            {ResolverStyle.STRICT, null, 2012, -2013, null, null},
            {ResolverStyle.SMART, null, 2012, -2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, -2013, null, null},
    };
}
 
Example 12
Source File: TCKMinguoChronology.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "resolve_yearOfEra")
Object[][] data_resolve_yearOfEra() {
    return new Object[][] {
            // era only
            {ResolverStyle.STRICT, -1, null, null, null, null},
            {ResolverStyle.SMART, -1, null, null, null, null},
            {ResolverStyle.LENIENT, -1, null, null, null, null},

            {ResolverStyle.STRICT, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.SMART, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.LENIENT, 0, null, null, ChronoField.ERA, 0},

            {ResolverStyle.STRICT, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.SMART, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.LENIENT, 1, null, null, ChronoField.ERA, 1},

            {ResolverStyle.STRICT, 2, null, null, null, null},
            {ResolverStyle.SMART, 2, null, null, null, null},
            {ResolverStyle.LENIENT, 2, null, null, null, null},

            // era and year-of-era
            {ResolverStyle.STRICT, -1, 2012, null, null, null},
            {ResolverStyle.SMART, -1, 2012, null, null, null},
            {ResolverStyle.LENIENT, -1, 2012, null, null, null},

            {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, 2, 2012, null, null, null},
            {ResolverStyle.SMART, 2, 2012, null, null, null},
            {ResolverStyle.LENIENT, 2, 2012, null, null, null},

            // year-of-era only
            {ResolverStyle.STRICT, null, 2012, null, ChronoField.YEAR_OF_ERA, 2012},
            {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.SMART, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE},

            // year-of-era and year
            {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, 2012, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, null, 2012, -2011, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, null, 2012, 2013, null, null},
            {ResolverStyle.SMART, null, 2012, 2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, 2013, null, null},

            {ResolverStyle.STRICT, null, 2012, -2013, null, null},
            {ResolverStyle.SMART, null, 2012, -2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, -2013, null, null},
    };
}
 
Example 13
Source File: TCKThaiBuddhistChronology.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "resolve_yearOfEra")
Object[][] data_resolve_yearOfEra() {
    return new Object[][] {
            // era only
            {ResolverStyle.STRICT, -1, null, null, null, null},
            {ResolverStyle.SMART, -1, null, null, null, null},
            {ResolverStyle.LENIENT, -1, null, null, null, null},

            {ResolverStyle.STRICT, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.SMART, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.LENIENT, 0, null, null, ChronoField.ERA, 0},

            {ResolverStyle.STRICT, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.SMART, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.LENIENT, 1, null, null, ChronoField.ERA, 1},

            {ResolverStyle.STRICT, 2, null, null, null, null},
            {ResolverStyle.SMART, 2, null, null, null, null},
            {ResolverStyle.LENIENT, 2, null, null, null, null},

            // era and year-of-era
            {ResolverStyle.STRICT, -1, 2012, null, null, null},
            {ResolverStyle.SMART, -1, 2012, null, null, null},
            {ResolverStyle.LENIENT, -1, 2012, null, null, null},

            {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, 2, 2012, null, null, null},
            {ResolverStyle.SMART, 2, 2012, null, null, null},
            {ResolverStyle.LENIENT, 2, 2012, null, null, null},

            // year-of-era only
            {ResolverStyle.STRICT, null, 2012, null, ChronoField.YEAR_OF_ERA, 2012},
            {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.SMART, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE},

            // year-of-era and year
            {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, 2012, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, null, 2012, -2011, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, null, 2012, 2013, null, null},
            {ResolverStyle.SMART, null, 2012, 2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, 2013, null, null},

            {ResolverStyle.STRICT, null, 2012, -2013, null, null},
            {ResolverStyle.SMART, null, 2012, -2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, -2013, null, null},
    };
}
 
Example 14
Source File: TCKMinguoChronology.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "resolve_yearOfEra")
Object[][] data_resolve_yearOfEra() {
    return new Object[][] {
            // era only
            {ResolverStyle.STRICT, -1, null, null, null, null},
            {ResolverStyle.SMART, -1, null, null, null, null},
            {ResolverStyle.LENIENT, -1, null, null, null, null},

            {ResolverStyle.STRICT, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.SMART, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.LENIENT, 0, null, null, ChronoField.ERA, 0},

            {ResolverStyle.STRICT, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.SMART, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.LENIENT, 1, null, null, ChronoField.ERA, 1},

            {ResolverStyle.STRICT, 2, null, null, null, null},
            {ResolverStyle.SMART, 2, null, null, null, null},
            {ResolverStyle.LENIENT, 2, null, null, null, null},

            // era and year-of-era
            {ResolverStyle.STRICT, -1, 2012, null, null, null},
            {ResolverStyle.SMART, -1, 2012, null, null, null},
            {ResolverStyle.LENIENT, -1, 2012, null, null, null},

            {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, 2, 2012, null, null, null},
            {ResolverStyle.SMART, 2, 2012, null, null, null},
            {ResolverStyle.LENIENT, 2, 2012, null, null, null},

            // year-of-era only
            {ResolverStyle.STRICT, null, 2012, null, ChronoField.YEAR_OF_ERA, 2012},
            {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.SMART, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE},

            // year-of-era and year
            {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, 2012, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, null, 2012, -2011, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, null, 2012, 2013, null, null},
            {ResolverStyle.SMART, null, 2012, 2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, 2013, null, null},

            {ResolverStyle.STRICT, null, 2012, -2013, null, null},
            {ResolverStyle.SMART, null, 2012, -2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, -2013, null, null},
    };
}
 
Example 15
Source File: TCKMinguoChronology.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "resolve_yearOfEra")
Object[][] data_resolve_yearOfEra() {
    return new Object[][] {
            // era only
            {ResolverStyle.STRICT, -1, null, null, null, null},
            {ResolverStyle.SMART, -1, null, null, null, null},
            {ResolverStyle.LENIENT, -1, null, null, null, null},

            {ResolverStyle.STRICT, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.SMART, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.LENIENT, 0, null, null, ChronoField.ERA, 0},

            {ResolverStyle.STRICT, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.SMART, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.LENIENT, 1, null, null, ChronoField.ERA, 1},

            {ResolverStyle.STRICT, 2, null, null, null, null},
            {ResolverStyle.SMART, 2, null, null, null, null},
            {ResolverStyle.LENIENT, 2, null, null, null, null},

            // era and year-of-era
            {ResolverStyle.STRICT, -1, 2012, null, null, null},
            {ResolverStyle.SMART, -1, 2012, null, null, null},
            {ResolverStyle.LENIENT, -1, 2012, null, null, null},

            {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, 2, 2012, null, null, null},
            {ResolverStyle.SMART, 2, 2012, null, null, null},
            {ResolverStyle.LENIENT, 2, 2012, null, null, null},

            // year-of-era only
            {ResolverStyle.STRICT, null, 2012, null, ChronoField.YEAR_OF_ERA, 2012},
            {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.SMART, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE},

            // year-of-era and year
            {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, 2012, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, null, 2012, -2011, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, null, 2012, 2013, null, null},
            {ResolverStyle.SMART, null, 2012, 2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, 2013, null, null},

            {ResolverStyle.STRICT, null, 2012, -2013, null, null},
            {ResolverStyle.SMART, null, 2012, -2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, -2013, null, null},
    };
}
 
Example 16
Source File: TCKThaiBuddhistChronology.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "resolve_yearOfEra")
Object[][] data_resolve_yearOfEra() {
    return new Object[][] {
            // era only
            {ResolverStyle.STRICT, -1, null, null, null, null},
            {ResolverStyle.SMART, -1, null, null, null, null},
            {ResolverStyle.LENIENT, -1, null, null, null, null},

            {ResolverStyle.STRICT, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.SMART, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.LENIENT, 0, null, null, ChronoField.ERA, 0},

            {ResolverStyle.STRICT, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.SMART, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.LENIENT, 1, null, null, ChronoField.ERA, 1},

            {ResolverStyle.STRICT, 2, null, null, null, null},
            {ResolverStyle.SMART, 2, null, null, null, null},
            {ResolverStyle.LENIENT, 2, null, null, null, null},

            // era and year-of-era
            {ResolverStyle.STRICT, -1, 2012, null, null, null},
            {ResolverStyle.SMART, -1, 2012, null, null, null},
            {ResolverStyle.LENIENT, -1, 2012, null, null, null},

            {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, 2, 2012, null, null, null},
            {ResolverStyle.SMART, 2, 2012, null, null, null},
            {ResolverStyle.LENIENT, 2, 2012, null, null, null},

            // year-of-era only
            {ResolverStyle.STRICT, null, 2012, null, ChronoField.YEAR_OF_ERA, 2012},
            {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.SMART, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE},

            // year-of-era and year
            {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, 2012, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, null, 2012, -2011, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, null, 2012, 2013, null, null},
            {ResolverStyle.SMART, null, 2012, 2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, 2013, null, null},

            {ResolverStyle.STRICT, null, 2012, -2013, null, null},
            {ResolverStyle.SMART, null, 2012, -2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, -2013, null, null},
    };
}
 
Example 17
Source File: TCKIsoChronology.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "resolve_yearOfEra")
Object[][] data_resolve_yearOfEra() {
    return new Object[][] {
            // era only
            {ResolverStyle.STRICT, -1, null, null, null, null},
            {ResolverStyle.SMART, -1, null, null, null, null},
            {ResolverStyle.LENIENT, -1, null, null, null, null},

            {ResolverStyle.STRICT, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.SMART, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.LENIENT, 0, null, null, ChronoField.ERA, 0},

            {ResolverStyle.STRICT, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.SMART, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.LENIENT, 1, null, null, ChronoField.ERA, 1},

            {ResolverStyle.STRICT, 2, null, null, null, null},
            {ResolverStyle.SMART, 2, null, null, null, null},
            {ResolverStyle.LENIENT, 2, null, null, null, null},

            // era and year-of-era
            {ResolverStyle.STRICT, -1, 2012, null, null, null},
            {ResolverStyle.SMART, -1, 2012, null, null, null},
            {ResolverStyle.LENIENT, -1, 2012, null, null, null},

            {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, 2, 2012, null, null, null},
            {ResolverStyle.SMART, 2, 2012, null, null, null},
            {ResolverStyle.LENIENT, 2, 2012, null, null, null},

            // year-of-era only
            {ResolverStyle.STRICT, null, 2012, null, ChronoField.YEAR_OF_ERA, 2012},
            {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.SMART, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE},

            // year-of-era and year
            {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, 2012, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, null, 2012, -2011, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, null, 2012, 2013, null, null},
            {ResolverStyle.SMART, null, 2012, 2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, 2013, null, null},

            {ResolverStyle.STRICT, null, 2012, -2013, null, null},
            {ResolverStyle.SMART, null, 2012, -2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, -2013, null, null},
    };
}
 
Example 18
Source File: TCKMinguoChronology.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "resolve_yearOfEra")
Object[][] data_resolve_yearOfEra() {
    return new Object[][] {
            // era only
            {ResolverStyle.STRICT, -1, null, null, null, null},
            {ResolverStyle.SMART, -1, null, null, null, null},
            {ResolverStyle.LENIENT, -1, null, null, null, null},

            {ResolverStyle.STRICT, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.SMART, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.LENIENT, 0, null, null, ChronoField.ERA, 0},

            {ResolverStyle.STRICT, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.SMART, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.LENIENT, 1, null, null, ChronoField.ERA, 1},

            {ResolverStyle.STRICT, 2, null, null, null, null},
            {ResolverStyle.SMART, 2, null, null, null, null},
            {ResolverStyle.LENIENT, 2, null, null, null, null},

            // era and year-of-era
            {ResolverStyle.STRICT, -1, 2012, null, null, null},
            {ResolverStyle.SMART, -1, 2012, null, null, null},
            {ResolverStyle.LENIENT, -1, 2012, null, null, null},

            {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, 2, 2012, null, null, null},
            {ResolverStyle.SMART, 2, 2012, null, null, null},
            {ResolverStyle.LENIENT, 2, 2012, null, null, null},

            // year-of-era only
            {ResolverStyle.STRICT, null, 2012, null, ChronoField.YEAR_OF_ERA, 2012},
            {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.SMART, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE},

            // year-of-era and year
            {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, 2012, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, null, 2012, -2011, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, null, 2012, 2013, null, null},
            {ResolverStyle.SMART, null, 2012, 2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, 2013, null, null},

            {ResolverStyle.STRICT, null, 2012, -2013, null, null},
            {ResolverStyle.SMART, null, 2012, -2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, -2013, null, null},
    };
}
 
Example 19
Source File: TCKIsoChronology.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "resolve_yearOfEra")
Object[][] data_resolve_yearOfEra() {
    return new Object[][] {
            // era only
            {ResolverStyle.STRICT, -1, null, null, null, null},
            {ResolverStyle.SMART, -1, null, null, null, null},
            {ResolverStyle.LENIENT, -1, null, null, null, null},

            {ResolverStyle.STRICT, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.SMART, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.LENIENT, 0, null, null, ChronoField.ERA, 0},

            {ResolverStyle.STRICT, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.SMART, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.LENIENT, 1, null, null, ChronoField.ERA, 1},

            {ResolverStyle.STRICT, 2, null, null, null, null},
            {ResolverStyle.SMART, 2, null, null, null, null},
            {ResolverStyle.LENIENT, 2, null, null, null, null},

            // era and year-of-era
            {ResolverStyle.STRICT, -1, 2012, null, null, null},
            {ResolverStyle.SMART, -1, 2012, null, null, null},
            {ResolverStyle.LENIENT, -1, 2012, null, null, null},

            {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, 2, 2012, null, null, null},
            {ResolverStyle.SMART, 2, 2012, null, null, null},
            {ResolverStyle.LENIENT, 2, 2012, null, null, null},

            // year-of-era only
            {ResolverStyle.STRICT, null, 2012, null, ChronoField.YEAR_OF_ERA, 2012},
            {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.SMART, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE},

            // year-of-era and year
            {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, 2012, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, null, 2012, -2011, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, null, 2012, 2013, null, null},
            {ResolverStyle.SMART, null, 2012, 2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, 2013, null, null},

            {ResolverStyle.STRICT, null, 2012, -2013, null, null},
            {ResolverStyle.SMART, null, 2012, -2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, -2013, null, null},
    };
}
 
Example 20
Source File: TCKThaiBuddhistChronology.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name = "resolve_yearOfEra")
Object[][] data_resolve_yearOfEra() {
    return new Object[][] {
            // era only
            {ResolverStyle.STRICT, -1, null, null, null, null},
            {ResolverStyle.SMART, -1, null, null, null, null},
            {ResolverStyle.LENIENT, -1, null, null, null, null},

            {ResolverStyle.STRICT, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.SMART, 0, null, null, ChronoField.ERA, 0},
            {ResolverStyle.LENIENT, 0, null, null, ChronoField.ERA, 0},

            {ResolverStyle.STRICT, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.SMART, 1, null, null, ChronoField.ERA, 1},
            {ResolverStyle.LENIENT, 1, null, null, ChronoField.ERA, 1},

            {ResolverStyle.STRICT, 2, null, null, null, null},
            {ResolverStyle.SMART, 2, null, null, null, null},
            {ResolverStyle.LENIENT, 2, null, null, null, null},

            // era and year-of-era
            {ResolverStyle.STRICT, -1, 2012, null, null, null},
            {ResolverStyle.SMART, -1, 2012, null, null, null},
            {ResolverStyle.LENIENT, -1, 2012, null, null, null},

            {ResolverStyle.STRICT, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, 0, 2012, null, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, 0, 2012, null, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, 1, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, 1, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, 2, 2012, null, null, null},
            {ResolverStyle.SMART, 2, 2012, null, null, null},
            {ResolverStyle.LENIENT, 2, 2012, null, null, null},

            // year-of-era only
            {ResolverStyle.STRICT, null, 2012, null, ChronoField.YEAR_OF_ERA, 2012},
            {ResolverStyle.SMART, null, 2012, null, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, null, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.SMART, null, Integer.MAX_VALUE, null, null, null},
            {ResolverStyle.LENIENT, null, Integer.MAX_VALUE, null, ChronoField.YEAR, Integer.MAX_VALUE},

            // year-of-era and year
            {ResolverStyle.STRICT, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.SMART, null, 2012, 2012, ChronoField.YEAR, 2012},
            {ResolverStyle.LENIENT, null, 2012, 2012, ChronoField.YEAR, 2012},

            {ResolverStyle.STRICT, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.SMART, null, 2012, -2011, ChronoField.YEAR, -2011},
            {ResolverStyle.LENIENT, null, 2012, -2011, ChronoField.YEAR, -2011},

            {ResolverStyle.STRICT, null, 2012, 2013, null, null},
            {ResolverStyle.SMART, null, 2012, 2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, 2013, null, null},

            {ResolverStyle.STRICT, null, 2012, -2013, null, null},
            {ResolverStyle.SMART, null, 2012, -2013, null, null},
            {ResolverStyle.LENIENT, null, 2012, -2013, null, null},
    };
}