use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test03.
/*
* Validate calling getBytes() after calling free() throws an
* SerialException
*/
@Test(expectedExceptions = SerialException.class)
public void test03() throws Exception {
SerialBlob sb = new SerialBlob(new StubBlob());
sb.free();
sb.getBytes(1, 1);
}
use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test21.
/*
* Validate a SerialException is thrown if byte[] is used to
* create the SeriablBlob and setBinaryStream is called
*/
@Test(expectedExceptions = SerialException.class)
public void test21() throws Exception {
SerialBlob sb = new SerialBlob(bytes);
sb.setBinaryStream(3);
}
use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test12.
/*
* Validate a SerialException is thrown if pos < 0 for getBinaryStream
*/
@Test(expectedExceptions = SerialException.class)
public void test12() throws Exception {
SerialBlob sb = new SerialBlob(bytes);
InputStream is = sb.getBinaryStream(-1, 3);
}
use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test07.
/*
* Validate calling free() after calling setBinaryStream() throws an
* SerialException
*/
@Test(expectedExceptions = SerialException.class)
public void test07() throws Exception {
SerialBlob sb = new SerialBlob(new StubBlob());
sb.free();
sb.setBinaryStream(5);
}
use of javax.sql.rowset.serial.SerialBlob in project jdk8u_jdk by JetBrains.
the class SerialBlobTests method test30.
/*
* Validate that position returns the correct starting location for a
* pattern in the SerialBlob
*/
@Test
public void test30() throws Exception {
// starting offset is 1 vs 0
long expectedPos = 3;
byte[] pattern = new byte[] { 6, 8 };
SerialBlob sb = new SerialBlob(new StubBlob());
long pos = sb.position(pattern, 2);
assertEquals(pos, expectedPos);
}
Aggregations