Search in sources :

Example 11 with StubBlob

use of util.StubBlob in project jdk8u_jdk by JetBrains.

the class SerialBlobTests method test09.

/*
     * Validate calling setBytes() after calling free() throws an
     * SerialException
     */
@Test(expectedExceptions = SerialException.class)
public void test09() throws Exception {
    SerialBlob sb = new SerialBlob(new StubBlob());
    sb.free();
    sb.setBytes(1, new byte[10], 0, 5);
}
Also used : SerialBlob(javax.sql.rowset.serial.SerialBlob) StubBlob(util.StubBlob) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 12 with StubBlob

use of util.StubBlob in project jdk8u_jdk by JetBrains.

the class SerialBlobTests method test26.

/*
     * Validate setBinaryStream returns an OutputStream when passed a Blob
     */
@Test
public void test26() throws Exception {
    SerialBlob sb = new SerialBlob(new StubBlob());
    OutputStream os = sb.setBinaryStream(0);
    assertTrue(os != null);
}
Also used : OutputStream(java.io.OutputStream) SerialBlob(javax.sql.rowset.serial.SerialBlob) StubBlob(util.StubBlob) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 13 with StubBlob

use of util.StubBlob in project jdk8u_jdk by JetBrains.

the class SerialBlobTests method test06.

/*
     * Validate calling position() after calling free() throws an
     * SerialException
     */
@Test(expectedExceptions = SerialException.class)
public void test06() throws Exception {
    SerialBlob sb = new SerialBlob(new StubBlob());
    sb.free();
    sb.position(new StubBlob(), 1);
}
Also used : SerialBlob(javax.sql.rowset.serial.SerialBlob) StubBlob(util.StubBlob) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 14 with StubBlob

use of util.StubBlob in project jdk8u_jdk by JetBrains.

the class SQLInputImplTests method test07.

/*
     * Validate a Blob can be read
     */
@Test(enabled = true)
public void test07() throws Exception {
    Blob b = new StubBlob();
    Object[] values = { b };
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Blob b2 = sqli.readBlob();
    assertTrue(Arrays.equals(b.getBytes(1, (int) b.length()), b2.getBytes(1, (int) b2.length())));
}
Also used : StubBlob(util.StubBlob) Blob(java.sql.Blob) SQLInputImpl(javax.sql.rowset.serial.SQLInputImpl) StubBlob(util.StubBlob) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 15 with StubBlob

use of util.StubBlob in project jdk8u_jdk by JetBrains.

the class SerialBlobTests method test05.

/*
     * Validate calling position() after calling free() throws an
     * SerialException
     */
@Test(expectedExceptions = SerialException.class)
public void test05() throws Exception {
    SerialBlob sb = new SerialBlob(new StubBlob());
    sb.free();
    sb.position(new byte[5], 1);
}
Also used : SerialBlob(javax.sql.rowset.serial.SerialBlob) StubBlob(util.StubBlob) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Aggregations

StubBlob (util.StubBlob)17 SerialBlob (javax.sql.rowset.serial.SerialBlob)16 Test (org.testng.annotations.Test)16 BaseTest (util.BaseTest)16 Blob (java.sql.Blob)3 InputStream (java.io.InputStream)1 OutputStream (java.io.OutputStream)1 Reader (java.io.Reader)1 StringBufferInputStream (java.io.StringBufferInputStream)1 StringReader (java.io.StringReader)1 Array (java.sql.Array)1 Clob (java.sql.Clob)1 Ref (java.sql.Ref)1 SQLInputImpl (javax.sql.rowset.serial.SQLInputImpl)1 SerialArray (javax.sql.rowset.serial.SerialArray)1 SerialClob (javax.sql.rowset.serial.SerialClob)1 SerialRef (javax.sql.rowset.serial.SerialRef)1 DataProvider (org.testng.annotations.DataProvider)1 StubArray (util.StubArray)1 StubBaseRowSet (util.StubBaseRowSet)1