Пример #1
0
  private void testReadClob(boolean close) throws Exception {
    byte[] result = null;
    String data = "ZIP";

    when(clob.getAsciiStream()).thenReturn(new ByteArrayInputStream(data.getBytes()));

    if (close == true) {
      result = TypeHandlerUtils.readClob(clob);
    } else {
      result = TypeHandlerUtils.readClob(clob, false);
    }

    Assert.assertEquals(data, new String(result));
  }
Пример #2
0
 private void testConvertClobPrepare() throws SQLException, MjdbcException {
   // when(conn.createClob()).thenReturn(clob);
   when(MappingUtils.invokeFunction(conn, "createClob", new Class[] {}, new Object[] {}))
       .thenReturn(clob);
   when(clob.setAsciiStream(1)).thenReturn(output);
 }