Search in sources :

Example 21 with StubClob

use of util.StubClob in project jdk8u_jdk by JetBrains.

the class SerialClobTests method test20.

/*
     * Validate that a getAsciiStream() returns an InputStream when a Clob is
     * used to create the SerialClob
     */
@Test
public void test20() throws Exception {
    SerialClob sc = new SerialClob(new StubClob());
    InputStream is = sc.getAsciiStream();
    assertTrue(is != null);
}
Also used : InputStream(java.io.InputStream) StubClob(util.StubClob) SerialClob(javax.sql.rowset.serial.SerialClob) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 22 with StubClob

use of util.StubClob 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 23 with StubClob

use of util.StubClob 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 24 with StubClob

use of util.StubClob 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 25 with StubClob

use of util.StubClob in project jdk8u_jdk by JetBrains.

the class SerialClobTests method test07.

/*
     * Validate calling length() after calling free() throws an SerialException
     */
@Test(expectedExceptions = SerialException.class)
public void test07() throws Exception {
    SerialClob sc = new SerialClob(new StubClob());
    sc.free();
    sc.length();
}
Also used : StubClob(util.StubClob) SerialClob(javax.sql.rowset.serial.SerialClob) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Aggregations

StubClob (util.StubClob)25 SerialClob (javax.sql.rowset.serial.SerialClob)24 Test (org.testng.annotations.Test)24 BaseTest (util.BaseTest)24 Clob (java.sql.Clob)3 InputStream (java.io.InputStream)2 Reader (java.io.Reader)2 OutputStream (java.io.OutputStream)1 StringBufferInputStream (java.io.StringBufferInputStream)1 StringReader (java.io.StringReader)1 Writer (java.io.Writer)1 Array (java.sql.Array)1 Blob (java.sql.Blob)1 Ref (java.sql.Ref)1 SQLInputImpl (javax.sql.rowset.serial.SQLInputImpl)1 SerialArray (javax.sql.rowset.serial.SerialArray)1 SerialBlob (javax.sql.rowset.serial.SerialBlob)1 SerialRef (javax.sql.rowset.serial.SerialRef)1 DataProvider (org.testng.annotations.DataProvider)1 StubArray (util.StubArray)1