use of javax.sql.rowset.serial.SerialBlob 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);
}
use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test28.
/*
* Validate that position returns the correct starting location for a
* pattern in the SerialBlob
*/
@Test
public void test28() throws Exception {
// starting offset is 1 vs 0
long expectedPos = 3;
byte[] pattern = new byte[] { 3, 4, 5 };
SerialBlob sb = new SerialBlob(bytes);
long pos = sb.position(pattern, 2);
assertEquals(pos, expectedPos);
}
use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test15.
/*
* Validate a SerialException is thrown if length < 1
*/
@Test(expectedExceptions = SerialException.class)
public void test15() throws Exception {
SerialBlob sb = new SerialBlob(bytes);
InputStream is = sb.getBinaryStream(1, 0);
}
use of javax.sql.rowset.serial.SerialBlob 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);
}
use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test13.
/*
* Validate a SerialException is thrown if pos = 0 for getBinaryStream
*/
@Test(expectedExceptions = SerialException.class)
public void test13() throws Exception {
SerialBlob sb = new SerialBlob(bytes);
InputStream is = sb.getBinaryStream(0, 3);
}
Aggregations