protected void doUpdateLastModifiedOnAccessTest() throws Exception {
CachingDataStore ds = createDataStore();
Random random = new Random(12345);
byte[] data = new byte[12345];
random.nextBytes(data);
DataRecord rec1 = ds.addRecord(new ByteArrayInputStream(data));
data = new byte[12345];
random.nextBytes(data);
DataRecord rec2 = ds.addRecord(new ByteArrayInputStream(data));
Thread.sleep(1000);
long updateTime = System.currentTimeMillis();
ds.updateModifiedDateOnAccess(updateTime);
Thread.sleep(1000);
data = new byte[12345];
random.nextBytes(data);
DataRecord rec3 = ds.addRecord(new ByteArrayInputStream(data));
data = new byte[12345];
random.nextBytes(data);
DataRecord rec4 = ds.addRecord(new ByteArrayInputStream(data));
rec1 = ds.getRecord(rec1.getIdentifier());
assertEquals("rec1 touched", true,
ds.getLastModified(rec1.getIdentifier()) > updateTime);
assertEquals("rec2 not touched", true,
ds.getLastModified(rec2.getIdentifier()) < updateTime);
assertEquals("rec3 touched", true,
ds.getLastModified(rec3.getIdentifier()) > updateTime);
assertEquals("rec4 touched", true,
ds.getLastModified(rec4.getIdentifier()) > updateTime);
ds.close();
}