Package info.archinnov.achilles.test.integration.entity.ClusteredEntityWithCounter

Examples of info.archinnov.achilles.test.integration.entity.ClusteredEntityWithCounter.ClusteredKey


  @Test
  public void should_persist_and_find() throws Exception {
    long counterValue = RandomUtils.nextLong(0,Long.MAX_VALUE);
    long versionValue = RandomUtils.nextLong(0,Long.MAX_VALUE);
    compoundKey = new ClusteredKey(RandomUtils.nextLong(0,Long.MAX_VALUE), "name");

    entity = new ClusteredEntityWithCounter(compoundKey, incr(counterValue), incr(versionValue));

    manager.insert(entity);
View Full Code Here


  }

  @Test
  public void should_persist_and_get_proxy() throws Exception {
    long counterValue = RandomUtils.nextLong(0,Long.MAX_VALUE);
    compoundKey = new ClusteredKey(RandomUtils.nextLong(0,Long.MAX_VALUE), "name");
    entity = new ClusteredEntityWithCounter(compoundKey, incr(counterValue));

    manager.insert(entity);

    ClusteredEntityWithCounter found = manager.getProxy(ClusteredEntityWithCounter.class, compoundKey);
View Full Code Here

  @Test
  public void should_update_modifications() throws Exception {
    long initialValue = RandomUtils.nextLong(0,Long.MAX_VALUE);
    long increment = RandomUtils.nextLong(0,Long.MAX_VALUE);

    compoundKey = new ClusteredKey(RandomUtils.nextLong(0,Long.MAX_VALUE), "name");

    entity = new ClusteredEntityWithCounter(compoundKey, incr(initialValue),incr(initialValue));

    entity = manager.insert(entity);
View Full Code Here

  }

  @Test
  public void should_delete() throws Exception {
    long counterValue = RandomUtils.nextLong(0,Long.MAX_VALUE);
    compoundKey = new ClusteredKey(RandomUtils.nextLong(0,Long.MAX_VALUE), "name");

    entity = new ClusteredEntityWithCounter(compoundKey, incr(counterValue));

    entity = manager.insert(entity);
View Full Code Here

    long counterValue = RandomUtils.nextLong(0,Long.MAX_VALUE);
    long incr = RandomUtils.nextLong(0,Long.MAX_VALUE);

    long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);
    String name = "name";
    compoundKey = new ClusteredKey(partitionKey, name);

    entity = new ClusteredEntityWithCounter(compoundKey, incr(counterValue));

    entity = manager.insert(entity);
View Full Code Here

    assertThat(entities.get(1).getCounter().get()).isEqualTo(3L);
        assertThat(entities.get(1).getVersion().get()).isEqualTo(3L);
  }

  private void insertClusteredEntity(Long partitionKey, String name, Long counterValue) {
    ClusteredKey embeddedId = new ClusteredKey(partitionKey, name);
    ClusteredEntityWithCounter entity = new ClusteredEntityWithCounter(embeddedId,
        incr(counterValue),incr(counterValue));
    manager.insert(entity);
  }
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.test.integration.entity.ClusteredEntityWithCounter.ClusteredKey

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.