/**
* Tests the use of a java.sql.Timestamp field for versioning.
*/
public void testTimestampVersion() {
beginTxn();
HasTimestampVersionJPA tv = new HasTimestampVersionJPA();
tv.setValue("First Value");
em.persist(tv);
commitTxn();
Timestamp firstVersion = tv.getVersion();
Assert.assertNotNull(firstVersion);
beginTxn();
tv.setValue("Second Value");
commitTxn();
Timestamp secondVersion = tv.getVersion();
Assert.assertNotNull(secondVersion);
long firstMillis = firstVersion.getTime();
long secondMillis = secondVersion.getTime();
Assert.assertTrue(secondMillis > firstMillis);
}