use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test09.
/*
* Validate calling position() after calling free() throws an
* SerialException
*/
@Test(expectedExceptions = SerialException.class)
public void test09() throws Exception {
SerialClob sc = new SerialClob(new StubClob());
sc.free();
sc.position(new StubClob(), 1);
}
use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test33.
/*
* Check that setCharacterStream() returns a non-null Writer for an
* SerialClob created from a Clob
*/
@Test
public void test33() throws Exception {
SerialClob sc = new SerialClob(new StubClob());
Writer w = sc.setCharacterStream(1);
assertTrue(w != null);
}
use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test36.
/*
* Check that getCharacterStream() returns a Reader and that the char[] that
* was specified to create the SerialClob can be returned via the Reader
*/
@Test
public void test36() throws Exception {
SerialClob sc = new SerialClob(chars);
Reader r = sc.getCharacterStream();
for (char c : chars) {
char val = (char) r.read();
assertTrue(c == val, val + " does not match " + c);
}
}
use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test35.
/*
* Check that truncate() truncates the length of the SerialClob to the
* specified size
*/
@Test
public void test35() throws Exception {
SerialClob sc = new SerialClob(new StubClob());
sc.truncate(0);
assertTrue(sc.length() == 0);
sc = new SerialClob(chars);
sc.truncate(5);
assertTrue(sc.length() == 5);
}
use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test22.
/*
* Validate that a getCharacterStream() returns an Reader when a char[] is
* used to create the SerialClob
*/
@Test
public void test22() throws Exception {
SerialClob sc = new SerialClob(chars);
Reader is = sc.getCharacterStream();
assertTrue(is != null);
}
Aggregations