use of org.rocksdb.Status in project zeebe by camunda.
the class ZeebeRocksDbTransactionTest method shouldThrowRecoverableExceptionInTransactionCommit.
@Test(expected = ZeebeDbException.class)
public void shouldThrowRecoverableExceptionInTransactionCommit() throws Exception {
// given
final Status status = new Status(Code.IOError, SubCode.None, "");
final ZeebeTransaction currentTransaction = spy((ZeebeTransaction) transactionContext.getCurrentTransaction());
doThrow(new RocksDBException("expected", status)).when(currentTransaction).commitInternal();
// when
currentTransaction.commit();
}
use of org.rocksdb.Status in project zeebe by camunda.
the class ZeebeRocksDbTransactionTest method shouldReThrowExceptionFromTransactionRun.
@Test(expected = RocksDBException.class)
public void shouldReThrowExceptionFromTransactionRun() throws Exception {
// given
final Status status = new Status(Code.NotSupported, SubCode.None, "");
// when
final ZeebeDbTransaction currentTransaction = transactionContext.getCurrentTransaction();
currentTransaction.run(() -> {
throw new RocksDBException("expected", status);
});
}
use of org.rocksdb.Status in project zeebe by camunda.
the class ZeebeRocksDbTransactionTest method shouldThrowRecoverableExceptionOnCommit.
@Test(expected = ZeebeDbException.class)
public void shouldThrowRecoverableExceptionOnCommit() throws Exception {
// given
final ZeebeTransaction transaction = mock(ZeebeTransaction.class);
final TransactionContext newContext = new DefaultTransactionContext(transaction);
final Status status = new Status(Code.IOError, SubCode.None, "");
doThrow(new RocksDBException("expected", status)).when(transaction).commitInternal();
// when
newContext.runInTransaction(() -> {
});
}
use of org.rocksdb.Status in project zeebe by camunda.
the class ZeebeRocksDbTransactionTest method shouldWrapExceptionInRuntimeExceptionOnCommit.
@Test(expected = RuntimeException.class)
public void shouldWrapExceptionInRuntimeExceptionOnCommit() throws Exception {
// given
final ZeebeTransaction transaction = mock(ZeebeTransaction.class);
final TransactionContext newContext = new DefaultTransactionContext(transaction);
final Status status = new Status(Code.NotSupported, SubCode.None, "");
doThrow(new RocksDBException("expected", status)).when(transaction).commitInternal();
// when
newContext.runInTransaction(() -> {
});
}
use of org.rocksdb.Status in project zeebe by camunda.
the class ZeebeRocksDbTransactionTest method shouldWrapExceptionInRuntimeException.
@Test(expected = RuntimeException.class)
public void shouldWrapExceptionInRuntimeException() {
// given
final Status status = new Status(Code.NotSupported, SubCode.None, "");
// when
transactionContext.runInTransaction(() -> {
throw new RocksDBException("expected", status);
});
}
Aggregations