Examples of ListService


Examples of com.cxy.redisclient.service.ListService

    List<String> values = service.list(1, 0, "mylist");
    assertTrue(values.get(0).equals("test"));
  }
 
  public void testRemove() {
    ListService service = new ListService();
    service.removeFirst(1, 0, "mylist");
    service.removeLast(1, 0, "mylist");
  }
View Full Code Here

Examples of com.cxy.redisclient.service.ListService

import junit.framework.TestCase;

public class ListTest extends TestCase {

  public void testAdd() {
    ListService service = new ListService();
    List<String> values = new ArrayList<String>();
    values.add("hello");
    values.add("world");
   
    service.add(1, 0, "mylist", values, true, true, -1);
   
    List<String> lists = service.list(1, 0, "mylist");
    assertTrue(lists.size() > 0);
  }
View Full Code Here

Examples of com.cxy.redisclient.service.ListService

    List<String> lists = service.list(1, 0, "mylist");
    assertTrue(lists.size() > 0);
  }
 
  public void testAdd1() {
    ListService service = new ListService();
    List<String> values = new ArrayList<String>();
    values.add("hello");
    values.add("world");
   
    service.add(1, 0, "notexist", values, true, false, -1);
   
    List<String> lists = service.list(1, 0, "notexist");
    assertTrue(lists.size() == 0);
  }
View Full Code Here

Examples of com.cxy.redisclient.service.ListService

    List<String> lists = service.list(1, 0, "notexist");
    assertTrue(lists.size() == 0);
  }
 
  public void testInsert() {
    ListService service = new ListService();
   
   
    service.insert(1, 0, "mylist", true, "world", "insert");
   
   
  }
View Full Code Here

Examples of com.cxy.redisclient.service.ListService

   
   
  }
 
  public void testSet() {
    ListService service = new ListService();
   
   
    service.setValue(1, 0, "mylist", 0, "test");
   
    List<String> values = service.list(1, 0, "mylist");
    assertTrue(values.get(0).equals("test"));
  }
View Full Code Here

Examples of com.hazelcast.collection.list.ListService

                registerService(MapService.SERVICE_NAME, new MapService(nodeEngine));
                registerService(LockService.SERVICE_NAME, new LockServiceImpl(nodeEngine));
                registerService(QueueService.SERVICE_NAME, new QueueService(nodeEngine));
                registerService(TopicService.SERVICE_NAME, new TopicService());
                registerService(MultiMapService.SERVICE_NAME, new MultiMapService(nodeEngine));
                registerService(ListService.SERVICE_NAME, new ListService(nodeEngine));
                registerService(SetService.SERVICE_NAME, new SetService(nodeEngine));
                registerService(DistributedExecutorService.SERVICE_NAME, new DistributedExecutorService());
                registerService(AtomicLongService.SERVICE_NAME, new AtomicLongService());
                registerService(AtomicReferenceService.SERVICE_NAME, new AtomicReferenceService());
                registerService(CountDownLatchService.SERVICE_NAME, new CountDownLatchService());
View Full Code Here

Examples of com.hazelcast.collection.list.ListService

        Address partitionOwner = ps.getPartitionOwner(partitionId);
        if (partitionOwner == null) {
            return false;
        }
        if (thisAddress.equals(partitionOwner)) {
            ListService listService = nei.getService(ListService.SERVICE_NAME);
            ListContainer listContainer = listService.getOrCreateContainer(listName, false);
            List<CollectionItem> items = new ArrayList<CollectionItem>(listContainer.getCollection());
            iterator = items.iterator();
        }
        return true;
    }
View Full Code Here

Examples of com.hazelcast.collection.list.ListService

        this.name = name;
    }

    protected final ListContainer getOrCreateListContainer(){
        if (container == null) {
            ListService service = getService();
            try {
                container = service.getOrCreateContainer(name, this instanceof BackupOperation);
            } catch (Exception e) {
                throw new RetryableHazelcastException(e);
            }
        }
        return (ListContainer) container;
View Full Code Here

Examples of com.hazelcast.collection.list.ListService

        registerService(MapService.SERVICE_NAME, MapService.create(nodeEngine));
        registerService(LockService.SERVICE_NAME, new LockServiceImpl(nodeEngine));
        registerService(QueueService.SERVICE_NAME, new QueueService(nodeEngine));
        registerService(TopicService.SERVICE_NAME, new TopicService());
        registerService(MultiMapService.SERVICE_NAME, new MultiMapService(nodeEngine));
        registerService(ListService.SERVICE_NAME, new ListService(nodeEngine));
        registerService(SetService.SERVICE_NAME, new SetService(nodeEngine));
        registerService(DistributedExecutorService.SERVICE_NAME, new DistributedExecutorService());
        registerService(AtomicLongService.SERVICE_NAME, new AtomicLongService());
        registerService(AtomicReferenceService.SERVICE_NAME, new AtomicReferenceService());
        registerService(CountDownLatchService.SERVICE_NAME, new CountDownLatchService());
View Full Code Here

Examples of com.hazelcast.collection.list.ListService

        IList list = hz.getList("list@" + partitionKey);
        list.add("");
        assertEquals("list@" + partitionKey, list.getName());
        assertEquals(partitionKey, list.getPartitionKey());

        ListService service = getNodeEngine(hz).getService(ListService.SERVICE_NAME);
        assertTrue(service.getContainerMap().containsKey(list.getName()));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.