null, true, conf);
Assert.assertEquals(result.size(), 1);
for (InputSplit split : result) {
PigSplit pigSplit = (PigSplit) split;
// write to a byte array output stream
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
DataOutput out = new DataOutputStream(outputStream);
pigSplit.write(out);
// restore the pig split from the byte array
ByteArrayInputStream inputStream = new ByteArrayInputStream(
outputStream.toByteArray());
DataInput in = new DataInputStream(inputStream);
PigSplit anotherSplit = new PigSplit();
anotherSplit.setConf(conf);
anotherSplit.readFields(in);
Assert.assertEquals(700, anotherSplit.getLength());
checkLocationOrdering(pigSplit.getLocations(), new String[] { "l5",
"l1", "l6", "l3", "l4" });
Assert.assertEquals(3, anotherSplit.getNumPaths());
Assert.assertEquals(
"org.apache.hadoop.mapreduce.lib.input.FileSplit",
(anotherSplit.getWrappedSplit(0).getClass().getName()));
Assert.assertEquals(
"org.apache.hadoop.mapreduce.lib.input.FileSplit",
(anotherSplit.getWrappedSplit(1).getClass().getName()));
Assert.assertEquals(
"org.apache.hadoop.mapreduce.lib.input.FileSplit",
(anotherSplit.getWrappedSplit(2).getClass().getName()));
}
}