Search in sources :

Example 11 with IList

use of com.hazelcast.collection.IList in project hazelcast by hazelcast.

the class ClientTxnListTest method testAddAndRoleBack.

@Test
public void testAddAndRoleBack() throws Exception {
    final String listName = randomString();
    final IList l = client.getList(listName);
    l.add("item1");
    final TransactionContext context = client.newTransactionContext();
    context.beginTransaction();
    final TransactionalList<Object> list = context.getList(listName);
    list.add("item2");
    context.rollbackTransaction();
    assertEquals(1, l.size());
}
Also used : TransactionContext(com.hazelcast.transaction.TransactionContext) HazelcastTestSupport.randomString(com.hazelcast.test.HazelcastTestSupport.randomString) IList(com.hazelcast.collection.IList) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 12 with IList

use of com.hazelcast.collection.IList in project hazelcast by hazelcast.

the class MBeanDestroyTest method testList.

@Test
public void testList() throws Exception {
    IList list = holder.getHz().getList("list");
    list.size();
    holder.assertMBeanExistEventually("IList", list.getName());
    destroyObjectAndAssert(list, "IList");
}
Also used : IList(com.hazelcast.collection.IList) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

IList (com.hazelcast.collection.IList)12 Test (org.junit.Test)11 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)10 QuickTest (com.hazelcast.test.annotation.QuickTest)9 HazelcastInstance (com.hazelcast.core.HazelcastInstance)5 Job (com.hazelcast.jet.Job)5 Assert.assertEquals (org.junit.Assert.assertEquals)5 Assert.assertTrue (org.junit.Assert.assertTrue)5 JobConfig (com.hazelcast.jet.config.JobConfig)4 EXACTLY_ONCE (com.hazelcast.jet.config.ProcessingGuarantee.EXACTLY_ONCE)4 JobRepository (com.hazelcast.jet.impl.JobRepository)4 Assert.assertFalse (org.junit.Assert.assertFalse)4 Category (org.junit.experimental.categories.Category)4 Config (com.hazelcast.config.Config)3 UuidUtil (com.hazelcast.internal.util.UuidUtil)3 JobStatus (com.hazelcast.jet.core.JobStatus)3 TransactionContext (com.hazelcast.transaction.TransactionContext)3 Serializable (java.io.Serializable)3 List (java.util.List)3 Map (java.util.Map)3