Package com.alvazan.test.db

Examples of com.alvazan.test.db.ExpiringEntity


  @Test
  public void testTTLReadBack() {
      if (FactorySingleton.getServerType() == DbTypeEnum.HBASE || FactorySingleton.getServerType() == DbTypeEnum.MONGODB)
            return;
    ExpiringEntity entity = new ExpiringEntity();
    entity.setId(50);
    entity.setName("test1");
    entity.setTtl(50000);
    mgr.put(entity);
    mgr.flush();

    // read entity back
    mgr.clear();
    entity = mgr.find(ExpiringEntity.class, 50L);
    assertEquals("TTL not read back correctly", 50000, entity.getTtl());
  }
View Full Code Here


  @Test
  public void testExpireEntity() throws InterruptedException {
      if (FactorySingleton.getServerType() == DbTypeEnum.HBASE || FactorySingleton.getServerType() == DbTypeEnum.MONGODB)
            return;
    ExpiringEntity entity = new ExpiringEntity();
    entity.setId(50);
    entity.setName("test1");
    entity.setTtl(5);
    mgr.put(entity);
    mgr.flush();

    // wait for entity to expire
    Thread.sleep(6000);
View Full Code Here

  @Test
  public void testPersistWithExpire() throws InterruptedException {
    if (FactorySingleton.getServerType() == DbTypeEnum.HBASE || FactorySingleton.getServerType() == DbTypeEnum.MONGODB)
            return;
    ExpiringEntity entity = new ExpiringEntity();
    entity.setId(50);
    entity.setName("test1");
    entity.setTtl(50000);
    mgr.put(entity);
    mgr.flush();

    // read entity back
    mgr.clear();
View Full Code Here

TOP

Related Classes of com.alvazan.test.db.ExpiringEntity

Copyright © 2018 www.massapicom. 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.