(HeapFile hf, Transaction t, int v1)
| 27 | HeapFile hf2; |
| 28 | |
| 29 | void insertRow(HeapFile hf, Transaction t, int v1) |
| 30 | throws DbException, TransactionAbortedException { |
| 31 | // Create a row to insert |
| 32 | TupleDesc twoIntColumns = Utility.getTupleDesc(2); |
| 33 | Tuple value = new Tuple(twoIntColumns); |
| 34 | value.setField(0, new IntField(v1)); |
| 35 | value.setField(1, new IntField(0)); |
| 36 | TupleIterator insertRow = new TupleIterator(Utility.getTupleDesc(2), Collections.singletonList(value)); |
| 37 | |
| 38 | // Insert the row |
| 39 | Insert insert = new Insert(t.getId(), insertRow, hf.getId()); |
| 40 | insert.open(); |
| 41 | Tuple result = insert.next(); |
| 42 | assertEquals(SystemTestUtil.SINGLE_INT_DESCRIPTOR, result.getTupleDesc()); |
| 43 | assertEquals(1, ((IntField)result.getField(0)).getValue()); |
| 44 | assertFalse(insert.hasNext()); |
| 45 | insert.close(); |
| 46 | } |
| 47 | |
| 48 | // check that the specified tuple is, or is not, present |
| 49 | void look(HeapFile hf, Transaction t, int v1, boolean present) |
no test coverage detected