use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test31.
/*
* Check that setString() updates the appropriate characters in the
* SerialClob
*/
@Test
public void test31() throws Exception {
String val = "Hello, I am Bruce Wayne";
String val1 = "the Batman!";
String expected = "Hello, I am the Batman!";
SerialClob sc = new SerialClob(val.toCharArray());
int written = sc.setString(13, val1);
assertEquals(val1.length(), written);
assertTrue(expected.equals(sc.getSubString(1, (int) sc.length())));
}
use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test14.
/*
* Test that SerialException is thrown if pos < 0 on a call to
* getCharacterStream
*/
@Test(expectedExceptions = SerialException.class)
public void test14() throws Exception {
SerialClob sc = new SerialClob(chars);
sc.getCharacterStream(-1, 5);
}
use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test18.
/*
* Test that SerialException is thrown if pos > length on a call to
* getCharacterStream
*/
@Test(expectedExceptions = SerialException.class)
public void test18() throws Exception {
SerialClob sc = new SerialClob(chars);
sc.getCharacterStream(100, 5);
}
use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test30.
/*
* Validate that position() returns the correct value when a SerialClob is
* used for the search argument
*/
@Test
public void test30() throws Exception {
long expectedPos = 17;
String expected = "012";
SerialClob sc = new SerialClob(expected.toCharArray());
SerialClob sc1 = new SerialClob(new StubClob());
long pos = sc1.position(sc, 1);
assertEquals(expectedPos, pos);
}
use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test34.
/*
* Check that setAsciiStream() returns a non-null OutputStream for an SerialClob
* created from a Clob
*/
@Test
public void test34() throws Exception {
SerialClob sc = new SerialClob(new StubClob());
OutputStream os = sc.setAsciiStream(1);
assertTrue(os != null);
}
Aggregations