assertEquals("No extension for uncompressed unknown format", "",
getFileExtension(jc, false, null));
assertEquals("No extension for compressed unknown format", "",
getFileExtension(jc, true, null));
assertEquals("No extension for uncompressed text format", "",
getFileExtension(jc, false, new HiveIgnoreKeyTextOutputFormat()));
assertEquals("Deflate for uncompressed text format", ".deflate",
getFileExtension(jc, true, new HiveIgnoreKeyTextOutputFormat()));
assertEquals("No extension for uncompressed default format", "",
getFileExtension(jc, false));
assertEquals("Deflate for uncompressed default format", ".deflate",
getFileExtension(jc, true));
String extension = ".myext";
jc.set("hive.output.file.extension", extension);
assertEquals("Custom extension for uncompressed unknown format", extension,
getFileExtension(jc, false, null));
assertEquals("Custom extension for compressed unknown format", extension,
getFileExtension(jc, true, null));
assertEquals("Custom extension for uncompressed text format", extension,
getFileExtension(jc, false, new HiveIgnoreKeyTextOutputFormat()));
assertEquals("Custom extension for uncompressed text format", extension,
getFileExtension(jc, true, new HiveIgnoreKeyTextOutputFormat()));
}