org.testng.annotations.DataProvider Java Examples

The following examples show how to use org.testng.annotations.DataProvider. 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: TestChronoUnit.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name = "weeksBetween")
Object[][] data_weeksBetween() {
    return new Object[][] {
        {date(2012, JULY, 2), date(2012, JUNE, 25), -1},
        {date(2012, JULY, 2), date(2012, JUNE, 26), 0},
        {date(2012, JULY, 2), date(2012, JULY, 2), 0},
        {date(2012, JULY, 2), date(2012, JULY, 8), 0},
        {date(2012, JULY, 2), date(2012, JULY, 9), 1},

        {date(2012, FEBRUARY, 28), date(2012, FEBRUARY, 21), -1},
        {date(2012, FEBRUARY, 28), date(2012, FEBRUARY, 22), 0},
        {date(2012, FEBRUARY, 28), date(2012, FEBRUARY, 28), 0},
        {date(2012, FEBRUARY, 28), date(2012, FEBRUARY, 29), 0},
        {date(2012, FEBRUARY, 28), date(2012, MARCH, 1), 0},
        {date(2012, FEBRUARY, 28), date(2012, MARCH, 5), 0},
        {date(2012, FEBRUARY, 28), date(2012, MARCH, 6), 1},

        {date(2012, FEBRUARY, 29), date(2012, FEBRUARY, 22), -1},
        {date(2012, FEBRUARY, 29), date(2012, FEBRUARY, 23), 0},
        {date(2012, FEBRUARY, 29), date(2012, FEBRUARY, 28), 0},
        {date(2012, FEBRUARY, 29), date(2012, FEBRUARY, 29), 0},
        {date(2012, FEBRUARY, 29), date(2012, MARCH, 1), 0},
        {date(2012, FEBRUARY, 29), date(2012, MARCH, 6), 0},
        {date(2012, FEBRUARY, 29), date(2012, MARCH, 7), 1},
    };
}
 
Example #2
Source File: TCKYear.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="plus_long_TemporalUnit")
Object[][] data_plus_long_TemporalUnit() {
    return new Object[][] {
        {Year.of(1), 1, ChronoUnit.YEARS, Year.of(2), null},
        {Year.of(1), -12, ChronoUnit.YEARS, Year.of(-11), null},
        {Year.of(1), 0, ChronoUnit.YEARS, Year.of(1), null},
        {Year.of(999999999), 0, ChronoUnit.YEARS, Year.of(999999999), null},
        {Year.of(-999999999), 0, ChronoUnit.YEARS, Year.of(-999999999), null},
        {Year.of(0), -999999999, ChronoUnit.YEARS, Year.of(-999999999), null},
        {Year.of(0), 999999999, ChronoUnit.YEARS, Year.of(999999999), null},

        {Year.of(-1), 1, ChronoUnit.ERAS, Year.of(2), null},
        {Year.of(5), 1, ChronoUnit.CENTURIES, Year.of(105), null},
        {Year.of(5), 1, ChronoUnit.DECADES, Year.of(15), null},

        {Year.of(999999999), 1, ChronoUnit.YEARS, null, DateTimeException.class},
        {Year.of(-999999999), -1, ChronoUnit.YEARS, null, DateTimeException.class},

        {Year.of(1), 0, ChronoUnit.DAYS, null, DateTimeException.class},
        {Year.of(1), 0, ChronoUnit.WEEKS, null, DateTimeException.class},
        {Year.of(1), 0, ChronoUnit.MONTHS, null, DateTimeException.class},
    };
}
 
Example #3
Source File: TCKDuration.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="durationBetweenLocalDateTime")
Object[][] data_durationBetweenLocalDateTime() {
    return new Object[][] {
            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 565_000_000), LocalDateTime.of(2013, 3, 24, 0, 44, 30, 65_000_000), -2L, 500_000_000},
            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 565_000_000), LocalDateTime.of(2013, 3, 24, 0, 44, 31, 65_000_000), -1L, 500_000_000},
            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 565_000_000), LocalDateTime.of(2013, 3, 24, 0, 44, 32, 65_000_000), 0L, 500_000_000},
            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 565_000_000), LocalDateTime.of(2013, 3, 24, 0, 44, 33, 65_000_000), 1L, 500_000_000},
            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 565_000_000), LocalDateTime.of(2013, 3, 24, 0, 44, 34, 65_000_000), 2L, 500_000_000},

            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 65_000_000), LocalDateTime.of(2013, 3, 24, 0, 44, 30, 565_000_000), -1L, 500_000_000},
            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 65_000_000), LocalDateTime.of(2013, 3, 24, 0, 44, 31, 565_000_000), 0L, 500_000_000},
            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 65_000_000), LocalDateTime.of(2013, 3, 24, 0, 44, 32, 565_000_000), 1L, 500_000_000},
            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 65_000_000), LocalDateTime.of(2013, 3, 24, 0, 44, 33, 565_000_000), 2L, 500_000_000},
            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 65_000_000), LocalDateTime.of(2013, 3, 24, 0, 44, 34, 565_000_000), 3L, 500_000_000},

            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 65_000_000), LocalDateTime.of(2013, 3, 24, 0, 44, 30, 65_000_000), -1L, 0},
            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 65_000_000), LocalDateTime.of(2013, 3, 24, 0, 44, 31, 65_000_000), 0L, 0},
            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 65_000_000), LocalDateTime.of(2013, 3, 24, 0, 44, 32, 65_000_000), 1L, 0},
            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 65_000_000), LocalDateTime.of(2013, 3, 24, 0, 44, 33, 65_000_000), 2L, 0},
            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 65_000_000), LocalDateTime.of(2013, 3, 24, 0, 44, 34, 65_000_000), 3L, 0},

            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 65_000_000), LocalDateTime.of(2813, 3, 24, 0, 44, 30, 565_000_000), 2 * CYCLE_SECS - 1L, 500_000_000},
            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 65_000_000), LocalDateTime.of(2813, 3, 24, 0, 44, 31, 565_000_000), 2 * CYCLE_SECS + 0L, 500_000_000},
            {LocalDateTime.of(2013, 3, 24, 0, 44, 31, 65_000_000), LocalDateTime.of(2813, 3, 24, 0, 44, 32, 565_000_000), 2 * CYCLE_SECS + 1L, 500_000_000},
    };
}
 
Example #4
Source File: TCKLocalizedPrinterParser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="date")
Object[][] data_date() {
    return new Object[][] {
            {LocalDate.of(2012, 6, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.UK},
            {LocalDate.of(2012, 6, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.US},
            {LocalDate.of(2012, 6, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.FRANCE},
            {LocalDate.of(2012, 6, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.JAPAN},

            {LocalDate.of(2012, 6, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.UK},
            {LocalDate.of(2012, 6, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.US},
            {LocalDate.of(2012, 6, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.FRANCE},
            {LocalDate.of(2012, 6, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.JAPAN},

            {LocalDate.of(2012, 6, 30), FormatStyle.LONG, DateFormat.LONG, Locale.UK},
            {LocalDate.of(2012, 6, 30), FormatStyle.LONG, DateFormat.LONG, Locale.US},
            {LocalDate.of(2012, 6, 30), FormatStyle.LONG, DateFormat.LONG, Locale.FRANCE},
            {LocalDate.of(2012, 6, 30), FormatStyle.LONG, DateFormat.LONG, Locale.JAPAN},

            {LocalDate.of(2012, 6, 30), FormatStyle.FULL, DateFormat.FULL, Locale.UK},
            {LocalDate.of(2012, 6, 30), FormatStyle.FULL, DateFormat.FULL, Locale.US},
            {LocalDate.of(2012, 6, 30), FormatStyle.FULL, DateFormat.FULL, Locale.FRANCE},
            {LocalDate.of(2012, 6, 30), FormatStyle.FULL, DateFormat.FULL, Locale.JAPAN},
    };
}
 
Example #5
Source File: TCKYear.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="minus_long_TemporalUnit")
Object[][] data_minus_long_TemporalUnit() {
    return new Object[][] {
        {Year.of(1), 1, ChronoUnit.YEARS, Year.of(0), null},
        {Year.of(1), -12, ChronoUnit.YEARS, Year.of(13), null},
        {Year.of(1), 0, ChronoUnit.YEARS, Year.of(1), null},
        {Year.of(999999999), 0, ChronoUnit.YEARS, Year.of(999999999), null},
        {Year.of(-999999999), 0, ChronoUnit.YEARS, Year.of(-999999999), null},
        {Year.of(0), -999999999, ChronoUnit.YEARS, Year.of(999999999), null},
        {Year.of(0), 999999999, ChronoUnit.YEARS, Year.of(-999999999), null},

        {Year.of(999999999), 1, ChronoUnit.ERAS, Year.of(-999999999 + 1), null},
        {Year.of(105), 1, ChronoUnit.CENTURIES, Year.of(5), null},
        {Year.of(15), 1, ChronoUnit.DECADES, Year.of(5), null},

        {Year.of(-999999999), 1, ChronoUnit.YEARS, null, DateTimeException.class},
        {Year.of(1), -999999999, ChronoUnit.YEARS, null, DateTimeException.class},

        {Year.of(1), 0, ChronoUnit.DAYS, null, DateTimeException.class},
        {Year.of(1), 0, ChronoUnit.WEEKS, null, DateTimeException.class},
        {Year.of(1), 0, ChronoUnit.MONTHS, null, DateTimeException.class},
    };
}
 
Example #6
Source File: TCKPeriod.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="minus")
Object[][] data_minus() {
    return new Object[][] {
            {pymd(0, 0, 0), pymd(0, 0, 0), pymd(0, 0, 0)},
            {pymd(0, 0, 0), pymd(5, 0, 0), pymd(-5, 0, 0)},
            {pymd(0, 0, 0), pymd(-5, 0, 0), pymd(5, 0, 0)},
            {pymd(0, 0, 0), pymd(0, 5, 0), pymd(0, -5, 0)},
            {pymd(0, 0, 0), pymd(0, -5, 0), pymd(0, 5, 0)},
            {pymd(0, 0, 0), pymd(0, 0, 5), pymd(0, 0, -5)},
            {pymd(0, 0, 0), pymd(0, 0, -5), pymd(0, 0, 5)},
            {pymd(0, 0, 0), pymd(2, 3, 4), pymd(-2, -3, -4)},
            {pymd(0, 0, 0), pymd(-2, -3, -4), pymd(2, 3, 4)},

            {pymd(4, 5, 6), pymd(2, 3, 4), pymd(2, 2, 2)},
            {pymd(4, 5, 6), pymd(-2, -3, -4), pymd(6, 8, 10)},
    };
}
 
Example #7
Source File: TestNumberParser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="parseDigitsAdjacentLenient")
Object[][] provider_parseDigitsAdjacentLenient() {
    return new Object[][] {
            // never
            {"5", 1, null, null},
            {"54", 1, null, null},

            {"543", 3, 5, 43},
            {"543A", 3, 5, 43},

            {"5432", 4, 54, 32},
            {"5432A", 4, 54, 32},

            {"54321", 5, 543, 21},
            {"54321A", 5, 543, 21},
    };
}
 
Example #8
Source File: TCKChronoField.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="fieldUnit")
Object[][] data_fieldUnit() {
    return new Object[][] {
            {YEAR, YEARS, FOREVER},
            {MONTH_OF_YEAR, MONTHS, YEARS},
            {DAY_OF_MONTH, DAYS, MONTHS},
            {DAY_OF_WEEK, DAYS, WEEKS},
            {DAY_OF_YEAR, DAYS, YEARS},
            {HOUR_OF_DAY, HOURS, DAYS},
            {MINUTE_OF_DAY, MINUTES, DAYS},
            {MINUTE_OF_HOUR, MINUTES, HOURS},
            {SECOND_OF_DAY, SECONDS, DAYS},
            {SECOND_OF_MINUTE, SECONDS, MINUTES},
            {MILLI_OF_DAY, MILLIS, DAYS},
            {MILLI_OF_SECOND, MILLIS, SECONDS},
            {MICRO_OF_SECOND, MICROS, SECONDS},
            {MICRO_OF_DAY, MICROS, DAYS},
            {NANO_OF_SECOND, NANOS, SECONDS},
            {NANO_OF_DAY, NANOS, DAYS},

    };
}
 
Example #9
Source File: TestUmmAlQuraChronology.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="patternMonthNames")
Object[][] data_patternMonthNames() {
    return new Object[][] {
        {1434, 1, 1, "01 AH Thu Muharram 1434"},
        {1434, 2, 1, "01 AH Fri Safar 1434"},
        {1434, 3, 1, "01 AH Sun Rabi\u02bb I 1434"},//the actual month name is Rabi Al-Awwal, but the locale data contains short form.
        {1434, 4, 1, "01 AH Mon Rabi\u02bb II 1434"},//the actual month name is Rabi Al-Akhar, but the locale data contains short form.
        {1434, 5, 1, "01 AH Wed Jumada I 1434"},//the actual month name is Jumada Al-Awwal, but the locale data contains short form.
        {1434, 6, 1, "01 AH Thu Jumada II 1434"},//the actual month name is Jumada Al-Akhar, but the locale data contains short form.
        {1434, 7, 1, "01 AH Sat Rajab 1434"},
        {1434, 8, 1, "01 AH Mon Sha\u02bbban 1434"},
        {1434, 9, 1, "01 AH Tue Ramadan 1434"},
        {1434, 10, 1, "01 AH Thu Shawwal 1434"},
        {1434, 11, 1, "01 AH Sat Dhu\u02bbl-Qi\u02bbdah 1434"},
        {1434, 12, 1, "01 AH Sun Dhu\u02bbl-Hijjah 1434"},
    };
}
 
Example #10
Source File: TestJapaneseChronology.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="invalid_eraYear")
Object[][] invalidEraYearData() {
    return new Object[][] {
        // Japanese era, yearOfEra
        { JapaneseEra.MEIJI,     -1 },
        { JapaneseEra.MEIJI,      0 },
        { JapaneseEra.MEIJI,     46 },
        { JapaneseEra.TAISHO,    -1 },
        { JapaneseEra.TAISHO,     0 },
        { JapaneseEra.TAISHO,    16 },
        { JapaneseEra.SHOWA,     -1 },
        { JapaneseEra.SHOWA,      0 },
        { JapaneseEra.SHOWA,     65 },
        { JapaneseEra.HEISEI,    -1 },
        { JapaneseEra.HEISEI,     0 },
        { JapaneseEra.HEISEI,    32 },
        { JapaneseEra.of(3),     -1 },
        { JapaneseEra.of(3),      0 },
        { JapaneseEra.of(3), Year.MAX_VALUE },
    };
}
 
Example #11
Source File: TCKMinguoChronology.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="prolepticYear")
Object[][] data_prolepticYear() {
    return new Object[][] {
        {1, MinguoEra.ROC, 1912 - YDIFF, 1912 - YDIFF, true},
        {1, MinguoEra.ROC, 1916 - YDIFF, 1916 - YDIFF, true},
        {1, MinguoEra.ROC, 1914 - YDIFF, 1914 - YDIFF, false},
        {1, MinguoEra.ROC, 2000 - YDIFF, 2000 - YDIFF, true},
        {1, MinguoEra.ROC, 2100 - YDIFF, 2100 - YDIFF, false},
        {1, MinguoEra.ROC, 0, 0, false},
        {1, MinguoEra.ROC, 1908 - YDIFF, 1908 - YDIFF, true},
        {1, MinguoEra.ROC, 1900 - YDIFF, 1900 - YDIFF, false},
        {1, MinguoEra.ROC, 1600 - YDIFF, 1600 - YDIFF, true},

        {0, MinguoEra.BEFORE_ROC, YDIFF - 1911, 1912 - YDIFF, true},
        {0, MinguoEra.BEFORE_ROC, YDIFF - 1915, 1916 - YDIFF, true},
        {0, MinguoEra.BEFORE_ROC, YDIFF - 1913, 1914 - YDIFF, false},
        {0, MinguoEra.BEFORE_ROC, YDIFF - 1999, 2000 - YDIFF, true},
        {0, MinguoEra.BEFORE_ROC, YDIFF - 2099, 2100 - YDIFF, false},
        {0, MinguoEra.BEFORE_ROC, 1, 0, false},
        {0, MinguoEra.BEFORE_ROC, YDIFF - 1907, 1908 - YDIFF, true},
        {0, MinguoEra.BEFORE_ROC, YDIFF - 1899, 1900 - YDIFF, false},
        {0, MinguoEra.BEFORE_ROC, YDIFF - 1599, 1600 - YDIFF, true},

    };
}
 
Example #12
Source File: TCKOffsetDateTime.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="periodUntilUnit")
Object[][] data_untilUnit() {
    return new Object[][] {
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 6, 30, 13, 1, 1, 0, OFFSET_PONE), HALF_DAYS, 1},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 6, 30, 2, 1, 1, 0, OFFSET_PONE), HOURS, 1},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 6, 30, 2, 1, 1, 0, OFFSET_PONE), MINUTES, 60},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 6, 30, 2, 1, 1, 0, OFFSET_PONE), SECONDS, 3600},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 6, 30, 2, 1, 1, 0, OFFSET_PONE), MILLIS, 3600*1000},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 6, 30, 2, 1, 1, 0, OFFSET_PONE), MICROS, 3600*1000*1000L},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 6, 30, 2, 1, 1, 0, OFFSET_PONE), NANOS, 3600*1000*1000L*1000},

            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 6, 30, 14, 1, 1, 0, OFFSET_PTWO), HALF_DAYS, 1},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 6, 30, 3, 1, 1, 0, OFFSET_PTWO), HOURS, 1},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 6, 30, 3, 1, 1, 0, OFFSET_PTWO), MINUTES, 60},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 6, 30, 3, 1, 1, 0, OFFSET_PTWO), SECONDS, 3600},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 6, 30, 3, 1, 1, 0, OFFSET_PTWO), MILLIS, 3600*1000},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 6, 30, 3, 1, 1, 0, OFFSET_PTWO), MICROS, 3600*1000*1000L},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 6, 30, 3, 1, 1, 0, OFFSET_PTWO), NANOS, 3600*1000*1000L*1000},

            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 7, 1, 1, 1, 0, 999999999, OFFSET_PONE), DAYS, 0},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 7, 1, 1, 1, 1, 0, OFFSET_PONE), DAYS, 1},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 8, 29, 1, 1, 1, 0, OFFSET_PONE), MONTHS, 1},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 8, 30, 1, 1, 1, 0, OFFSET_PONE), MONTHS, 2},
            {OffsetDateTime.of(2010, 6, 30, 1, 1, 1, 0, OFFSET_PONE), OffsetDateTime.of(2010, 8, 31, 1, 1, 1, 0, OFFSET_PONE), MONTHS, 2},
    };
}
 
Example #13
Source File: TCKThaiBuddhistChronology.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="badDates")
Object[][] data_badDates() {
    return new Object[][] {
        {1728, 0, 0},

        {1728, -1, 1},
        {1728, 0, 1},
        {1728, 14, 1},
        {1728, 15, 1},

        {1728, 1, -1},
        {1728, 1, 0},
        {1728, 1, 32},

        {1728, 12, -1},
        {1728, 12, 0},
        {1728, 12, 32},

        {3 + YDIFF, 2, 29},
        {600 + YDIFF, 2, 29},
        {1501 + YDIFF, 2, 29},
    };
}
 
Example #14
Source File: TCKDuration.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="PlusSeconds")
Object[][] provider_plusSeconds_long() {
    return new Object[][] {
        {0, 0, 0, 0, 0},
        {0, 0, 1, 1, 0},
        {0, 0, -1, -1, 0},
        {0, 0, Long.MAX_VALUE, Long.MAX_VALUE, 0},
        {0, 0, Long.MIN_VALUE, Long.MIN_VALUE, 0},
        {1, 0, 0, 1, 0},
        {1, 0, 1, 2, 0},
        {1, 0, -1, 0, 0},
        {1, 0, Long.MAX_VALUE - 1, Long.MAX_VALUE, 0},
        {1, 0, Long.MIN_VALUE, Long.MIN_VALUE + 1, 0},
        {1, 1, 0, 1, 1},
        {1, 1, 1, 2, 1},
        {1, 1, -1, 0, 1},
        {1, 1, Long.MAX_VALUE - 1, Long.MAX_VALUE, 1},
        {1, 1, Long.MIN_VALUE, Long.MIN_VALUE + 1, 1},
        {-1, 1, 0, -1, 1},
        {-1, 1, 1, 0, 1},
        {-1, 1, -1, -2, 1},
        {-1, 1, Long.MAX_VALUE, Long.MAX_VALUE - 1, 1},
        {-1, 1, Long.MIN_VALUE + 1, Long.MIN_VALUE, 1},
    };
}
 
Example #15
Source File: TCKMinguoChronology.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="localDateTime")
Object[][] data_localDateTime() {
    return new Object[][] {
        {LocalDateTime.of(2012, 2, 29, 2, 7), MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2012 - YDIFF, 2, 29), LocalTime.of(2, 7), null},
        {ZonedDateTime.of(2012, 2, 29, 2, 7, 1, 1, ZONE_PARIS), MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2012 - YDIFF, 2, 29), LocalTime.of(2, 7, 1, 1), null},
        {OffsetDateTime.of(2012, 2, 29, 2, 7, 1, 1, OFFSET_PTWO), MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2012 - YDIFF, 2, 29), LocalTime.of(2, 7, 1, 1), null},

        {JapaneseDate.of(2012, 2, 29), null, null, DateTimeException.class},
        {ThaiBuddhistDate.of(2012 + 543, 2, 29), null, null, DateTimeException.class},
        {LocalDate.of(2012, 2, 29), null, null, DateTimeException.class},
        {LocalTime.of(20, 30, 29, 0), null, null, DateTimeException.class},
    };
}
 
Example #16
Source File: TCKPeriod.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="subtractFrom")
Object[][] data_subtractFrom() {
    return new Object[][] {
            {pymd(0, 0, 0), date(2012, 6, 30), date(2012, 6, 30)},

            {pymd(1, 0, 0), date(2012, 6, 10), date(2011, 6, 10)},
            {pymd(0, 1, 0), date(2012, 6, 10), date(2012, 5, 10)},
            {pymd(0, 0, 1), date(2012, 6, 10), date(2012, 6, 9)},

            {pymd(-1, 0, 0), date(2012, 6, 10), date(2013, 6, 10)},
            {pymd(0, -1, 0), date(2012, 6, 10), date(2012, 7, 10)},
            {pymd(0, 0, -1), date(2012, 6, 10), date(2012, 6, 11)},

            {pymd(1, 2, 3), date(2012, 8, 30), date(2011, 6, 27)},
            {pymd(1, 2, 3), date(2012, 8, 31), date(2011, 6, 27)},
            {pymd(1, 2, 3), date(2012, 9, 1), date(2011, 6, 28)},
            {pymd(1, 2, 3), date(2012, 9, 2), date(2011, 6, 29)},
            {pymd(1, 2, 3), date(2012, 9, 3), date(2011, 6, 30)},
            {pymd(1, 2, 3), date(2012, 9, 4), date(2011, 7, 1)},

            {pymd(1, 0, 0), date(2011, 2, 28), date(2010, 2, 28)},
            {pymd(4, 0, 0), date(2011, 2, 28), date(2007, 2, 28)},
            {pymd(1, 0, 0), date(2012, 2, 29), date(2011, 2, 28)},
            {pymd(4, 0, 0), date(2012, 2, 29), date(2008, 2, 29)},

            {pymd(1, 1, 0), date(2013, 3, 29), date(2012, 2, 29)},
            {pymd(1, 2, 0), date(2012, 2, 29), date(2010, 12, 29)},
    };
}
 
Example #17
Source File: TestIsoWeekFields.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "fields")
Object[][] data_Fields() {
    return new Object[][] {
            {IsoFields.WEEK_OF_WEEK_BASED_YEAR, IsoFields.WEEK_BASED_YEAR},
            {WeekFields.ISO.weekOfWeekBasedYear(), WeekFields.ISO.weekBasedYear()},
    };
}
 
Example #18
Source File: TCKMinguoEra.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "MinguoEras")
Object[][] data_of_eras() {
    return new Object[][] {
                {MinguoEra.BEFORE_ROC, "BEFORE_ROC", 0},
                {MinguoEra.ROC, "ROC", 1},
    };
}
 
Example #19
Source File: TCKOffsetDateTime.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="sampleToString")
Object[][] provider_sampleToString() {
    return new Object[][] {
        {2008, 6, 30, 11, 30, 59, 0, "Z", "2008-06-30T11:30:59Z"},
        {2008, 6, 30, 11, 30, 59, 0, "+01:00", "2008-06-30T11:30:59+01:00"},
        {2008, 6, 30, 11, 30, 59, 999000000, "Z", "2008-06-30T11:30:59.999Z"},
        {2008, 6, 30, 11, 30, 59, 999000000, "+01:00", "2008-06-30T11:30:59.999+01:00"},
        {2008, 6, 30, 11, 30, 59, 999000, "Z", "2008-06-30T11:30:59.000999Z"},
        {2008, 6, 30, 11, 30, 59, 999000, "+01:00", "2008-06-30T11:30:59.000999+01:00"},
        {2008, 6, 30, 11, 30, 59, 999, "Z", "2008-06-30T11:30:59.000000999Z"},
        {2008, 6, 30, 11, 30, 59, 999, "+01:00", "2008-06-30T11:30:59.000000999+01:00"},
    };
}
 
Example #20
Source File: TCKThaiBuddhistChronology.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="prolepticYear")
Object[][] data_prolepticYear() {
    return new Object[][] {
        {1, ThaiBuddhistEra.BE, 4 + YDIFF, 4 + YDIFF, true},
        {1, ThaiBuddhistEra.BE, 7 + YDIFF, 7 + YDIFF, false},
        {1, ThaiBuddhistEra.BE, 8 + YDIFF, 8 + YDIFF, true},
        {1, ThaiBuddhistEra.BE, 1000 + YDIFF, 1000 + YDIFF, false},
        {1, ThaiBuddhistEra.BE, 2000 + YDIFF, 2000 + YDIFF, true},
        {1, ThaiBuddhistEra.BE, 0, 0, false},
        {1, ThaiBuddhistEra.BE, -4 + YDIFF, -4 + YDIFF, true},
        {1, ThaiBuddhistEra.BE, -7 + YDIFF, -7 + YDIFF, false},
        {1, ThaiBuddhistEra.BE, -100 + YDIFF, -100 + YDIFF, false},
        {1, ThaiBuddhistEra.BE, -800 + YDIFF, -800 + YDIFF, true},

        {0, ThaiBuddhistEra.BEFORE_BE, -3 - YDIFF, 4 + YDIFF, true},
        {0, ThaiBuddhistEra.BEFORE_BE, -6 - YDIFF, 7 + YDIFF, false},
        {0, ThaiBuddhistEra.BEFORE_BE, -7 - YDIFF, 8 + YDIFF, true},
        {0, ThaiBuddhistEra.BEFORE_BE, -999 - YDIFF, 1000 + YDIFF, false},
        {0, ThaiBuddhistEra.BEFORE_BE, -1999 - YDIFF, 2000 + YDIFF, true},
        {0, ThaiBuddhistEra.BEFORE_BE, 1, 0, false},
        {0, ThaiBuddhistEra.BEFORE_BE, 5 - YDIFF, -4 + YDIFF, true},
        {0, ThaiBuddhistEra.BEFORE_BE, 8 - YDIFF, -7 + YDIFF, false},
        {0, ThaiBuddhistEra.BEFORE_BE, 101 - YDIFF, -100 + YDIFF, false},
        {0, ThaiBuddhistEra.BEFORE_BE, 801 - YDIFF, -800 + YDIFF, true},

    };
}
 
Example #21
Source File: CommonRowSetTests.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "rowSetType")
protected Object[][] rowSetType() throws Exception {

    RowSet rs = newInstance();
    return new Object[][]{
        {rs}
    };
}
 
Example #22
Source File: SpinedBufferTest.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "DoubleSpinedBuffer")
public Object[][] createDoubleSpinedBuffer() {
    List<Object[]> params = new ArrayList<>();

    for (int size : sizes) {
        // @@@ replace with double range when implemented
        double[] array = LongStream.range(0, size).asDoubleStream().toArray();
        SpinedBuffer.OfDouble sb = new SpinedBuffer.OfDouble();
        Arrays.stream(array).forEach(sb);

        params.add(new Object[]{array, sb});
    }

    return params.toArray(new Object[0][]);
}
 
Example #23
Source File: CommonRowSetTests.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "rowSetTrueFalse")
protected Object[][] rowSetTrueFalse() throws Exception {
    RowSet rs = newInstance();
    return new Object[][]{
        {rs, true},
        {rs, false}
    };
}
 
Example #24
Source File: TCKMonthDay.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="goodParseData")
Object[][] provider_goodParseData() {
    return new Object[][] {
            {"--01-01", MonthDay.of(1, 1)},
            {"--01-31", MonthDay.of(1, 31)},
            {"--02-01", MonthDay.of(2, 1)},
            {"--02-29", MonthDay.of(2, 29)},
            {"--03-01", MonthDay.of(3, 1)},
            {"--03-31", MonthDay.of(3, 31)},
            {"--04-01", MonthDay.of(4, 1)},
            {"--04-30", MonthDay.of(4, 30)},
            {"--05-01", MonthDay.of(5, 1)},
            {"--05-31", MonthDay.of(5, 31)},
            {"--06-01", MonthDay.of(6, 1)},
            {"--06-30", MonthDay.of(6, 30)},
            {"--07-01", MonthDay.of(7, 1)},
            {"--07-31", MonthDay.of(7, 31)},
            {"--08-01", MonthDay.of(8, 1)},
            {"--08-31", MonthDay.of(8, 31)},
            {"--09-01", MonthDay.of(9, 1)},
            {"--09-30", MonthDay.of(9, 30)},
            {"--10-01", MonthDay.of(10, 1)},
            {"--10-31", MonthDay.of(10, 31)},
            {"--11-01", MonthDay.of(11, 1)},
            {"--11-30", MonthDay.of(11, 30)},
            {"--12-01", MonthDay.of(12, 1)},
            {"--12-31", MonthDay.of(12, 31)},
    };
}
 
Example #25
Source File: TestHiveStorageFormats.java    From presto with Apache License 2.0 5 votes vote down vote up
@DataProvider(name = "storage_formats")
public static Object[][] storageFormats()
{
    return new StorageFormat[][] {
            {storageFormat("ORC", ImmutableMap.of("hive.orc_optimized_writer_validate", "true"))},
            {storageFormat("PARQUET")},
            {storageFormat("RCBINARY", ImmutableMap.of("hive.rcfile_optimized_writer_validate", "true"))},
            {storageFormat("RCTEXT", ImmutableMap.of("hive.rcfile_optimized_writer_validate", "true"))},
            {storageFormat("SEQUENCEFILE")},
            {storageFormat("TEXTFILE")},
            {storageFormat("TEXTFILE", ImmutableMap.of(), ImmutableMap.of("textfile_field_separator", "F", "textfile_field_separator_escape", "E"))},
            {storageFormat("AVRO")}
    };
}
 
Example #26
Source File: Capacity.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider
public Object[][] charCapacity() {
    return new Object[][] {
        {'J', 0},
        {'J', 1},
        {'J', 15},
        {'J', DEFAULT_CAPACITY},
        {'J', 1024},
        {'\u042b', 0},
        {'\u042b', 1},
        {'\u042b', 15},
        {'\u042b', DEFAULT_CAPACITY},
        {'\u042b', 1024},
    };
}
 
Example #27
Source File: DNSNameTest.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "badNames")
public Object[][] badNames() {
    Object[][] data = {
            {" 1abc.com"}, // begin with space
            {"1abc.com "}, // end with space
            {"1a bc.com "}, // no space allowed
            {"-abc.com"}, // begin with hyphen
            {"a..b"}, // ..
            {".a"}, // begin with .
            {"a."}, // end with .
            {""}, // empty
            {"  "},  // space only
    };
    return data;
}
 
Example #28
Source File: TCKChronoZonedDateTime.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name = "calendars")
Chronology[][] data_of_calendars() {
    return new Chronology[][]{
                {HijrahChronology.INSTANCE},
                {IsoChronology.INSTANCE},
                {JapaneseChronology.INSTANCE},
                {MinguoChronology.INSTANCE},
                {ThaiBuddhistChronology.INSTANCE},
    };
}
 
Example #29
Source File: TestTupleDomainParquetPredicate.java    From presto with Apache License 2.0 5 votes vote down vote up
@DataProvider
public Object[][] typeForParquetInt32()
{
    return new Object[][] {
            {INTEGER},
            {SMALLINT},
            {TINYINT},
    };
}
 
Example #30
Source File: TCKLocalTime.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="sampleToString")
Object[][] provider_sampleToString() {
    return new Object[][] {
        {0, 0, 0, 0, "00:00"},
        {1, 0, 0, 0, "01:00"},
        {23, 0, 0, 0, "23:00"},
        {0, 1, 0, 0, "00:01"},
        {12, 30, 0, 0, "12:30"},
        {23, 59, 0, 0, "23:59"},
        {0, 0, 1, 0, "00:00:01"},
        {0, 0, 59, 0, "00:00:59"},
        {0, 0, 0, 100000000, "00:00:00.100"},
        {0, 0, 0, 10000000, "00:00:00.010"},
        {0, 0, 0, 1000000, "00:00:00.001"},
        {0, 0, 0, 100000, "00:00:00.000100"},
        {0, 0, 0, 10000, "00:00:00.000010"},
        {0, 0, 0, 1000, "00:00:00.000001"},
        {0, 0, 0, 100, "00:00:00.000000100"},
        {0, 0, 0, 10, "00:00:00.000000010"},
        {0, 0, 0, 1, "00:00:00.000000001"},
        {0, 0, 0, 999999999, "00:00:00.999999999"},
        {0, 0, 0, 99999999, "00:00:00.099999999"},
        {0, 0, 0, 9999999, "00:00:00.009999999"},
        {0, 0, 0, 999999, "00:00:00.000999999"},
        {0, 0, 0, 99999, "00:00:00.000099999"},
        {0, 0, 0, 9999, "00:00:00.000009999"},
        {0, 0, 0, 999, "00:00:00.000000999"},
        {0, 0, 0, 99, "00:00:00.000000099"},
        {0, 0, 0, 9, "00:00:00.000000009"},
    };
}