super.tearDown();
}
public void testSimpleInsert() throws EntityNotFoundException {
String kind = getKind(HasSequence.class);
HasSequence pojo = new HasSequence();
pojo.setVal("jpa1");
beginTxn();
em.persist(pojo);
commitTxn();
Entity e = ds.get(KeyFactory.createKey(kind, pojo.getId()));
assertEquals("jpa1", e.getProperty("val"));
HasSequence pojo2 = new HasSequence();
pojo2.setVal("jpa2");
beginTxn();
em.persist(pojo2);
commitTxn();
e = ds.get(KeyFactory.createKey(kind, pojo2.getId()));
assertEquals("jpa2", e.getProperty("val"));
// 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(pojo.getId().longValue(), pojo2.getId() - 1);
assertTrue(pojo.getId().longValue() < pojo2.getId());
assertEquals(Utils.newArrayList(kind + "_SEQUENCE__JPA", kind + "_SEQUENCE__JPA"), sequenceNames);
assertEquals(Utils.newArrayList(1L, 1L), sequenceBatchSizes);
}