java类org.testng.annotations.DataProvider的实例源码

SJISMappingPropTest.java 文件源码 项目:openjdk-jdk10 阅读 23 收藏 0 点赞 0 评论 0
@DataProvider
public static Iterator<Object[]> locales() {
    List<Object[]> data = new ArrayList<>();
    data.add(new String[]{"ja"});
    data.add(new String[]{"ja_JP.PCK"});
    data.add(new String[]{"ja_JP.eucJP"});
    return data.iterator();
}
DataProviders.java 文件源码 项目:openjdk-jdk10 阅读 26 收藏 0 点赞 0 评论 0
@DataProvider(name = "outgoingData", parallel = true)
public static Iterator<Object[]> outgoingData() {
    List<Integer> leading  = of(0, 1, 17, 125);
    List<Integer> trailing = of(0, 1, 19, 123);
    List<Integer> sizes    = of(0, 1, 2, 17, 32, 64, 122, 123, 124, 125, 126, 127, 128, 256);
    List<Boolean> direct   = of(true, false);
    List<Boolean> readonly = of(false); // TODO: return readonly (true)
    F5<Integer, Integer, Integer, Boolean, Boolean, Object[]> f =
            (l, t, s, d, r) -> {
                ByteBuffer b;
                if (d) {
                    b = ByteBuffer.allocateDirect(l + t + s);
                } else {
                    b = ByteBuffer.allocate(l + t + s);
                }
                fill(b);
                if (r) {
                    b = b.asReadOnlyBuffer();
                }
                b.position(l).limit(l + s);
                return new ByteBuffer[]{b};
            };
    Iterator<Object[]> product = cartesianIterator(leading, trailing, sizes, direct, readonly, f);
    Iterator<Object[]> i = iteratorOf1(new Object[]{null});
    return concat(iteratorOf(i, product));
}
UriTemplateVariableResolverTest.java 文件源码 项目:keti 阅读 23 收藏 0 点赞 0 评论 0
@DataProvider
Object[][] uriDataProvider() {
    return new Object[][] {

            { "/v1/site/123", new UriTemplate("/v1{attribute_uri}"), "/site/123" },
            { "/v1/site/123/asset/345", new UriTemplate("/v1{attribute_uri}/asset/345"), "/site/123" },
            { "/v1/site/123/asset/345", new UriTemplate("/v1{attribute_uri}/asset/{site_id}"), "/site/123" },
            { "/v1/site/123/asset/345", new UriTemplate("/v1/site/123{attribute_uri}"), "/asset/345" },
            { "/v1/site/123/asset/345", new UriTemplate("/v1{attribute_uri}"), "/site/123/asset/345" },

            { "/v1/site/123/asset/345/report", new UriTemplate("/v1{attribute_uri}/report"),
                    "/site/123/asset/345" },

            // template doesnt match uri
            { "/v1/site/123/asset/345/report", new UriTemplate("/v2{attribute_uri}"), null },
            // no attribute_uri variable in template
            { "/v1/site/123/asset/345/report", new UriTemplate("/v1{non_existent_variable}"), null },
            // multiple attribute_uri variables in template
            { "/v1/site/123/asset/345", new UriTemplate("/v1{attribute_uri}/{attribute_uri}"), "345" }, };
}
MPredicateHelperTest.java 文件源码 项目:monarch 阅读 29 收藏 0 点赞 0 评论 0
@DataProvider
public static Object[][] getFloatData() {
  return new Object[][] {{1.0f, CompareOp.EQUAL, 1.0f, true},
      {1.0f, CompareOp.NOT_EQUAL, 1.0f, false},
      {Float.MAX_VALUE, CompareOp.EQUAL, Float.MAX_VALUE, true},
      {Float.MIN_VALUE, CompareOp.EQUAL, Float.MIN_VALUE, true},
      {Float.MAX_VALUE, CompareOp.NOT_EQUAL, Float.MAX_VALUE, false},
      {Float.MIN_VALUE, CompareOp.NOT_EQUAL, Float.MIN_VALUE, false},
      {Float.MAX_VALUE, CompareOp.LESS_OR_EQUAL, Float.MAX_VALUE, true},
      {Float.MAX_VALUE, CompareOp.LESS, Float.MAX_VALUE, false},
      {Float.MAX_VALUE, CompareOp.GREATER_OR_EQUAL, 0f, false},
      {Float.MIN_VALUE, CompareOp.LESS, 0f, true}, {2f, CompareOp.LESS_OR_EQUAL, 0f, true},
      {Float.MAX_VALUE, CompareOp.LESS_OR_EQUAL, 0f, true},
      {Float.MIN_VALUE, CompareOp.GREATER_OR_EQUAL, 0f, false},
      {Float.MAX_VALUE, CompareOp.GREATER, Float.MAX_VALUE - 1, false},
      {Float.MIN_VALUE, CompareOp.LESS, Float.MIN_VALUE + 1, false},
      {null, CompareOp.LESS, null, false}, {null, CompareOp.GREATER_OR_EQUAL, null, true},};
}
TCKChronoField.java 文件源码 项目:jdk8u-jdk 阅读 31 收藏 0 点赞 0 评论 0
@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},

    };
}
TCKIsoFields.java 文件源码 项目:jdk8u-jdk 阅读 20 收藏 0 点赞 0 评论 0
@DataProvider(name="week")
Object[][] data_week() {
    return new Object[][] {
            {LocalDate.of(1969, 12, 29), MONDAY, 1, 1970},
            {LocalDate.of(2012, 12, 23), SUNDAY, 51, 2012},
            {LocalDate.of(2012, 12, 24), MONDAY, 52, 2012},
            {LocalDate.of(2012, 12, 27), THURSDAY, 52, 2012},
            {LocalDate.of(2012, 12, 28), FRIDAY, 52, 2012},
            {LocalDate.of(2012, 12, 29), SATURDAY, 52, 2012},
            {LocalDate.of(2012, 12, 30), SUNDAY, 52, 2012},
            {LocalDate.of(2012, 12, 31), MONDAY, 1, 2013},
            {LocalDate.of(2013, 1, 1), TUESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 2), WEDNESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 6), SUNDAY, 1, 2013},
            {LocalDate.of(2013, 1, 7), MONDAY, 2, 2013},
    };
}
EnumerationAsIterator.java 文件源码 项目:openjdk-jdk10 阅读 22 收藏 0 点赞 0 评论 0
@DataProvider
public static Iterator<Object[]> unmodifiable() {
    return Arrays.asList(
        of("Default-wrapped ArrayList",
           () -> wrapInDefault(
               Collections.enumeration(new ArrayList<>(Arrays.asList("a")))),
           Arrays.asList("a")),

        of("Unmodifiable ArrayList",
           Collections.unmodifiableList(new ArrayList<>(Arrays.asList("a"))),
           Arrays.asList("a")),

        of("Modifiable ArrayList",
           new ArrayList<>(Arrays.asList("a")),
           Arrays.asList("a"))
    ).iterator();
}
TCKLocalizedPrinterParser.java 文件源码 项目:openjdk-jdk10 阅读 28 收藏 0 点赞 0 评论 0
@DataProvider(name="time")
    Object[][] data_time() {
        return new Object[][] {
                {LocalTime.of(11, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.UK},
                {LocalTime.of(11, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.US},
                {LocalTime.of(11, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.FRANCE},
                {LocalTime.of(11, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.JAPAN},

                {LocalTime.of(11, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.UK},
                {LocalTime.of(11, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.US},
                {LocalTime.of(11, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.FRANCE},
                {LocalTime.of(11, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.JAPAN},

                // these localized patterns include "z" which isn't available from LocalTime
//                {LocalTime.of(11, 30), FormatStyle.LONG, DateFormat.LONG, Locale.UK},
//                {LocalTime.of(11, 30), FormatStyle.LONG, DateFormat.LONG, Locale.US},
//                {LocalTime.of(11, 30), FormatStyle.LONG, DateFormat.LONG, Locale.FRANCE},
//                {LocalTime.of(11, 30), FormatStyle.LONG, DateFormat.LONG, Locale.JAPAN},
//
//                {LocalTime.of(11, 30), FormatStyle.FULL, DateFormat.FULL, Locale.UK},
//                {LocalTime.of(11, 30), FormatStyle.FULL, DateFormat.FULL, Locale.US},
//                {LocalTime.of(11, 30), FormatStyle.FULL, DateFormat.FULL, Locale.FRANCE},
//                {LocalTime.of(11, 30), FormatStyle.FULL, DateFormat.FULL, Locale.JAPAN},
        };
    }
TCKDateTimeFormatters.java 文件源码 项目:jdk8u-jdk 阅读 32 收藏 0 点赞 0 评论 0
@DataProvider(name="sample_isoOffsetDate")
Object[][] provider_sample_isoOffsetDate() {
    return new Object[][]{
            {2008, null, null, null, null, null, DateTimeException.class},
            {null, 6, null, null, null, null, DateTimeException.class},
            {null, null, 30, null, null, null, DateTimeException.class},
            {null, null, null, "+01:00", null, null, DateTimeException.class},
            {null, null, null, null, "Europe/Paris", null, DateTimeException.class},
            {2008, 6, null, null, null, null, DateTimeException.class},
            {null, 6, 30, null, null, null, DateTimeException.class},

            {2008, 6, 30, null, null,                   null, DateTimeException.class},
            {2008, 6, 30, "+01:00", null,               "2008-06-30+01:00", null},
            {2008, 6, 30, "+01:00", "Europe/Paris",     "2008-06-30+01:00", null},
            {2008, 6, 30, null, "Europe/Paris",         null, DateTimeException.class},

            {123456, 6, 30, "+01:00", null,             "+123456-06-30+01:00", null},
    };
}
TCKDuration.java 文件源码 项目:jdk8u-jdk 阅读 25 收藏 0 点赞 0 评论 0
@DataProvider(name="MinusDays")
Object[][] provider_minusDays_long() {
    return new Object[][] {
        {0, 0, 0},
        {0, 1, -1},
        {0, -1, 1},
        {Long.MAX_VALUE/3600/24, 0, Long.MAX_VALUE/3600/24},
        {Long.MIN_VALUE/3600/24, 0, Long.MIN_VALUE/3600/24},
        {1, 0, 1},
        {1, 1, 0},
        {1, -1, 2},
        {Long.MAX_VALUE/3600/24, 1, Long.MAX_VALUE/3600/24 - 1},
        {Long.MIN_VALUE/3600/24, -1, Long.MIN_VALUE/3600/24 + 1},
        {1, 0, 1},
        {1, 1, 0},
        {1, -1, 2},
        {-1, 0, -1},
        {-1, 1, -2},
        {-1, -1, 0},
    };
}
TCKDateTimeFormatters.java 文件源码 项目:openjdk-jdk10 阅读 33 收藏 0 点赞 0 评论 0
@DataProvider(name="sample_isoInstant")
Object[][] provider_sample_isoInstant() {
    return new Object[][]{
            {0, 0, "1970-01-01T00:00:00Z", null},
            {0, null, "1970-01-01T00:00:00Z", null},
            {0, -1, null, DateTimeException.class},

            {-1, 0, "1969-12-31T23:59:59Z", null},
            {1, 0, "1970-01-01T00:00:01Z", null},
            {60, 0, "1970-01-01T00:01:00Z", null},
            {3600, 0, "1970-01-01T01:00:00Z", null},
            {86400, 0, "1970-01-02T00:00:00Z", null},

            {0, 1, "1970-01-01T00:00:00.000000001Z", null},
            {0, 2, "1970-01-01T00:00:00.000000002Z", null},
            {0, 10, "1970-01-01T00:00:00.000000010Z", null},
            {0, 100, "1970-01-01T00:00:00.000000100Z", null},
    };
}
AddReadsTestWarningError.java 文件源码 项目:openjdk-jdk10 阅读 28 收藏 0 点赞 0 评论 0
@DataProvider(name = "unknownNames")
public Object[][] unknownNames() {
    return new Object[][]{

        // source not found
        {"DoesNotExist=m2",    "WARNING: Unknown module: DoesNotExist specified to --add-reads"},

        // target not found
        {"m2=DoesNotExist",    "WARNING: Unknown module: DoesNotExist specified to --add-reads"},

        // bad names
        {"m*=m2",              "WARNING: Unknown module: m* specified to --add-reads"},
        {"m2=m!",              "WARNING: Unknown module: m! specified to --add-reads"},

    };
}
TCKJapaneseChronology.java 文件源码 项目:jdk8u-jdk 阅读 23 收藏 0 点赞 0 评论 0
@DataProvider(name="badDates")
Object[][] data_badDates() {
    return new Object[][] {
        {1928, 0, 0},

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

        {1928, 1, -1},
        {1928, 1, 0},
        {1928, 1, 32},

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

        {1725, 2, 29},
        {500, 2, 29},
        {2100, 2, 29},

        {1872, 12, 31},     // Last day of MEIJI 5
    };
}
ToLowerCase.java 文件源码 项目:openjdk-jdk10 阅读 23 收藏 0 点赞 0 评论 0
@DataProvider
public Object[][] provider() {
    return new Object[][] {
            new Object[] { STRING_EMPTY, "" },
            new Object[] { STRING_L1, "a" },
            new Object[] { STRING_L2, "ab" },
            new Object[] { STRING_U1, "\uFF41" },
            new Object[] { STRING_MDUPLICATE1,
                    "\uFF41a\uFF41a\uFF41a\uFF41a\uFF41a" },
            new Object[] { STRING_SUPPLEMENTARY,
                    "\uD801\uDC28\uD801\uDC29\uFF41a" },
            new Object[] { STRING_SUPPLEMENTARY_LOWERCASE,
                    "\uD801\uDC28\uD801\uDC29\uFF41a" },
            new Object[] { STRING_SUPPLEMENTARY,
                    STRING_SUPPLEMENTARY_LOWERCASE } };
}
CatalogTest.java 文件源码 项目:openjdk-jdk10 阅读 28 收藏 0 点赞 0 评论 0
@DataProvider(name = "supportURIResolver")
public Object[][] supportURIResolver() throws Exception {
    URI catalogFile = getClass().getResource("CatalogSupport.xml").toURI();
    URI catalogFileUri = getClass().getResource("CatalogSupport_uri.xml").toURI();
    SAXSource xslSource = new SAXSource(new InputSource(new File(xsl_doc).toURI().toASCIIString()));

    /*
     * val_test.xml has a reference to system.dtd and val_test.xsd
    */
    SAXSource ss = new SAXSource(new InputSource(xml_val_test));
    ss.setSystemId(xml_val_test_id);

    return new Object[][]{
        {catalogFile, new SAXSource(new InputSource(new File(xsl_doc).toURI().toASCIIString())),
            new StreamSource(new File(xml_doc)), "Resolved by a catalog"},
        {catalogFileUri, new SAXSource(new InputSource(new StringReader(xsl_include))),
            new StreamSource(new StringReader(xml_xsl)), null},
     };
}
SortingNearlySortedPrimitive.java 文件源码 项目:openjdk-jdk10 阅读 30 收藏 0 点赞 0 评论 0
@DataProvider(name = "shapes")
public Object[][] createShapes() {
    Stream<List<Object>> baseCases = Stream.of(
            List.of("hiZeroLowTest", (IntFunction<int[]>) this::hiZeroLowData),
            List.of("endLessThanTest", (IntFunction<int[]>) this::endLessThanData),
            List.of("highFlatLowTest", (IntFunction<int[]>) this::highFlatLowData),
            List.of("identicalTest", (IntFunction<int[]>) this::identicalData),
            List.of("sortedReversedSortedTest", (IntFunction<int[]>) this::sortedReversedSortedData),
            List.of("pairFlipTest", (IntFunction<int[]>) this::pairFlipData),
            List.of("zeroHiTest", (IntFunction<int[]>) this::zeroHiData)
    );

    // Ensure the following inequality holds for certain sizes
    // DualPivotQuicksort.QUICKSORT_THRESHOLD <= size - 1
    //   < DualPivotQuicksort.COUNTING_SORT_THRESHOLD_FOR_SHORT_OR_CHAR
    // This guarantees that code paths are taken for checking nearly sorted
    // arrays for all primitive types
    List<Integer> sizes = List.of(100, 1_000, 10_000, 1_000_000);
    return baseCases.
            flatMap(l -> sizes.stream().map(s -> append(l, s))).
            toArray(Object[][]::new);
}
TestReducedParser.java 文件源码 项目:jdk8u-jdk 阅读 37 收藏 0 点赞 0 评论 0
@DataProvider(name="ParseAdjacent")
Object[][] provider_parseAdjacent() {
    return new Object[][] {
        // general
        {"yyMMdd", "19990703",  LENIENT, 0, 8, 1999, 7, 3},
        {"yyMMdd", "19990703",  STRICT, 0, 6, 2019, 99, 7},
        {"yyMMdd", "990703",    LENIENT, 0, 6, 2099, 7, 3},
        {"yyMMdd", "990703",    STRICT, 0, 6, 2099, 7, 3},
        {"yyMMdd", "200703",    LENIENT, 0, 6, 2020, 7, 3},
        {"yyMMdd", "200703",    STRICT, 0, 6, 2020, 7, 3},
        {"ddMMyy", "230714",    LENIENT, 0, 6, 2014, 7, 23},
        {"ddMMyy", "230714",    STRICT, 0, 6, 2014, 7, 23},
        {"ddMMyy", "25062001",  LENIENT, 0, 8, 2001, 6, 25},
        {"ddMMyy", "25062001",  STRICT, 0, 6, 2020, 6, 25},
        {"ddMMy",  "27052002",  LENIENT, 0, 8, 2002, 5, 27},
        {"ddMMy",  "27052002",  STRICT, 0, 8, 2002, 5, 27},
    };
}
DurationTest.java 文件源码 项目:openjdk-jdk10 阅读 29 收藏 0 点赞 0 评论 0
@DataProvider(name = "duration-field")
public Object[][] getDurationAndField() {
    Function<Duration, Integer> getyears = duration -> duration.getYears();
    Function<Duration, Integer> getmonths = duration -> duration.getMonths();
    Function<Duration, Integer> getdays = duration -> duration.getDays();
    Function<Duration, Integer> gethours = duration -> duration.getHours();
    Function<Duration, Integer> getminutes = duration -> duration.getMinutes();
    Function<Duration, Integer> getseconds = duration -> duration.getSeconds();
    return new Object[][] {
            { "P1Y1M1DT1H1M1S", getyears, 1 },
            { "P1M1DT1H1M1S", getyears, 0 },
            { "P1Y1M1DT1H1M1S", getmonths, 1 },
            { "P1Y1DT1H1M1S", getmonths, 0 },
            { "P1Y1M1DT1H1M1S", getdays, 1 },
            { "P1Y1MT1H1M1S", getdays, 0 },
            { "P1Y1M1DT1H1M1S", gethours, 1 },
            { "P1Y1M1DT1M1S", gethours, 0 },
            { "P1Y1M1DT1H1M1S", getminutes, 1 },
            { "P1Y1M1DT1H1S", getminutes, 0 },
            { "P1Y1M1DT1H1M1S", getseconds, 1 },
            { "P1Y1M1DT1H1M", getseconds, 0 },
            { "P1Y1M1DT1H1M100000000S", getseconds, 100000000 }, };
}
DefaultStaticTestData.java 文件源码 项目:openjdk-jdk10 阅读 27 收藏 0 点赞 0 评论 0
/**
 * Test data for DefaultStaticInvokeTest The format of inner array is: First
 * data is the name of the class under test Second data used in test as the
 * arguments used for the method call.
 */
@DataProvider
static Object[][] testClasses() {
    return new Object[][]{
        {"TestClass1", null},
        {"TestClass2", null},
        {"TestClass3", null},
        {"TestClass4", null},
        {"TestClass5", null},
        {"TestClass6", null},
        {"TestClass7", "TestIF7.TestClass7"},
        {"TestClass8", "TestIF8.TestClass8"},
        {"TestClass9", null},
        {"TestClass91", null},
        {"TestClass11", null},
        {"TestClass12", null},
        {"TestClass13", null},
        {"TestClass14", null},
        {"TestClass15", null},
        {"TestClass16", null},
        {"TestClass17", null},
        {"TestClass18", null},
    };
}
TCKLocalizedPrinterParser.java 文件源码 项目:jdk8u-jdk 阅读 30 收藏 0 点赞 0 评论 0
@DataProvider(name="time")
    Object[][] data_time() {
        return new Object[][] {
                {LocalTime.of(11, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.UK},
                {LocalTime.of(11, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.US},
                {LocalTime.of(11, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.FRANCE},
                {LocalTime.of(11, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.JAPAN},

                {LocalTime.of(11, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.UK},
                {LocalTime.of(11, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.US},
                {LocalTime.of(11, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.FRANCE},
                {LocalTime.of(11, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.JAPAN},

                // these localized patterns include "z" which isn't available from LocalTime
//                {LocalTime.of(11, 30), FormatStyle.LONG, DateFormat.LONG, Locale.UK},
//                {LocalTime.of(11, 30), FormatStyle.LONG, DateFormat.LONG, Locale.US},
//                {LocalTime.of(11, 30), FormatStyle.LONG, DateFormat.LONG, Locale.FRANCE},
//                {LocalTime.of(11, 30), FormatStyle.LONG, DateFormat.LONG, Locale.JAPAN},
//
//                {LocalTime.of(11, 30), FormatStyle.FULL, DateFormat.FULL, Locale.UK},
//                {LocalTime.of(11, 30), FormatStyle.FULL, DateFormat.FULL, Locale.US},
//                {LocalTime.of(11, 30), FormatStyle.FULL, DateFormat.FULL, Locale.FRANCE},
//                {LocalTime.of(11, 30), FormatStyle.FULL, DateFormat.FULL, Locale.JAPAN},
        };
    }
TCKPeriod.java 文件源码 项目:openjdk-jdk10 阅读 22 收藏 0 点赞 0 评论 0
@DataProvider(name="BadTemporalUnit")
Object[][] data_badTemporalUnit() {
    return new Object[][] {
        {ChronoUnit.MICROS},
        {ChronoUnit.MILLIS},
        {ChronoUnit.HALF_DAYS},
        {ChronoUnit.DECADES},
        {ChronoUnit.CENTURIES},
        {ChronoUnit.MILLENNIA},
    };
}
TestTextPrinterWithLocale.java 文件源码 项目:openjdk-jdk10 阅读 26 收藏 0 点赞 0 评论 0
@DataProvider(name="print_standalone")
Object[][] provider_StandaloneNames() {
    return new Object[][] {
        // standalone names for 2013-01-01 (Tue)
        // Locale, TemporalField, TextStyle, expected text
        {RUSSIAN, MONTH_OF_YEAR, TextStyle.FULL_STANDALONE,  "\u044f\u043d\u0432\u0430\u0440\u044c"},
        {RUSSIAN, MONTH_OF_YEAR, TextStyle.SHORT_STANDALONE, "\u044f\u043d\u0432."},
        {FINNISH, DAY_OF_WEEK,   TextStyle.FULL_STANDALONE,  "tiistai"},
        {FINNISH, DAY_OF_WEEK,   TextStyle.SHORT_STANDALONE, "ti"},
    };
}
Capacity.java 文件源码 项目:jdk8u-jdk 阅读 29 收藏 0 点赞 0 评论 0
@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},
    };
}
MPredicateHelperTest.java 文件源码 项目:monarch 阅读 32 收藏 0 点赞 0 评论 0
@DataProvider
public static Object[][] getIntData() {
  return new Object[][] {{11L, CompareOp.LESS, 10, true}, {1L, CompareOp.GREATER, 10, true},
      {1L, CompareOp.EQUAL, 1, true}, {1, CompareOp.EQUAL, 1, true},
      {1, CompareOp.NOT_EQUAL, 1, false}, {1, CompareOp.NOT_EQUAL, null, true},
      {null, CompareOp.EQUAL, 1, false}, {null, CompareOp.EQUAL, null, true},
      {null, CompareOp.NOT_EQUAL, null, false}, {null, CompareOp.LESS, null, false},
      {null, CompareOp.LESS_OR_EQUAL, null, true}, {null, CompareOp.GREATER, null, false},
      {null, CompareOp.GREATER_OR_EQUAL, null, true},};
}
TCKZoneId.java 文件源码 项目:jdk8u-jdk 阅读 25 收藏 0 点赞 0 评论 0
@DataProvider(name="toString")
Object[][] data_toString() {
    return new Object[][] {
            {"Europe/London", "Europe/London"},
            {"Europe/Paris", "Europe/Paris"},
            {"Europe/Berlin", "Europe/Berlin"},
            {"Z", "Z"},
            {"+01:00", "+01:00"},
            {"UTC", "UTC"},
            {"UTC+01:00", "UTC+01:00"},
    };
}
MemoryAccessProviderData.java 文件源码 项目:openjdk-jdk10 阅读 25 收藏 0 点赞 0 评论 0
@DataProvider(name = "positiveObject")
public static Object[][] getPositiveObjectJavaKind() {
    HotSpotJVMCIRuntimeProvider runtime = (HotSpotJVMCIRuntimeProvider) JVMCI.getRuntime();
    int offset = new HotSpotVMConfigAccess(runtime.getConfigStore()).getFieldOffset("Klass::_java_mirror", Integer.class, "oop");
    Constant wrappedKlassPointer = ((HotSpotResolvedObjectType) runtime.fromClass(TestClass.class)).klass();
    return new Object[][]{new Object[]{JavaKind.Object, wrappedKlassPointer, (long) offset, TEST_CLASS_CONSTANT, 0}};
}
TransitiveDeps.java 文件源码 项目:openjdk-jdk10 阅读 28 收藏 0 点赞 0 评论 0
@DataProvider(name = "compileTimeView")
public Object[][] expected3() {
    return new Object[][] {
        {"mVII",
         List.of(new ModuleMetaData("mVII.jar")
                    .requires("mVI.jar")
                    .requires("unsafe.jar")
                    .reference("p7.Main", "java.lang.Object", "java.base")
                    .reference("p7.Main", "java.lang.String", "java.base")
                    .reference("p7.Main", "org.safe.Lib", "unsafe.jar")
                    .reference("p7.Main", "p6.safe.Lib", "mVI.jar"),
                new ModuleMetaData("mVI.jar")
                    .requires("unsafe.jar")
                    .reference("p6.indirect.UnsafeRef", "java.lang.Object", "java.base")
                    .reference("p6.indirect.UnsafeRef", "org.unsafe.UseUnsafe ", "unsafe.jar")
                    .reference("p6.safe.Lib", "java.io.PrintStream", "java.base")
                    .reference("p6.safe.Lib", "java.lang.Class", "java.base")
                    .reference("p6.safe.Lib", "java.lang.Object", "java.base")
                    .reference("p6.safe.Lib", "java.lang.String", "java.base")
                    .reference("p6.safe.Lib", "java.lang.System", "java.base")
                    .reference("p6.safe.Lib", "org.safe.Lib", "unsafe.jar"),
                new ModuleMetaData("unsafe.jar")
                    .requires("jdk.unsupported")
                    .reference("org.indirect.UnsafeRef", "java.lang.Object", "java.base")
                    .reference("org.safe.Lib", "java.io.PrintStream", "java.base")
                    .reference("org.safe.Lib", "java.lang.Class", "java.base")
                    .reference("org.safe.Lib", "java.lang.Object", "java.base")
                    .reference("org.safe.Lib", "java.lang.String", "java.base")
                    .reference("org.safe.Lib", "java.lang.System", "java.base")
                    .reference("org.unsafe.UseUnsafe", "java.lang.Object", "java.base")
                    .jdkInternal("org.unsafe.UseUnsafe", "sun.misc.Unsafe", "java.base")
            )
        },
    };
}
CompareToIgnoreCase.java 文件源码 项目:openjdk-jdk10 阅读 24 收藏 0 点赞 0 评论 0
@DataProvider
public Object[][] provider() {
    return new Object[][] {

            new Object[] { STRING_EMPTY, "A", -1 },
            new Object[] { STRING_L1, "a", 0 },
            new Object[] { STRING_L1, "A", 0 },
            new Object[] { STRING_L1, "\uFF21", -65248 },
            new Object[] { STRING_L1, "B", -1 },
            new Object[] { STRING_L2, "AB", 0 },
            new Object[] { STRING_L2, "aB", 0 },
            new Object[] { STRING_L2, "\uFF21", -65248 },
            new Object[] { STRING_L2, "A\uFF21", -65247 },
            new Object[] { STRING_L4, "ABCD", 0 },
            new Object[] { STRING_L4, "abcd", 0 },
            new Object[] { STRING_L4, "ABc\uFF21", -65245 },
            new Object[] { STRING_LLONG, "ABCDEFGH", 0 },
            new Object[] { STRING_LLONG, "abcdefgh", 0 },
            new Object[] { STRING_LLONG, "ABCDEFG\uFF21", -65241 },
            new Object[] { STRING_LLONG, "abcdefg\uFF21", -65241 },
            new Object[] { STRING_U1, "\uFF41", 0 },
            new Object[] { STRING_U1,
                    "\uFF41\uFF42\uFF43\uFF44\uFF45\uFF46\uFF47\uFF48", -7 },
            new Object[] { STRING_U1, "A", 65248 },
            new Object[] { STRING_U2, "\uFF41", 1 },
            new Object[] { STRING_U2, "\uFF41\uFF42", 0 },
            new Object[] { STRING_U2,
                    "\uFF41\uFF42\uFF43\uFF44\uFF45\uFF46\uFF47\uFF48", -6 },
            new Object[] { STRING_M12, "\uFF41a", 0 },
            new Object[] { STRING_M12, "\uFF41\uFF42", -65249 },
            new Object[] { STRING_M11, "a\uFF41", 0 },
            new Object[] { STRING_M11, "a\uFF42", -1 }, };
}
SubList.java 文件源码 项目:openjdk-jdk10 阅读 28 收藏 0 点赞 0 评论 0
/**
 * All kinds of lists
 */
@DataProvider
public static Object[][] all() {
    Object[][] l1 = modifiable();
    Object[][] l2 = unresizable();
    Object[][] res = Arrays.copyOf(l1, l1.length + l2.length);
    System.arraycopy(l2, 0, res, l1.length, l2.length);
    return res;
}
TCKChronoLocalDateTimeSerialization.java 文件源码 项目:openjdk-jdk10 阅读 34 收藏 0 点赞 0 评论 0
@DataProvider(name = "calendars")
Chronology[][] data_of_calendars() {
    return new Chronology[][]{
                {HijrahChronology.INSTANCE},
                {IsoChronology.INSTANCE},
                {JapaneseChronology.INSTANCE},
                {MinguoChronology.INSTANCE},
                {ThaiBuddhistChronology.INSTANCE}};
}


问题


面经


文章

微信
公众号

扫码关注公众号