MCPcopy Create free account
hub / github.com/apache/pig / testSerDe

Method testSerDe

test/org/apache/pig/data/TestSchemaTuple.java:556–582  ·  view source on GitHub ↗
(SchemaTupleFactory tf)

Source from the content-addressed store, hash-verified

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 {

Callers 1

testNotAppendableMethod · 0.95

Calls 10

fillWithDataMethod · 0.95
newTupleMethod · 0.65
writeDatumMethod · 0.65
addMethod · 0.65
closeMethod · 0.65
sizeMethod · 0.65
readDatumMethod · 0.65
getMethod · 0.65
createTempFileMethod · 0.45
assertEqualsMethod · 0.45

Tested by

no test coverage detected