Package com.google.appengine.datanucleus.test.jdo.SequenceExamplesJDO

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


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

  public void testSequenceWithUnencodedStringPk() throws EntityNotFoundException {
    String kind = getKind(HasSequenceWithUnencodedStringPk.class);
    HasSequenceWithUnencodedStringPk pojo = new HasSequenceWithUnencodedStringPk();
    beginTxn();
    pm.makePersistent(pojo);
    commitTxn();
    ds.get(KeyFactory.createKey(kind, pojo.getId()));

    HasSequenceWithUnencodedStringPk pojo2 = new HasSequenceWithUnencodedStringPk();
    beginTxn();
    pm.makePersistent(pojo2);
    commitTxn();
    ds.get(KeyFactory.createKey(kind, pojo2.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(Long.parseLong(pojo.getId()), Long.parseLong(pojo2.getId()) - 1);
    assertTrue(Long.parseLong(pojo.getId()) < Long.parseLong(pojo2.getId()));
    assertEquals(Utils.newArrayList(kind + "_SEQUENCE__JDO", kind + "_SEQUENCE__JDO"), sequenceNames);
    assertEquals(Utils.newArrayList(1L, 1L), sequenceBatchSizes);
  }
View Full Code Here

TOP

Related Classes of com.google.appengine.datanucleus.test.jdo.SequenceExamplesJDO.HasSequenceWithUnencodedStringPk

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.