use of util.StubStruct 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 util.StubStruct in project jdk8u_jdk by JetBrains.
the class SerialStructTests method setUpMethod.
@BeforeMethod
public void setUpMethod() throws Exception {
attributes = new Object[] { "Bruce", "Wayne", 1939, "Batman" };
map.put(sqlType, Class.forName("util.SuperHero"));
struct = new StubStruct(sqlType, attributes);
hero = new SuperHero(sqlType, "Bruce", "Wayne", 1939, "Batman");
}
use of util.StubStruct in project jdk8u_jdk by JetBrains.
the class SQLOutputImplTests method test08.
/*
* Validate a Struct can be written and returned
*/
@Test(enabled = true)
public void test08() throws Exception {
Object[] attributes = new Object[] { "Bruce", "Wayne", 1939, "Batman" };
Struct s = new StubStruct(sqlType, attributes);
outImpl.writeStruct(s);
SerialStruct ss = (SerialStruct) results.get(0);
assertTrue(Arrays.equals(attributes, (Object[]) ss.getAttributes()));
assertTrue(sqlType.equals(ss.getSQLTypeName()));
}
Aggregations