use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class ClientTransactionalMapQuorumTest method testTxPutWithTTLThrowsExceptionWhenQuorumSizeNotMet.
@Test
public void testTxPutWithTTLThrowsExceptionWhenQuorumSizeNotMet() {
TransactionContext transaction = getTransactionFromMinority();
TransactionalMap<Object, Object> map = getMap(transaction);
expectedException.expect(QuorumException.class);
map.put("foo", "bar", 10, TimeUnit.SECONDS);
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class ClientTransactionalMapQuorumTest method testTxGetSucceedsWhenQuorumSizeMet.
@Test
public void testTxGetSucceedsWhenQuorumSizeMet() {
TransactionContext transaction = getTransactionFromMajority();
TransactionalMap<Object, Object> map = getMap(transaction);
map.get("foo");
transaction.commitTransaction();
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class ClientTransactionalMapQuorumTest method testTxReplaceThrowsExceptionWhenQuorumSizeNotMet.
@Test
public void testTxReplaceThrowsExceptionWhenQuorumSizeNotMet() {
TransactionContext transaction = getTransactionFromMinority();
TransactionalMap<Object, Object> map = getMap(transaction);
expectedException.expect(QuorumException.class);
map.replace("foo", "bar");
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class ClientTransactionalMapQuorumTest method testTxSetSucceedsWhenQuorumSizeMet.
@Test
public void testTxSetSucceedsWhenQuorumSizeMet() {
TransactionContext transaction = getTransactionFromMajority();
TransactionalMap<Object, Object> map = getMap(transaction);
map.set("foo", "bar");
transaction.commitTransaction();
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class ClientTransactionalMapQuorumTest method testTxKeySetThrowsExceptionWhenQuorumSizeNotMet.
@Test
public void testTxKeySetThrowsExceptionWhenQuorumSizeNotMet() {
TransactionContext transaction = getTransactionFromMinority();
TransactionalMap<Object, Object> map = getMap(transaction);
expectedException.expect(QuorumException.class);
map.keySet();
}
Aggregations