use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test14.
/*
* Validate a SerialException is thrown if len > the length of the stream
* for getBinaryStream
*/
@Test(expectedExceptions = SerialException.class)
public void test14() throws Exception {
SerialBlob sb = new SerialBlob(bytes);
InputStream is = sb.getBinaryStream(0, 3);
}
use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test17.
/*
* Validate a SerialException is thrown if pos > byte array length
*/
@Test(expectedExceptions = SerialException.class)
public void test17() throws Exception {
SerialBlob sb = new SerialBlob(bytes);
InputStream is = sb.getBinaryStream(bytes.length + 2, 6);
}
use of javax.sql.rowset.serial.SerialBlob 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);
}
use of javax.sql.rowset.serial.SerialBlob 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);
}
use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test23.
/*
* Validate that setBytes will properly write a set of bytes to the
* specified location in the SerialBlob and the correct count is returned
* for bytes written
*/
@Test
public void test23() throws Exception {
int bytesToWrite = 3;
byte[] diff = new byte[] { 7, 8, 9, 0 };
byte[] expected = new byte[] { 1, 8, 9, 0, 5 };
SerialBlob sb = new SerialBlob(bytes);
int written = sb.setBytes(2, diff, 1, bytesToWrite);
assertEquals(written, bytesToWrite);
assertTrue(Arrays.equals(sb.getBytes(1, (int) sb.length()), expected), "arrays do not match ");
}
Aggregations