Examples of HasSequenceWithNoSequenceName


Examples of com.google.appengine.datanucleus.test.jdo.SequenceExamplesJDO.HasSequenceWithNoSequenceName

    assertEquals(Utils.newArrayList(12L), sequenceBatchSizes);
  }

  public void testInsertWithSequenceGenerator_NoSequenceName() throws EntityNotFoundException {
    String kind = getKind(HasSequenceWithNoSequenceName.class);
    HasSequenceWithNoSequenceName pojo = new HasSequenceWithNoSequenceName();
    beginTxn();
    pm.makePersistent(pojo);
    commitTxn();
    ds.get(KeyFactory.createKey(kind, pojo.getId()));
    assertEquals(Utils.newArrayList(kind + "_SEQUENCE__JDO"), sequenceNames);
    assertEquals(Utils.newArrayList(12L), sequenceBatchSizes);
  }
View Full Code Here

Examples of com.google.appengine.datanucleus.test.jpa.SequenceExamplesJPA.HasSequenceWithNoSequenceName

  }

  public void testInsertWithSequenceGenerator_NoSequenceName() throws EntityNotFoundException {
    String kind = getKind(HasSequenceWithNoSequenceName.class);
    KeyRange keyRange = ds.allocateIds(kind, 5);
    HasSequenceWithNoSequenceName pojo = new HasSequenceWithNoSequenceName();
    beginTxn();
    em.persist(pojo);
    commitTxn();
    ds.get(KeyFactory.createKey(kind, pojo.getId()));
    // the local datastore id allocator is a single sequence so if there
    // are any other allocations happening we can't assert on exact values.
    // uncomment this check and the others below when we bring the local
    // allocator in line with the prod allocator
//    assertEquals(keyRange.getEnd().getId(), pojo.getId() - 1);
    assertTrue(keyRange.getEnd().getId() < pojo.getId());
    keyRange = ds.allocateIds(kind, 1);
//    assertEquals(pojo.getId() + 12, keyRange.getStart().getId());
    assertTrue(pojo.getId() + 12 <= keyRange.getStart().getId());
    assertEquals(Utils.newArrayList(kind + "_SEQUENCE__JPA"), sequenceNames);
    assertEquals(Utils.newArrayList(12L), sequenceBatchSizes);
  }
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.