use of util.StubArray 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 util.StubArray in project jdk8u_jdk by JetBrains.
the class SQLOutputImplTests method test04.
/*
* Validate a Array can be written and returned
*/
@Test(enabled = true)
public void test04() throws Exception {
Object[] coffees = new Object[] { "Espresso", "Colombian", "French Roast", "Cappuccino" };
Array a = new StubArray("VARCHAR", coffees);
outImpl.writeArray(a);
SerialArray sa = (SerialArray) results.get(0);
assertTrue(Arrays.equals(coffees, (Object[]) sa.getArray()));
assertTrue(a.getBaseTypeName().equals(sa.getBaseTypeName()));
}
Aggregations