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

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


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

  public void testSequenceOnNonPkFields() throws EntityNotFoundException {
    String kind = getKind(HasSequenceOnNonPkFields.class);
    HasSequenceOnNonPkFields pojo = new HasSequenceOnNonPkFields();
    pojo.setId("jdo");
    beginTxn();
    pm.makePersistent(pojo);
    // 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
    assertTrue(pojo.getVal1() < pojo.getVal2());
    commitTxn();

    HasSequenceOnNonPkFields pojo2 = new HasSequenceOnNonPkFields();
    pojo2.setId("jdo");
    beginTxn();
    pm.makePersistent(pojo2);
//    assertEquals(pojo.getVal2(), pojo2.getVal1() - 1);
    assertTrue(pojo.getVal2() < pojo2.getVal1());
    commitTxn();
    assertEquals(Utils.newArrayList(kind + "_SEQUENCE__JDO", kind + "_SEQUENCE__JDO",
                                    kind + "_SEQUENCE__JDO", kind + "_SEQUENCE__JDO"), sequenceNames);
    assertEquals(Utils.newArrayList(1L, 1L, 1L, 1L), sequenceBatchSizes);
  }
View Full Code Here

TOP

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

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.