From aa8d642bba063544fd024b807c8149297cd19418 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Thu, 17 Mar 2011 11:27:04 -0400 Subject: [PATCH] FLUME-571: Fix test to actually test the DefaultCodec and supply fixes to make it pass. --- .../handlers/hdfs/TestEscapedCustomOutputDfs.java | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/javatest/com/cloudera/flume/handlers/hdfs/TestEscapedCustomOutputDfs.java b/src/javatest/com/cloudera/flume/handlers/hdfs/TestEscapedCustomOutputDfs.java index 7a10556..4f8606a 100644 --- a/src/javatest/com/cloudera/flume/handlers/hdfs/TestEscapedCustomOutputDfs.java +++ b/src/javatest/com/cloudera/flume/handlers/hdfs/TestEscapedCustomOutputDfs.java @@ -355,12 +355,13 @@ public class TestEscapedCustomOutputDfs { * @throws InterruptedException */ - @Test(expected = IOException.class) + @Test public void testDefaultCodec() throws IOException, InterruptedException { // set the output format. FlumeConfiguration conf = FlumeConfiguration.get(); conf.set(FlumeConfiguration.COLLECTOR_OUTPUT_FORMAT, "syslog"); conf.set(FlumeConfiguration.COLLECTOR_DFS_COMPRESS_CODEC, "DefaultCodec"); + conf.set(FlumeConfiguration.COLLECTOR_DFS_COMPRESS_GZIP, "false"); // build a sink that outputs to that format. File f = FileUtil.mktempdir(); @@ -382,6 +383,7 @@ public class TestEscapedCustomOutputDfs { // check the output to make sure it is what we expected. // read the gzip file and verify the contents DefaultCodec defaultCodec = new DefaultCodec(); + defaultCodec.setConf(conf); InputStream defaultIn = defaultCodec.createInputStream(new FileInputStream( f.getPath() + "/sub-foo.deflate")); byte[] buf = new byte[1]; -- 1.7.3.2