Unit test for Tuple.getField() and Tuple.setField()
()
| 15 | * Unit test for Tuple.getField() and Tuple.setField() |
| 16 | */ |
| 17 | @Test public void modifyFields() { |
| 18 | TupleDesc td = Utility.getTupleDesc(2); |
| 19 | |
| 20 | Tuple tup = new Tuple(td); |
| 21 | tup.setField(0, new IntField(-1)); |
| 22 | tup.setField(1, new IntField(0)); |
| 23 | |
| 24 | assertEquals(new IntField(-1), tup.getField(0)); |
| 25 | assertEquals(new IntField(0), tup.getField(1)); |
| 26 | |
| 27 | tup.setField(0, new IntField(1)); |
| 28 | tup.setField(1, new IntField(37)); |
| 29 | |
| 30 | assertEquals(new IntField(1), tup.getField(0)); |
| 31 | assertEquals(new IntField(37), tup.getField(1)); |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Unit test for Tuple.getTupleDesc() |
nothing calls this directly
no test coverage detected