use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test15.
/*
* Test that SerialException is thrown if pos = 0 on a call to
* getCharacterStream
*/
@Test(expectedExceptions = SerialException.class)
public void test15() throws Exception {
SerialClob sc = new SerialClob(chars);
sc.getCharacterStream(0, 5);
}
use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test32.
/*
* Check that setString() updates the appropriate characters in the
* SerialClob
*/
@Test(enabled = false)
public void test32() throws Exception {
int expectedWritten = 9;
String val = "Hi, I am Catwoman!!!!!!";
String val1 = "Hahaha the Joker, who are you?!";
String expected = "Hi, I am the Joker!";
SerialClob sc = new SerialClob(val.toCharArray());
int written = sc.setString(10, val1, 8, expectedWritten + 1);
assertEquals(written, expectedWritten);
}
use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test27.
/*
* Validate that position() returned is -1 when an the search string is not
* part of the SerialClob
*/
@Test
public void test27() throws Exception {
long expectedPos = -1;
SerialClob sc = new SerialClob(new StubClob());
String expected = "I am Batman";
long pos = sc.position(expected, 2);
assertEquals(expectedPos, pos);
}
use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test10.
/*
* Validate calling setAsciiStream() after calling free() throws an
* SerialException
*/
@Test(expectedExceptions = SerialException.class)
public void test10() throws Exception {
SerialClob sc = new SerialClob(new StubClob());
sc.free();
sc.setAsciiStream(5);
}
use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test37.
/*
* Check that getCharacterStream() returns a Reader and that the char[] that
* was specified to create the SerialClob can be returned via the Reader
*/
@Test(enabled = false)
public void test37() throws Exception {
SerialClob sc = new SerialClob(chars);
String expected = "ello w";
Reader r = sc.getCharacterStream(2, 6);
for (char c : expected.toCharArray()) {
char val = (char) r.read();
assertTrue(c == val, val + " does not match " + c);
}
}
Aggregations