@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(); }
@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)); }
@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" }, }; }
@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},}; }
@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}, }; }
@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}, }; }
@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(); }
@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}, }; }
@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}, }; }
@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}, }; }
@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}, }; }
@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"}, }; }
@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 }; }
@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 } }; }
@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}, }; }
@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); }
@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}, }; }
@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 }, }; }
/** * 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}, }; }
@DataProvider(name="BadTemporalUnit") Object[][] data_badTemporalUnit() { return new Object[][] { {ChronoUnit.MICROS}, {ChronoUnit.MILLIS}, {ChronoUnit.HALF_DAYS}, {ChronoUnit.DECADES}, {ChronoUnit.CENTURIES}, {ChronoUnit.MILLENNIA}, }; }
@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"}, }; }
@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}, }; }
@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},}; }
@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"}, }; }
@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}}; }
@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") ) }, }; }
@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 }, }; }
/** * 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; }
@DataProvider(name = "calendars") Chronology[][] data_of_calendars() { return new Chronology[][]{ {HijrahChronology.INSTANCE}, {IsoChronology.INSTANCE}, {JapaneseChronology.INSTANCE}, {MinguoChronology.INSTANCE}, {ThaiBuddhistChronology.INSTANCE}}; }
@DataProvider(name = "GeneralTestsData") private Object[][] xmls() { return new Object[][] { { "|<xsl:value-of select=\"substring('asdf',2, 1)\"/>|", "<t>|s|</t>"}, { "|<xsl:value-of select=\"substring('asdf',2, 1 div 0)\"/>|", "<t>|sdf|</t>"}, { "|<xsl:value-of select=\"substring('asdf',2, -0 div 0)\"/>|", "<t>||</t>" }, { "|<xsl:value-of select=\"substring('asdf',2, 1 div 0)\"/>|", "<t>|sdf|</t>" }, // 8076290 bug test case { "|<xsl:value-of select=\"substring('123', 0, 3)\"/>|", "<t>|12|</t>"}, }; }
@DataProvider(name = "Map<IntegerEnum,String>", parallel = true) private static Iterator<Object[]> makeMaps() { return Arrays.asList( // empty new Object[]{"HashMap", new HashMap()}, new Object[]{"LinkedHashMap", new LinkedHashMap()}, new Object[]{"Collections.checkedMap(HashMap)", Collections.checkedMap(new HashMap(), IntegerEnum.class, String.class)}, new Object[]{"Collections.synchronizedMap(HashMap)", Collections.synchronizedMap(new HashMap())}, // null hostile new Object[]{"EnumMap", new EnumMap(IntegerEnum.class)}, new Object[]{"Hashtable", new Hashtable()}, new Object[]{"TreeMap", new TreeMap()}, new Object[]{"ConcurrentHashMap", new ConcurrentHashMap()}, new Object[]{"ConcurrentSkipListMap", new ConcurrentSkipListMap()}, new Object[]{"Collections.checkedMap(ConcurrentHashMap)", Collections.checkedMap(new ConcurrentHashMap(), IntegerEnum.class, String.class)}, new Object[]{"Collections.synchronizedMap(EnumMap)", Collections.synchronizedMap(new EnumMap(IntegerEnum.class))}, // filled new Object[]{"HashMap", fillMap(new HashMap())}, new Object[]{"LinkedHashMap", fillMap(new LinkedHashMap())}, new Object[]{"Collections.checkedMap(HashMap)", Collections.checkedMap(fillMap(new HashMap()), IntegerEnum.class, String.class)}, new Object[]{"Collections.synchronizedMap(HashMap)", Collections.synchronizedMap(fillMap(new HashMap()))}, // null hostile new Object[]{"EnumMap", fillMap(new EnumMap(IntegerEnum.class))}, new Object[]{"Hashtable", fillMap(new Hashtable())}, new Object[]{"TreeMap", fillMap(new TreeMap())}, new Object[]{"ConcurrentHashMap", fillMap(new ConcurrentHashMap())}, new Object[]{"ConcurrentSkipListMap", fillMap(new ConcurrentSkipListMap())}, new Object[]{"Collections.checkedMap(ConcurrentHashMap)", Collections.checkedMap(fillMap(new ConcurrentHashMap()), IntegerEnum.class, String.class)}, new Object[]{"Collections.synchronizedMap(EnumMap)", Collections.synchronizedMap(fillMap(new EnumMap(IntegerEnum.class)))}).iterator(); }
@DataProvider(name = "invalidSerialformClasses") Object[][] invalid_serial_classes() { return new Object[][]{ {JapaneseEra.class}, {JapaneseDate.class}, {MinguoDate.class}, {ThaiBuddhistDate.class}, {HijrahDate.class}, }; }
@DataProvider(name = "rowsetUsingCoffees") protected Object[][] rowsetUsingCoffees() throws Exception { RowSet rs = createCoffeesRowSet(); return new Object[][]{ {rs} }; }
@DataProvider public static Object[][] getKeyData() { return new Object[][]{ {"non.existent.key", "application_id_00001345_0001", "application_id_00001345_0001-"}, {MonarchRecordWriter.MAPREDUCE_TASK_ID, "", ""}, {MonarchRecordWriter.MAPREDUCE_TASK_ID, "application00001340011", ""}, {MonarchRecordWriter.MAPREDUCE_TASK_ID, "application_id_00001345_0011", "0011-"}, {MonarchRecordWriter.MAPREDUCE_TASK_PARTITION, "0", "0-"}, {MonarchRecordWriter.MAPREDUCE_TASK_PARTITION, "application_id_00001345_0011", "application_id_00001345_0011-"}, {null, "application_id_00001345_0001", "application_id_00001345_0001-"}, }; }
@DataProvider(name="atStartOfDay") Object[][] data_atStartOfDay() { return new Object[][] { {LocalDate.of(2008, 6, 30), LocalDateTime.of(2008, 6, 30, 0, 0)}, {LocalDate.of(-12, 6, 30), LocalDateTime.of(-12, 6, 30, 0, 0)}, }; }
@DataProvider(name="with_longTemporalField") Object[][] data_with_longTemporalField() { return new Object[][]{ {Instant.ofEpochSecond(10, 200), ChronoField.INSTANT_SECONDS, 100, Instant.ofEpochSecond(100, 200), null}, {Instant.ofEpochSecond(10, 200), ChronoField.INSTANT_SECONDS, 0, Instant.ofEpochSecond(0, 200), null}, {Instant.ofEpochSecond(10, 200), ChronoField.INSTANT_SECONDS, -100, Instant.ofEpochSecond(-100, 200), null}, {Instant.ofEpochSecond(10, 200), ChronoField.NANO_OF_SECOND, 100, Instant.ofEpochSecond(10, 100), null}, {Instant.ofEpochSecond(10, 200), ChronoField.NANO_OF_SECOND, 0, Instant.ofEpochSecond(10), null}, {Instant.ofEpochSecond(10, 200), ChronoField.MICRO_OF_SECOND, 100, Instant.ofEpochSecond(10, 100*1000), null}, {Instant.ofEpochSecond(10, 200), ChronoField.MICRO_OF_SECOND, 0, Instant.ofEpochSecond(10), null}, {Instant.ofEpochSecond(10, 200), ChronoField.MILLI_OF_SECOND, 100, Instant.ofEpochSecond(10, 100*1000*1000), null}, {Instant.ofEpochSecond(10, 200), ChronoField.MILLI_OF_SECOND, 0, Instant.ofEpochSecond(10), null}, {Instant.ofEpochSecond(10, 200), ChronoField.NANO_OF_SECOND, 1000000000L, null, DateTimeException.class}, {Instant.ofEpochSecond(10, 200), ChronoField.MICRO_OF_SECOND, 1000000, null, DateTimeException.class}, {Instant.ofEpochSecond(10, 200), ChronoField.MILLI_OF_SECOND, 1000, null, DateTimeException.class}, {Instant.ofEpochSecond(10, 200), ChronoField.SECOND_OF_MINUTE, 1, null, DateTimeException.class}, {Instant.ofEpochSecond(10, 200), ChronoField.SECOND_OF_DAY, 1, null, DateTimeException.class}, {Instant.ofEpochSecond(10, 200), ChronoField.OFFSET_SECONDS, 1, null, DateTimeException.class}, {Instant.ofEpochSecond(10, 200), ChronoField.NANO_OF_DAY, 1, null, DateTimeException.class}, {Instant.ofEpochSecond(10, 200), ChronoField.MINUTE_OF_HOUR, 1, null, DateTimeException.class}, {Instant.ofEpochSecond(10, 200), ChronoField.MINUTE_OF_DAY, 1, null, DateTimeException.class}, {Instant.ofEpochSecond(10, 200), ChronoField.MILLI_OF_DAY, 1, null, DateTimeException.class}, {Instant.ofEpochSecond(10, 200), ChronoField.MICRO_OF_DAY, 1, null, DateTimeException.class}, }; }
@DataProvider(name="weekDate") Iterator<Object[]> weekDate() { return new Iterator<Object[]>() { private ZonedDateTime date = ZonedDateTime.of(LocalDateTime.of(2003, 12, 29, 11, 5, 30), ZoneId.of("Europe/Paris")); private ZonedDateTime endDate = date.withYear(2005).withMonth(1).withDayOfMonth(2); private int week = 1; private int day = 1; public boolean hasNext() { return !date.isAfter(endDate); } public Object[] next() { StringBuilder sb = new StringBuilder("2004-W"); if (week < 10) { sb.append('0'); } sb.append(week).append('-').append(day).append(date.getOffset()); Object[] ret = new Object[] {date, sb.toString()}; date = date.plusDays(1); day += 1; if (day == 8) { day = 1; week++; } return ret; } public void remove() { throw new UnsupportedOperationException(); } }; }
@DataProvider(name = "nodes") public Object[][] createSizes() { List<Object[]> params = new ArrayList<>(); for (int size : Arrays.asList(0, 1, 4, 15, 16, 17, 127, 128, 129, 1000)) { Integer[] array = new Integer[size]; for (int i = 0; i < array.length; i++) { array[i] = i; } List<Node<Integer>> nodes = new ArrayList<>(); nodes.add(Nodes.node(array)); nodes.add(Nodes.node(Arrays.asList(array))); nodes.add(degenerateTree(Arrays.asList(array).iterator())); nodes.add(tree(Arrays.asList(array), l -> Nodes.node(l.toArray(new Integer[l.size()])))); nodes.add(tree(Arrays.asList(array), l -> Nodes.node(l))); nodes.add(fill(array, Nodes.builder(array.length, LambdaTestHelpers.integerArrayGenerator))); nodes.add(fill(array, Nodes.builder())); for (int i = 0; i < nodes.size(); i++) { params.add(new Object[]{array, nodes.get(i)}); } } return params.toArray(new Object[0][]); }