use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test17.
/*
* Test that SerialException is thrown if length = 0 on a call to
* getCharacterStream
*/
@Test(expectedExceptions = SerialException.class)
public void test17() throws Exception {
SerialClob sc = new SerialClob(chars);
sc.getCharacterStream(1, 0);
}
use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test29.
/*
* Validate that position() returns the correct value when a SerialClob is
* used for the search argument
*/
@Test
public void test29() throws Exception {
long expectedPos = 21;
String expected = "Batman";
String buf = "I am Joker, not the Batman, hahaha";
SerialClob sc = new SerialClob(expected.toCharArray());
SerialClob sc1 = new SerialClob(buf.toCharArray());
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 test38.
/*
* Validate that a SerialClob that is serialized & deserialized is equal to
* itself
*/
@Test
public void test38() throws Exception {
SerialClob sc = new SerialClob(chars);
SerialClob sc2 = serializeDeserializeObject(sc);
assertTrue(sc.equals(sc2), "SerialClobs not equal");
}
use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test11.
/*
* Validate calling setCharacterStream() after calling free() throws an
* SerialException
*/
@Test(expectedExceptions = SerialException.class)
public void test11() throws Exception {
SerialClob sc = new SerialClob(new StubClob());
sc.free();
sc.setCharacterStream(5);
}
use of javax.sql.rowset.serial.SerialClob in project jdk8u_jdk by JetBrains.
the class SerialClobTests method test25.
/*
* Validate that position() returns the correct value when a Clob is used to
* create the SerialClob
*/
@Test
public void test25() throws Exception {
long expectedPos = 5;
SerialClob sc = new SerialClob(new StubClob());
String expected = "test string";
long pos = sc.position(expected, 1);
assertEquals(expectedPos, pos);
}
Aggregations