use of javax.sql.rowset.serial.SQLInputImpl in project jdk8u_jdk by JetBrains.
the class SQLOutputImplTests method test03.
/*
* Read in the various datatypes via readSQL (which will exercise the
* various readXXX methods and validate that results are as expected
*/
@Test()
public void test03() throws Exception {
impl.readSQL(new SQLInputImpl(typeValues, map), "misc");
impl.writeSQL(outImpl);
assertTrue(Arrays.equals(results.toArray(), typeValues));
// Null out a field and make sure the arrays do not match
typeValues[2] = null;
assertFalse(Arrays.equals(results.toArray(), typeValues));
}
use of javax.sql.rowset.serial.SQLInputImpl in project jdk8u_jdk by JetBrains.
the class SQLInputImplTests method test06.
/*
* Validate a Array can be read
*/
@Test(enabled = true)
public void test06() throws Exception {
Object[] coffees = new Object[] { "Espresso", "Colombian", "French Roast", "Cappuccino" };
Array a = new StubArray("VARCHAR", coffees);
Object[] values = { a };
SQLInputImpl sqli = new SQLInputImpl(values, map);
Array a2 = sqli.readArray();
assertTrue(Arrays.equals((Object[]) a2.getArray(), (Object[]) a.getArray()));
assertTrue(a.getBaseTypeName().equals(a2.getBaseTypeName()));
}
use of javax.sql.rowset.serial.SQLInputImpl in project jdk8u_jdk by JetBrains.
the class SQLInputImplTests method test08.
/*
* Validate a Clob can be read
*/
@Test(enabled = true)
public void test08() throws Exception {
Clob c = new StubClob();
Object[] values = { c };
SQLInputImpl sqli = new SQLInputImpl(values, map);
Clob c2 = sqli.readClob();
assertTrue(c.getSubString(1, (int) c.length()).equals(c2.getSubString(1, (int) c2.length())));
}
use of javax.sql.rowset.serial.SQLInputImpl in project jdk8u_jdk by JetBrains.
the class SQLInputImplTests method test07.
/*
* Validate a Blob can be read
*/
@Test(enabled = true)
public void test07() throws Exception {
Blob b = new StubBlob();
Object[] values = { b };
SQLInputImpl sqli = new SQLInputImpl(values, map);
Blob b2 = sqli.readBlob();
assertTrue(Arrays.equals(b.getBytes(1, (int) b.length()), b2.getBytes(1, (int) b2.length())));
}
use of javax.sql.rowset.serial.SQLInputImpl in project jdk8u_jdk by JetBrains.
the class SQLInputImplTests method test10.
/*
* Validate a URL can be read
*/
@Test(enabled = true)
public void test10() throws Exception {
URL u = new URL("http://www.oracle.com/");
;
Object[] values = { u };
SQLInputImpl sqli = new SQLInputImpl(values, map);
URL u2 = sqli.readURL();
assertTrue(u2.equals(u));
assertTrue(u2.sameFile(u));
}
Aggregations