badmap = new HashMap<String, Class<?>>();
badmap.put("Something", HashMap.class);
}
public void testConstructor_ObjectArray() throws SQLException {
assertNotNull(new SerialArray(new SQLArray()));
// OK
sa = new SerialArray(mock);
// array.getArray should not return null
try {
sa = new SerialArray(new MockNullArray());
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
testElements = new Object[5];
testElements[0] = "test1";
testElements[1] = "test2";
testElements[2] = new SQLException();
testElements[3] = new HashMap();
try {
sa = new SerialArray(mock);
fail("should throw NullPointerException");
} catch (NullPointerException e) {
// expected
}
testElements[4] = new Object();
try {
sa = new SerialArray(mock);
// RI fail here
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}