}
@Test
public void testDeletingRecord() throws InstantiationException,
IllegalAccessException, ClassNotFoundException, SQLException {
DerbyEmbeddedDS ds = new DerbyEmbeddedDS();
SimulationRecord record = new SimulationRecord();
record.setBrightness(42.0D);
record.setTemperature(42.0D);
record.setEnergyConsumption(42.0D);
long timeStamp = System.currentTimeMillis();
record.setTimeStamp(timeStamp);
ds.persist(record);
Criterion criterion = new Criterion("timestamp").equal(String.valueOf(timeStamp));
List<SimulationRecord> storedRecords = ds.find(criterion);
Assert.assertFalse(storedRecords.isEmpty());
record = storedRecords.get(0);
ds.delete(record);
storedRecords = ds.find(criterion);
Assert.assertTrue(storedRecords.isEmpty());
}