use of org.testng.annotations.DataProvider in project jdk8u_jdk by JetBrains.
the class Chars method createCharBuffers.
@DataProvider(name = "charbuffers")
public Object[][] createCharBuffers() {
List<CharBuffer> buffers = new ArrayList<>();
// heap
addCases(CharBuffer.allocate(SIZE), buffers);
addCases(CharBuffer.wrap(new char[SIZE]), buffers);
addCases(ByteBuffer.allocate(SIZE * 2).order(ByteOrder.BIG_ENDIAN).asCharBuffer(), buffers);
addCases(ByteBuffer.allocate(SIZE * 2).order(ByteOrder.LITTLE_ENDIAN).asCharBuffer(), buffers);
// direct
addCases(ByteBuffer.allocateDirect(SIZE * 2).order(ByteOrder.BIG_ENDIAN).asCharBuffer(), buffers);
addCases(ByteBuffer.allocateDirect(SIZE * 2).order(ByteOrder.LITTLE_ENDIAN).asCharBuffer(), buffers);
// read-only buffer backed by a CharSequence
buffers.add(CharBuffer.wrap(randomize(CharBuffer.allocate(SIZE))));
Object[][] params = new Object[buffers.size()][];
for (int i = 0; i < buffers.size(); i++) {
CharBuffer cb = buffers.get(i);
params[i] = new Object[] { cb.getClass().getName(), cb };
}
return params;
}
use of org.testng.annotations.DataProvider in project jdk8u_jdk by JetBrains.
the class TCKHijrahChronology method data_resolve_styleByEra.
//-----------------------------------------------------------------------
// Tests for HijrahChronology resolve
//-----------------------------------------------------------------------
@DataProvider(name = "resolve_styleByEra")
Object[][] data_resolve_styleByEra() {
Object[][] result = new Object[ResolverStyle.values().length * HijrahEra.values().length][];
int i = 0;
for (ResolverStyle style : ResolverStyle.values()) {
for (HijrahEra era : HijrahEra.values()) {
result[i++] = new Object[] { style, era };
}
}
return result;
}
use of org.testng.annotations.DataProvider in project jdk8u_jdk by JetBrains.
the class PatternStreamTest method makeStreamTestData.
@DataProvider(name = "Stream<String>")
public static Object[][] makeStreamTestData() {
List<Object[]> data = new ArrayList<>();
String description = "";
String input = "awgqwefg1fefw4vssv1vvv1";
Pattern pattern = Pattern.compile("4");
List<String> expected = new ArrayList<>();
expected.add("awgqwefg1fefw");
expected.add("vssv1vvv1");
// Must match the type signature of the consumer of this data, testStrings
// String, String, Pattern, List<String>
data.add(new Object[] { description, input, pattern, expected });
input = "afbfq£abgwgb£awngnwggw£a£ahjrnhneerh";
pattern = Pattern.compile("£a");
expected = new ArrayList<>();
expected.add("afbfq");
expected.add("bgwgb");
expected.add("wngnwggw");
expected.add("");
expected.add("hjrnhneerh");
data.add(new Object[] { description, input, pattern, expected });
input = "awgqwefg1fefw4vssv1vvv1";
pattern = Pattern.compile("1");
expected = new ArrayList<>();
expected.add("awgqwefg");
expected.add("fefw4vssv");
expected.add("vvv");
data.add(new Object[] { description, input, pattern, expected });
input = "a人fg1fefw人4龜vssv龜1v本本vv";
pattern = Pattern.compile("1");
expected = new ArrayList<>();
expected.add("a人fg");
expected.add("fefw人4龜vssv龜");
expected.add("v本本vv");
data.add(new Object[] { description, input, pattern, expected });
input = "1囚23囚456囚7890";
pattern = Pattern.compile("囚");
expected = new ArrayList<>();
expected.add("1");
expected.add("23");
expected.add("456");
expected.add("7890");
data.add(new Object[] { description, input, pattern, expected });
input = "1囚23龜本本囚456囚龜本7890";
pattern = Pattern.compile("囚");
expected = new ArrayList<>();
expected.add("1");
expected.add("23龜本本");
expected.add("456");
expected.add("龜本7890");
data.add(new Object[] { description, input, pattern, expected });
input = "";
pattern = Pattern.compile("囚");
expected = new ArrayList<>();
data.add(new Object[] { description, input, pattern, expected });
description = "Multiple separators";
input = "This is,testing: with\tdifferent separators.";
pattern = Pattern.compile("[ \t,:.]");
expected = new ArrayList<>();
expected.add("This");
expected.add("is");
expected.add("testing");
expected.add("");
expected.add("with");
expected.add("different");
expected.add("separators");
description = "Repeated separators within and at end";
input = "boo:and:foo";
pattern = Pattern.compile("o");
expected = new ArrayList<>();
expected.add("b");
expected.add("");
expected.add(":and:f");
description = "Many repeated separators within and at end";
input = "booooo:and:fooooo";
pattern = Pattern.compile("o");
expected = new ArrayList<>();
expected.add("b");
expected.add("");
expected.add("");
expected.add("");
expected.add("");
expected.add(":and:f");
description = "Many repeated separators before last match";
input = "fooooo:";
pattern = Pattern.compile("o");
expected = new ArrayList<>();
expected.add("f");
expected.add("");
expected.add("");
expected.add("");
expected.add("");
expected.add(":");
data.add(new Object[] { description, input, pattern, expected });
return data.toArray(new Object[0][]);
}
use of org.testng.annotations.DataProvider in project jdk8u_jdk by JetBrains.
the class TCKDateTimeFormatter method data_format_withZone_withChronology.
//-----------------------------------------------------------------------
// format
//-----------------------------------------------------------------------
@DataProvider(name = "formatWithZoneWithChronology")
Object[][] data_format_withZone_withChronology() {
YearMonth ym = YearMonth.of(2008, 6);
LocalDate ld = LocalDate.of(2008, 6, 30);
LocalTime lt = LocalTime.of(11, 30);
LocalDateTime ldt = LocalDateTime.of(2008, 6, 30, 11, 30);
OffsetTime ot = OffsetTime.of(LocalTime.of(11, 30), OFFSET_PONE);
OffsetDateTime odt = OffsetDateTime.of(LocalDateTime.of(2008, 6, 30, 11, 30), OFFSET_PONE);
ZonedDateTime zdt = ZonedDateTime.of(LocalDateTime.of(2008, 6, 30, 11, 30), ZONE_PARIS);
ChronoZonedDateTime<ThaiBuddhistDate> thaiZdt = ThaiBuddhistChronology.INSTANCE.zonedDateTime(zdt);
Instant instant = Instant.ofEpochSecond(3600);
return new Object[][] { { null, null, DayOfWeek.MONDAY, "::::" }, { null, null, ym, "2008::::ISO" }, { null, null, ld, "2008::::ISO" }, { null, null, lt, ":11:::" }, { null, null, ldt, "2008:11:::ISO" }, { null, null, ot, ":11:+01:00::" }, { null, null, odt, "2008:11:+01:00::ISO" }, { null, null, zdt, "2008:11:+02:00:Europe/Paris:ISO" }, { null, null, instant, "::::" }, { IsoChronology.INSTANCE, null, DayOfWeek.MONDAY, "::::ISO" }, { IsoChronology.INSTANCE, null, ym, "2008::::ISO" }, { IsoChronology.INSTANCE, null, ld, "2008::::ISO" }, { IsoChronology.INSTANCE, null, lt, ":11:::ISO" }, { IsoChronology.INSTANCE, null, ldt, "2008:11:::ISO" }, { IsoChronology.INSTANCE, null, ot, ":11:+01:00::ISO" }, { IsoChronology.INSTANCE, null, odt, "2008:11:+01:00::ISO" }, { IsoChronology.INSTANCE, null, zdt, "2008:11:+02:00:Europe/Paris:ISO" }, { IsoChronology.INSTANCE, null, instant, "::::ISO" }, { null, ZONE_PARIS, DayOfWeek.MONDAY, ":::Europe/Paris:" }, { null, ZONE_PARIS, ym, "2008:::Europe/Paris:ISO" }, { null, ZONE_PARIS, ld, "2008:::Europe/Paris:ISO" }, { null, ZONE_PARIS, lt, ":11::Europe/Paris:" }, { null, ZONE_PARIS, ldt, "2008:11::Europe/Paris:ISO" }, { null, ZONE_PARIS, ot, ":11:+01:00:Europe/Paris:" }, { null, ZONE_PARIS, odt, "2008:12:+02:00:Europe/Paris:ISO" }, { null, ZONE_PARIS, zdt, "2008:11:+02:00:Europe/Paris:ISO" }, { null, ZONE_PARIS, instant, "1970:02:+01:00:Europe/Paris:ISO" }, { null, OFFSET_PTHREE, DayOfWeek.MONDAY, ":::+03:00:" }, { null, OFFSET_PTHREE, ym, "2008:::+03:00:ISO" }, { null, OFFSET_PTHREE, ld, "2008:::+03:00:ISO" }, { null, OFFSET_PTHREE, lt, ":11::+03:00:" }, { null, OFFSET_PTHREE, ldt, "2008:11::+03:00:ISO" }, // offset and zone clash
{ null, OFFSET_PTHREE, ot, null }, { null, OFFSET_PTHREE, odt, "2008:13:+03:00:+03:00:ISO" }, { null, OFFSET_PTHREE, zdt, "2008:12:+03:00:+03:00:ISO" }, { null, OFFSET_PTHREE, instant, "1970:04:+03:00:+03:00:ISO" }, // not a complete date
{ ThaiBuddhistChronology.INSTANCE, null, DayOfWeek.MONDAY, null }, // not a complete date
{ ThaiBuddhistChronology.INSTANCE, null, ym, null }, { ThaiBuddhistChronology.INSTANCE, null, ld, "2551::::ThaiBuddhist" }, { ThaiBuddhistChronology.INSTANCE, null, lt, ":11:::ThaiBuddhist" }, { ThaiBuddhistChronology.INSTANCE, null, ldt, "2551:11:::ThaiBuddhist" }, { ThaiBuddhistChronology.INSTANCE, null, ot, ":11:+01:00::ThaiBuddhist" }, { ThaiBuddhistChronology.INSTANCE, null, odt, "2551:11:+01:00::ThaiBuddhist" }, { ThaiBuddhistChronology.INSTANCE, null, zdt, "2551:11:+02:00:Europe/Paris:ThaiBuddhist" }, { ThaiBuddhistChronology.INSTANCE, null, instant, "::::ThaiBuddhist" }, // not a complete date
{ ThaiBuddhistChronology.INSTANCE, null, DayOfWeek.MONDAY, null }, // not a complete date
{ ThaiBuddhistChronology.INSTANCE, ZONE_PARIS, ym, null }, { ThaiBuddhistChronology.INSTANCE, ZONE_PARIS, ld, "2551:::Europe/Paris:ThaiBuddhist" }, { ThaiBuddhistChronology.INSTANCE, ZONE_PARIS, lt, ":11::Europe/Paris:ThaiBuddhist" }, { ThaiBuddhistChronology.INSTANCE, ZONE_PARIS, ldt, "2551:11::Europe/Paris:ThaiBuddhist" }, { ThaiBuddhistChronology.INSTANCE, ZONE_PARIS, ot, ":11:+01:00:Europe/Paris:ThaiBuddhist" }, { ThaiBuddhistChronology.INSTANCE, ZONE_PARIS, odt, "2551:12:+02:00:Europe/Paris:ThaiBuddhist" }, { ThaiBuddhistChronology.INSTANCE, ZONE_PARIS, zdt, "2551:11:+02:00:Europe/Paris:ThaiBuddhist" }, { ThaiBuddhistChronology.INSTANCE, ZONE_PARIS, instant, "2513:02:+01:00:Europe/Paris:ThaiBuddhist" }, { null, ZONE_PARIS, thaiZdt, "2551:11:+02:00:Europe/Paris:ThaiBuddhist" }, { ThaiBuddhistChronology.INSTANCE, ZONE_PARIS, thaiZdt, "2551:11:+02:00:Europe/Paris:ThaiBuddhist" }, { IsoChronology.INSTANCE, ZONE_PARIS, thaiZdt, "2008:11:+02:00:Europe/Paris:ISO" } };
}
use of org.testng.annotations.DataProvider in project jdk8u_jdk by JetBrains.
the class BaseRowSetTests method testAdvancedParameters.
/*
* DataProvider used to set advanced parameters for types that are supported
*/
@DataProvider(name = "testAdvancedParameters")
private Object[][] testAdvancedParameters() throws SQLException {
byte[] bytes = new byte[10];
Ref aRef = new SerialRef(new StubRef("INTEGER", query));
Array aArray = new SerialArray(new StubArray("INTEGER", new Object[1]));
Blob aBlob = new SerialBlob(new StubBlob());
Clob aClob = new SerialClob(new StubClob());
Reader rdr = new StringReader(query);
InputStream is = new StringBufferInputStream(query);
;
brs = new StubBaseRowSet();
brs.setBytes(1, bytes);
brs.setAsciiStream(2, is, query.length());
brs.setRef(3, aRef);
brs.setArray(4, aArray);
brs.setBlob(5, aBlob);
brs.setClob(6, aClob);
brs.setBinaryStream(7, is, query.length());
brs.setUnicodeStream(8, is, query.length());
brs.setCharacterStream(9, rdr, query.length());
return new Object[][] { { 1, bytes }, { 2, is }, { 3, aRef }, { 4, aArray }, { 5, aBlob }, { 6, aClob }, { 7, is }, { 8, is }, { 9, rdr } };
}
Aggregations