Package com.google.appengine.datanucleus.test.jpa.SequenceExamplesJPA

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

Related Classes of com.google.appengine.datanucleus.test.jpa.SequenceExamplesJPA.HasSequenceWithNoSequenceName

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.