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

Method testBlockHeaderEndingWithCR

test/org/apache/pig/test/TestBZip.java:422–438  ·  view source on GitHub ↗

Tests the case where a bzip block ends exactly at the end of the input split (byte aligned with the last byte) and the last byte is a carriage return.

()

Source from the content-addressed store, hash-verified

420 * return.
421 */
422 @Test
423 public void testBlockHeaderEndingWithCR() throws IOException {
424 String inputFileName =
425 "test/org/apache/pig/test/data/blockEndingInCR.txt.bz2";
426 // number of lines in above file (the value is 1 more than bzcat | wc -l
427 // since there is a '\r' which is also treated as a record delim
428 Long expectedCount = 82094L;
429 // the first block in the above file exactly ends at the byte at
430 // position 136498 and the last byte is a carriage return ('\r')
431 try {
432 int splitSize = 136498;
433 Util.copyFromLocalToCluster(cluster, inputFileName, inputFileName);
434 testCount(inputFileName, expectedCount, splitSize, "PigStorage()");
435 } finally {
436 Util.deleteFile(cluster, inputFileName);
437 }
438 }
439
440 /**
441 * Tests the case where a bzip block ends exactly at the end of the input

Callers

nothing calls this directly

Calls 3

testCountMethod · 0.95
deleteFileMethod · 0.95

Tested by

no test coverage detected