use of org.firebirdsql.gds.ng.wire.FbWireDatabase in project jaybird by FirebirdSQL.
the class TestV10OutputBlob method testIsEof_afterClose.
/**
* Test if blob is eof after close.
*/
@Test
public void testIsEof_afterClose() throws Exception {
try (FbWireDatabase db = createDatabaseConnection()) {
final FbTransaction transaction = getTransaction(db);
try {
FbBlob blob = db.createBlobForOutput(transaction, null);
assumeTrue("Output blob before open should be eof", blob.isEof());
blob.open();
blob.close();
assertTrue("Output blob after close should be eof", blob.isEof());
} finally {
transaction.commit();
}
}
}
use of org.firebirdsql.gds.ng.wire.FbWireDatabase in project jaybird by FirebirdSQL.
the class TestV10OutputBlob method testDoubleOpen.
/**
* Test double open is not allowed.
*/
@Test
public void testDoubleOpen() throws Exception {
expectedException.expect(SQLNonTransientException.class);
expectedException.expect(allOf(errorCodeEquals(ISCConstants.isc_no_segstr_close), fbMessageStartsWith(ISCConstants.isc_no_segstr_close)));
try (FbWireDatabase db = createDatabaseConnection()) {
final FbTransaction transaction = getTransaction(db);
try {
final FbBlob blob = db.createBlobForOutput(transaction, null);
blob.open();
blob.open();
} finally {
transaction.commit();
}
}
}
Aggregations