use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class TransactionalMapReadWriteQuorumTest method testTxValuesWithPredicateThrowsExceptionWhenQuorumSizeNotMet.
@Test(expected = TransactionException.class)
public void testTxValuesWithPredicateThrowsExceptionWhenQuorumSizeNotMet() {
TransactionContext transactionContext = cluster.h4.newTransactionContext(options);
transactionContext.beginTransaction();
TransactionalMap<Object, Object> map = transactionContext.getMap(randomMapName(MAP_NAME_PREFIX));
map.values(TruePredicate.INSTANCE);
transactionContext.commitTransaction();
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class TransactionalMapReadWriteQuorumTest method testTxPutIfAbsentThrowsExceptionWhenQuorumSizeNotMet.
@Test(expected = TransactionException.class)
public void testTxPutIfAbsentThrowsExceptionWhenQuorumSizeNotMet() {
TransactionContext transactionContext = cluster.h4.newTransactionContext(options);
transactionContext.beginTransaction();
TransactionalMap<Object, Object> map = transactionContext.getMap(randomMapName(MAP_NAME_PREFIX));
map.putIfAbsent("foo", "bar");
transactionContext.commitTransaction();
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class TransactionalMapReadWriteQuorumTest method testTxIsEmptyThrowsExceptionWhenQuorumSizeNotMet.
@Test(expected = TransactionException.class)
public void testTxIsEmptyThrowsExceptionWhenQuorumSizeNotMet() {
TransactionContext transactionContext = cluster.h4.newTransactionContext(options);
transactionContext.beginTransaction();
TransactionalMap<Object, Object> map = transactionContext.getMap(randomMapName(MAP_NAME_PREFIX));
map.isEmpty();
transactionContext.commitTransaction();
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class TransactionalMapReadWriteQuorumTest method testTxGetThrowsExceptionWhenQuorumSizeNotMet.
@Test(expected = TransactionException.class)
public void testTxGetThrowsExceptionWhenQuorumSizeNotMet() {
TransactionContext transactionContext = cluster.h4.newTransactionContext(options);
transactionContext.beginTransaction();
TransactionalMap<Object, Object> map = transactionContext.getMap(randomMapName(MAP_NAME_PREFIX));
map.get("foo");
transactionContext.commitTransaction();
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class TransactionalMapReadWriteQuorumTest method testTxSetThrowsExceptionWhenQuorumSizeNotMet.
@Test(expected = TransactionException.class)
public void testTxSetThrowsExceptionWhenQuorumSizeNotMet() {
TransactionContext transactionContext = cluster.h4.newTransactionContext(options);
transactionContext.beginTransaction();
TransactionalMap<Object, Object> map = transactionContext.getMap(randomMapName(MAP_NAME_PREFIX));
map.set("foo", "bar");
transactionContext.commitTransaction();
}
Aggregations