MCPcopy Create free account
hub / github.com/1345414527/MIT6.830 / TestOpenCrash

Method TestOpenCrash

test/simpledb/systemtest/LogTest.java:323–347  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

321 }
322
323 @Test public void TestOpenCrash()
324 throws IOException, DbException, TransactionAbortedException {
325 setup();
326 doInsert(hf1, 1, 2);
327
328 // *** Test:
329 // insert but no commit
330 // crash
331 // data should not be there
332
333 Transaction t = new Transaction();
334 t.start();
335 insertRow(hf1, t, 8);
336 Database.getBufferPool().flushAllPages(); // XXX something to UNDO
337 insertRow(hf1, t, 9);
338
339 crash();
340
341 t = new Transaction();
342 t.start();
343 look(hf1, t, 1, true);
344 look(hf1, t, 8, false);
345 look(hf1, t, 9, false);
346 t.commit();
347 }
348
349 @Test public void TestOpenCommitOpenCrash()
350 throws IOException, DbException, TransactionAbortedException {

Callers

nothing calls this directly

Calls 9

setupMethod · 0.95
doInsertMethod · 0.95
startMethod · 0.95
insertRowMethod · 0.95
getBufferPoolMethod · 0.95
crashMethod · 0.95
lookMethod · 0.95
commitMethod · 0.95
flushAllPagesMethod · 0.80

Tested by

no test coverage detected