Search in sources :

Example 6 with StubClob

use of util.StubClob in project jdk8u_jdk by JetBrains.

the class SerialClobTests method test03.

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

Example 7 with StubClob

use of util.StubClob in project jdk8u_jdk by JetBrains.

the class SerialClobTests method test12.

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

Example 8 with StubClob

use of util.StubClob in project jdk8u_jdk by JetBrains.

the class SerialClobTests method test21.

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

Example 9 with StubClob

use of util.StubClob in project jdk8u_jdk by JetBrains.

the class SerialClobTests method test24.

/*
     * Validate that a getSubString() returns the correct value when a Clob is
     * used to create the SerialClob
     */
@Test
public void test24() throws Exception {
    SerialClob sc = new SerialClob(new StubClob());
    String expected = "test string";
    assertEquals(expected, sc.getSubString(5, 11));
}
Also used : StubClob(util.StubClob) SerialClob(javax.sql.rowset.serial.SerialClob) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 10 with StubClob

use of util.StubClob in project jdk8u_jdk by JetBrains.

the class SerialClobTests method test05.

/*
     * Validate calling truncate() after calling free() throws an
     * SerialException
     */
@Test(expectedExceptions = SerialException.class)
public void test05() throws Exception {
    SerialClob sc = new SerialClob(new StubClob());
    sc.free();
    sc.truncate(1);
}
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