public void test_newTx_readCommitted02(){
  final MockTransactionService service=newFixture();
  try {
    assertEquals(0,service.getActiveCount());
    final long lastCommitTime=service.getLastCommitTime();
    final long t0=service.nextTimestamp();
    final long tx=service.newTx(ITx.READ_COMMITTED);
    final long t1=service.nextTimestamp();
    assertFalse(TimestampUtility.isReadWriteTx(tx));
    assertTrue(Math.abs(tx) > lastCommitTime);
    assertTrue(Math.abs(tx) > t0);
    assertTrue(Math.abs(tx) < t1);
    assertEquals(1,service.getActiveCount());
    assertEquals(0,service.getReadWriteActiveCount());
    assertEquals(1,service.getReadOnlyActiveCount());
    service.commit(tx);
    assertEquals(0,service.getActiveCount());
    assertEquals(1,service.getStartCount());
    assertEquals(0,service.getAbortCount());
    assertEquals(1,service.getCommitCount());
    assertEquals(0,service.getReadWriteActiveCount());
    assertEquals(0,service.getReadOnlyActiveCount());
  }
  finally {
    service.destroy();
  }
}

public void test_newTx_readCommitted02 ( ) { final MockTransactionService service = newFixture ( ) ; try { assertEquals ( 0 , service . getActiveCount ( ) ) ; final long lastCommitTime = service . getLastCommitTime ( ) ; final long t0 = service . nextTimestamp ( ) ; final long tx = service . newTx ( ITx . READ_COMMITTED ) ; final long t1 = service . nextTimestamp ( ) ; assertFalse ( TimestampUtility . isReadWriteTx ( tx ) ) ; assertTrue ( Math . abs ( tx ) > lastCommitTime ) ; assertTrue ( Math . abs ( tx ) > t0 ) ; assertTrue ( Math . abs ( tx ) < t1 ) ; assertEquals ( 1 , service . getActiveCount ( ) ) ; assertEquals ( 0 , service . getReadWriteActiveCount ( ) ) ; assertEquals ( 1 , service . getReadOnlyActiveCount ( ) ) ; service . commit ( tx ) ; assertEquals ( 0 , service . getActiveCount ( ) ) ; assertEquals ( 1 , service . getStartCount ( ) ) ; assertEquals ( 0 , service . getAbortCount ( ) ) ; assertEquals ( 1 , service . getCommitCount ( ) ) ; assertEquals ( 0 , service . getReadWriteActiveCount ( ) ) ; assertEquals ( 0 , service . getReadOnlyActiveCount ( ) ) ; } finally { service . destroy ( ) ; } }
unit test when [ lastcommittime ] is zero .
