use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test25.
/*
* Validate getBinaryStream returns the correct bytes
*/
@Test
public void test25() throws Exception {
byte[] expected = bytes;
SerialBlob sb = new SerialBlob(bytes);
InputStream is = sb.getBinaryStream();
for (byte b : expected) {
byte val = (byte) is.read();
assertTrue(b == val, val + " does not match " + b);
}
}
use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test08.
/*
* Validate calling free() after calling setBytes() throws an
* SerialException
*/
@Test(expectedExceptions = SerialException.class)
public void test08() throws Exception {
SerialBlob sb = new SerialBlob(new StubBlob());
sb.free();
sb.setBytes(1, new byte[5]);
}
use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test16.
/*
* Validate a SerialException is thrown if length > byte array length
*/
@Test(expectedExceptions = SerialException.class)
public void test16() throws Exception {
SerialBlob sb = new SerialBlob(bytes);
InputStream is = sb.getBinaryStream(1, 6);
}
use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test04.
/*
* Validate calling getLength() after calling free() throws an
* SerialException
*/
@Test(expectedExceptions = SerialException.class)
public void test04() throws Exception {
SerialBlob sb = new SerialBlob(new StubBlob());
sb.free();
sb.length();
}
use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test10.
/*
* Validate calling truncate() after calling free() throws an
* SerialException
*/
@Test(expectedExceptions = SerialException.class)
public void test10() throws Exception {
SerialBlob sb = new SerialBlob(new StubBlob());
sb.free();
sb.truncate(1);
}
Aggregations