Permalink
Browse files

test: createArrayOf(..., null) test

It is not clear if that should be supported. Adding a case to clarify current behavior
  • Loading branch information...
vlsi committed Mar 4, 2016
1 parent 462928b commit a274321c6ad705ad2517026191634bba9490804f
Showing with 6 additions and 1 deletion.
  1. +6 −1 pgjdbc/src/test/java/org/postgresql/test/jdbc4/ArrayTest.java
@@ -473,7 +473,6 @@ public void testToString() throws SQLException {
@Test
public void nullArray() throws SQLException {
Array arr = con.createArrayOf("float8", null);
PreparedStatement ps = con.prepareStatement("INSERT INTO arrtest(floatarr) VALUES (?)");
ps.setNull(1, Types.ARRAY, "float8");
@@ -488,4 +487,10 @@ public void nullArray() throws SQLException {
Object getObject = rs.getObject(1);
Assert.assertNull("null array should return null on getObject", getObject);
}
@Test(expected = NullPointerException.class)
public void createNullArray() throws SQLException {
Array arr = con.createArrayOf("float8", null);
Assert.fail("createArrayOf(float8, null) should fail with NPE");
}
}

0 comments on commit a274321

Please sign in to comment.