Search in sources :

Example 6 with SerialClob

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);
}
Also used : SerialClob(javax.sql.rowset.serial.SerialClob) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 7 with SerialClob

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);
}
Also used : SerialClob(javax.sql.rowset.serial.SerialClob) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 8 with SerialClob

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");
}
Also used : SerialClob(javax.sql.rowset.serial.SerialClob) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 9 with SerialClob

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);
}
Also used : StubClob(util.StubClob) SerialClob(javax.sql.rowset.serial.SerialClob) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 10 with SerialClob

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);
}
Also used : StubClob(util.StubClob) SerialClob(javax.sql.rowset.serial.SerialClob) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Aggregations

SerialClob (javax.sql.rowset.serial.SerialClob)43 Test (org.testng.annotations.Test)40 BaseTest (util.BaseTest)40 StubClob (util.StubClob)24 Reader (java.io.Reader)5 InputStream (java.io.InputStream)2 Clob (java.sql.Clob)2 SerialArray (javax.sql.rowset.serial.SerialArray)2 SerialBlob (javax.sql.rowset.serial.SerialBlob)2 OutputStream (java.io.OutputStream)1 StringBufferInputStream (java.io.StringBufferInputStream)1 StringReader (java.io.StringReader)1 Writer (java.io.Writer)1 BigDecimal (java.math.BigDecimal)1 Array (java.sql.Array)1 Blob (java.sql.Blob)1 Ref (java.sql.Ref)1 SQLException (java.sql.SQLException)1 SQLInputImpl (javax.sql.rowset.serial.SQLInputImpl)1 SerialRef (javax.sql.rowset.serial.SerialRef)1