while ((operation = reader.readLine()) != null) {// NOPMD
lineNumber++;
final String[] opElt = operation.split(";");
final String instruction = opElt[0];
if ("read".equals(instruction)) {
final DataRecordIdentifier dataRecordIdentifier =
/**/new DataRecordIdentifier(Integer.parseInt(opElt[1]));// NOPMD
final byte[] opData;
if (opElt.length < 3) {
opData = null;
} else {
opData = dataFromString(opElt[2]);
}
final byte[] read = heapDataManager
.readDataRecord(dataRecordIdentifier);
if (opData == null) {
assertNull(lineNumber + ": bad data read\n"
+ dataToString(read), read);
} else {
assertTrue(lineNumber + ": bad data read "
+ dataRecordIdentifier + "\n" + dataToString(read),
Arrays// NOPMD
.equals(opData, read));
}
} else if ("new".equals(instruction)) {
final DataRecordIdentifier dataRecordIdentifier =
/**/new DataRecordIdentifier(Integer.parseInt(opElt[1]));// NOPMD
final DataRecordIdentifier newId = heapDataManager
.getNewDataRecordIdentifier();
assertEquals(lineNumber + ": bad id created",
dataRecordIdentifier, newId);
} else if ("write".equals(instruction)) {
final DataRecordIdentifier dataRecordIdentifier =
/**/new DataRecordIdentifier(Integer.parseInt(opElt[1]));// NOPMD
final byte[] opData = dataFromString(opElt[2]);
heapDataManager.writeDataRecord(dataRecordIdentifier, opData);
} else if ("flush".equals(instruction)) {
heapDataManager.flush();
checkIntegrity();