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

Method deleteTuple

test/simpledb/BTreeFileDeleteTest.java:39–57  ·  view source on GitHub ↗

Unit test for BTreeFile.deleteTuple()

()

Source from the content-addressed store, hash-verified

37 * Unit test for BTreeFile.deleteTuple()
38 */
39 @Test public void deleteTuple() throws Exception {
40 BTreeFile f;
41 f = BTreeUtility.createRandomBTreeFile(2, 20, null, null, 0);
42 DbFileIterator it = f.iterator(tid);
43 it.open();
44 while(it.hasNext()) {
45 Tuple t = it.next();
46 f.deleteTuple(tid, t);
47 }
48 it.rewind();
49 assertFalse(it.hasNext());
50
51 // insert a couple of tuples
52 f.insertTuple(tid, BTreeUtility.getBTreeTuple(5, 2));
53 f.insertTuple(tid, BTreeUtility.getBTreeTuple(17, 2));
54
55 it.rewind();
56 assertTrue(it.hasNext());
57 }
58
59 @Test
60 public void testStealFromLeftLeafPage() throws Exception {

Callers

nothing calls this directly

Calls 9

createRandomBTreeFileMethod · 0.95
iteratorMethod · 0.95
openMethod · 0.95
hasNextMethod · 0.95
nextMethod · 0.95
deleteTupleMethod · 0.95
rewindMethod · 0.95
insertTupleMethod · 0.95
getBTreeTupleMethod · 0.95

Tested by

no test coverage detected