use of javax.sql.rowset.serial.SQLInputImpl in project jdk8u_jdk by JetBrains.
the class SQLInputImplTests method test09.
/*
* Validate a Ref can be read
*/
@Test(enabled = true)
public void test09() throws Exception {
Ref ref = new StubRef(sqlType, hero);
Object[] values = { ref };
SQLInputImpl sqli = new SQLInputImpl(values, map);
Ref ref2 = sqli.readRef();
assertTrue(ref.getObject().equals(ref2.getObject()));
assertTrue(ref.getBaseTypeName().equals(ref2.getBaseTypeName()));
}
use of javax.sql.rowset.serial.SQLInputImpl in project jdk8u_jdk by JetBrains.
the class SQLInputImplTests method test11.
/*
* Validate that readObject returns the correct value when a Struct is
* next on the stream
*/
@Test()
public void test11() throws Exception {
Object[] attributes = new Object[] { "Bruce", "Wayne", 1939, "Batman" };
map.put(sqlType, Class.forName("util.SuperHero"));
Struct struct = new StubStruct(sqlType, attributes);
Object[] values = { struct };
SQLInputImpl sqli = new SQLInputImpl(values, map);
Object o = sqli.readObject();
assertTrue(hero.equals(o));
}
use of javax.sql.rowset.serial.SQLInputImpl in project jdk8u_jdk by JetBrains.
the class SQLInputImplTests 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");
assertTrue(Arrays.equals(impl.toArray(), typeValues));
// Null out a field and make sure the arrays do not match
typeValues[2] = null;
assertFalse(Arrays.equals(impl.toArray(), typeValues));
}
use of javax.sql.rowset.serial.SQLInputImpl in project jdk8u_jdk by JetBrains.
the class SQLInputImplTests method test04.
/*
* Validate that wasNull indicates if a null was read in
*/
@Test()
public void test04() throws Exception {
Object[] values = { "Hello", null, 1 };
SQLInputImpl sqli = new SQLInputImpl(values, map);
String s = sqli.readString();
assertFalse(sqli.wasNull());
s = sqli.readString();
assertTrue(sqli.wasNull());
int i = sqli.readInt();
assertFalse(sqli.wasNull());
}
use of javax.sql.rowset.serial.SQLInputImpl in project jdk8u_jdk by JetBrains.
the class SQLInputImplTests method test05.
/*
* Validate that readObject returns the correct value
*/
@Test()
public void test05() throws Exception {
Object[] values = { hero };
SQLInputImpl sqli = new SQLInputImpl(values, map);
Object o = sqli.readObject();
assertTrue(hero.equals(o));
}
Aggregations