(SchemaTupleFactory tf)
| 554 | } |
| 555 | |
| 556 | public void testSerDe(SchemaTupleFactory tf) throws IOException { |
| 557 | int sz = 4096; |
| 558 | List<Tuple> written = new ArrayList<Tuple>(sz); |
| 559 | |
| 560 | File temp = File.createTempFile("tmp", "tmp"); |
| 561 | temp.deleteOnExit(); |
| 562 | FileOutputStream fos = new FileOutputStream(temp); |
| 563 | DataOutput dos = new DataOutputStream(fos); |
| 564 | |
| 565 | for (int i = 0; i < sz; i++) { |
| 566 | SchemaTuple<?> st = (SchemaTuple<?>)tf.newTuple(); |
| 567 | fillWithData(st); |
| 568 | bis.writeDatum(dos, st); |
| 569 | written.add(st); |
| 570 | } |
| 571 | fos.close(); |
| 572 | |
| 573 | assertEquals(sz, written.size()); |
| 574 | |
| 575 | FileInputStream fis = new FileInputStream(temp); |
| 576 | DataInput din = new DataInputStream(fis); |
| 577 | for (int i = 0; i < sz; i++) { |
| 578 | SchemaTuple<?> st = (SchemaTuple<?>)bis.readDatum(din); |
| 579 | assertEquals(written.get(i), st); |
| 580 | } |
| 581 | fis.close(); |
| 582 | } |
| 583 | |
| 584 | @Test |
| 585 | public void testFRJoinWithSchemaTuple() throws Exception { |
no test coverage detected