Exemplo n.º 1
0
  /** Test of nextValue method, of class UjoSequencer. */
  public void testNextValue_2() {
    System.out.println("testNextValue_2");

    final int sequenceCache = 2;
    final OrmHandler handler = createHandler(sequenceCache);
    final MetaTable orderModel = handler.findTableModel(Order.class);
    final UjoSequencer seq = orderModel.getSequencer();
    final Session session = handler.createSession();

    long seqBeg = seq.nextValue(session);
    long seqEnd = 0;
    int count = 52;
    for (int i = 0; i < count; i++) {
      seqEnd = seq.nextValue(session);
    }
    session.close();
    assertEquals("ID sequences must be the same", seqBeg + count, seqEnd);
  }