use of com.hazelcast.core.ISet in project hazelcast by hazelcast.
the class MBeanTest method testSet.
@Test
public void testSet() throws Exception {
ISet set = holder.getHz().getSet("set");
set.size();
holder.assertMBeanExistEventually("ISet", set.getName());
}
use of com.hazelcast.core.ISet in project hazelcast by hazelcast.
the class ClientTxnSetTest method testAddRollBack.
@Test
public void testAddRollBack() throws Exception {
final String setName = randomString();
final ISet set = client.getSet(setName);
set.add("item1");
final TransactionContext context = client.newTransactionContext();
context.beginTransaction();
final TransactionalSet<Object> setTxn = context.getSet(setName);
setTxn.add("item2");
context.rollbackTransaction();
assertEquals(1, set.size());
}
use of com.hazelcast.core.ISet in project hazelcast by hazelcast.
the class ClientTxnSetTest method testAdd_withinTxn.
@Test
public void testAdd_withinTxn() throws Exception {
final String element = "item1";
final String setName = randomString();
final ISet set = client.getSet(setName);
final TransactionContext context = client.newTransactionContext();
context.beginTransaction();
final TransactionalSet<Object> txnSet = context.getSet(setName);
assertTrue(txnSet.add(element));
assertEquals(1, txnSet.size());
context.commitTransaction();
}
use of com.hazelcast.core.ISet in project hazelcast by hazelcast.
the class ClientTxnSetTest method testRemove_withinTxn.
@Test
public void testRemove_withinTxn() throws Exception {
final String element = "item1";
final String setName = randomString();
final ISet set = client.getSet(setName);
set.add(element);
final TransactionContext context = client.newTransactionContext();
context.beginTransaction();
final TransactionalSet<Object> txnSet = context.getSet(setName);
assertTrue(txnSet.remove(element));
assertFalse(txnSet.remove("NOT_THERE"));
context.commitTransaction();
}
use of com.hazelcast.core.ISet in project hazelcast by hazelcast.
the class ClientTxnSetTest method testSetSizeAfterAdd_withinTxn.
@Test
public void testSetSizeAfterAdd_withinTxn() throws Exception {
final String element = "item1";
final String setName = randomString();
final ISet set = client.getSet(setName);
final TransactionContext context = client.newTransactionContext();
context.beginTransaction();
final TransactionalSet<Object> txnSet = context.getSet(setName);
txnSet.add(element);
context.commitTransaction();
assertEquals(1, set.size());
}
Aggregations