use of util.StubBaseRowSet in project jdk8u_jdk by JetBrains.
the class BaseRowSetTests method baseRowSetTest0011.
/*
* Validate setNull specifying the supported type values
*/
@Test(dataProvider = "jdbcTypes")
public void baseRowSetTest0011(Integer type) throws Exception {
brs = new StubBaseRowSet();
brs.setNull(1, type);
assertTrue(checkNullParam(1, type, null));
}
use of util.StubBaseRowSet 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 } };
}
use of util.StubBaseRowSet in project jdk8u_jdk by JetBrains.
the class BaseRowSetTests method testBaseParameters.
/*
* DataProvider used to set parameters for basic types that are supported
*/
@DataProvider(name = "testBaseParameters")
private Object[][] testBaseParameters() throws SQLException {
Integer aInt = 1;
Long aLong = Long.MAX_VALUE;
Short aShort = Short.MIN_VALUE;
BigDecimal bd = BigDecimal.ONE;
Double aDouble = Double.MAX_VALUE;
Date aDate = Date.valueOf(LocalDate.now());
Time aTime = Time.valueOf(LocalTime.now());
Timestamp aTimeStamp = Timestamp.valueOf(LocalDateTime.now());
Calendar cal = Calendar.getInstance();
Boolean aBoolean = true;
Float aFloat = 1.5f;
Byte aByte = 1;
brs = new StubBaseRowSet();
brs.setInt(1, aInt);
brs.setString(2, query);
brs.setLong(3, aLong);
brs.setBoolean(4, aBoolean);
brs.setShort(5, aShort);
brs.setDouble(6, aDouble);
brs.setBigDecimal(7, bd);
brs.setFloat(8, aFloat);
brs.setByte(9, aByte);
brs.setDate(10, aDate);
brs.setTime(11, aTime);
brs.setTimestamp(12, aTimeStamp);
brs.setDate(13, aDate, cal);
brs.setTime(14, aTime, cal);
brs.setTimestamp(15, aTimeStamp);
brs.setObject(16, query);
brs.setObject(17, query, Types.CHAR);
brs.setObject(18, query, Types.CHAR, 0);
return new Object[][] { { 1, aInt }, { 2, query }, { 3, aLong }, { 4, aBoolean }, { 5, aShort }, { 6, aDouble }, { 7, bd }, { 8, aFloat }, { 9, aByte }, { 10, aDate }, { 11, aTime }, { 12, aTimeStamp }, { 13, aDate }, { 14, aTime }, { 15, aTimeStamp }, { 16, query }, { 17, query }, { 18, query } };
}
use of util.StubBaseRowSet in project jdk8u_jdk by JetBrains.
the class BaseRowSetTests method baseRowSetTest0013.
/*
* Validate that setDate sets the specified Calendar internally
*/
@Test()
public void baseRowSetTest0013() throws Exception {
Calendar cal = Calendar.getInstance();
brs = new StubBaseRowSet();
brs.setDate(1, Date.valueOf(LocalDate.now()), cal);
assertTrue(checkCalendarParam(1, cal));
}
use of util.StubBaseRowSet in project jdk8u_jdk by JetBrains.
the class BaseRowSetTests method baseRowSetTest0015.
/*
* Validate that setTimestamp sets the specified Calendar internally
*/
@Test()
public void baseRowSetTest0015() throws Exception {
Calendar cal = Calendar.getInstance();
brs = new StubBaseRowSet();
brs.setTimestamp(1, Timestamp.valueOf(LocalDateTime.now()), cal);
assertTrue(checkCalendarParam(1, cal));
}
Aggregations