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

Method testIteratorClose

test/simpledb/HeapFileReadTest.java:108–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106 }
107
108 @Test
109 public void testIteratorClose() throws Exception {
110 // make more than 1 page. Previous closed iterator would start fetching
111 // from page 1.
112 HeapFile twoPageFile = SystemTestUtil.createRandomHeapFile(2, 520,
113 null, null);
114
115 DbFileIterator it = twoPageFile.iterator(tid);
116 it.open();
117 assertTrue(it.hasNext());
118 it.close();
119 try {
120 it.next();
121 fail("expected exception");
122 } catch (NoSuchElementException ignored) {
123 }
124 // close twice is harmless
125 it.close();
126 }
127
128 /**
129 * JUnit suite target

Callers

nothing calls this directly

Calls 6

createRandomHeapFileMethod · 0.95
iteratorMethod · 0.95
openMethod · 0.95
hasNextMethod · 0.95
closeMethod · 0.95
nextMethod · 0.95

Tested by

no test coverage detected