Search in sources :

Example 36 with SerialClob

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

Example 37 with SerialClob

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

Example 38 with SerialClob

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

Example 39 with SerialClob

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

Example 40 with SerialClob

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);
}
Also used : Reader(java.io.Reader) 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