@Test
public void testMultipleOperations() throws Exception {
File editsDir = createEditsDir();
DummyServerCore core = new DummyServerCore();
EditLogFileOutputStream out = initEdits(editsDir);
ServerLogReaderPreTransactional logReader = new ServerLogReaderPreTransactional(core,
Util.stringAsURI(editsDir.getAbsolutePath()));
core.logReader = logReader;
Thread coreThread, logReaderThread;
long txCount = 1000;
coreThread = new Thread(core);
logReaderThread = new Thread(logReader);
logReaderThread.start();
coreThread.start();
for (long txId = 0; txId < txCount; txId ++) {
writeOperation(out, txId, false);
}
// flush
out.setReadyToFlush();
out.flush();
Thread.sleep(500);
core.shutdown();
logReaderThread.join();
coreThread.join();