@Test
public void testContinueStrategiesWithCodec() throws IOException, InterruptedException {
String[] dataArray = new String[] { DATA10 };
TextFileWriter writer = new TextFileWriter(getConfiguration(), testDefaultPath, Codecs.GZIP.getCodecInfo());
ChainedFileNamingStrategy fileNamingStrategy = new ChainedFileNamingStrategy();
fileNamingStrategy.register(new StaticFileNamingStrategy("data"));
fileNamingStrategy.register(new RollingFileNamingStrategy());
fileNamingStrategy.register(new CodecFileNamingStrategy());
writer.setFileNamingStrategy(fileNamingStrategy);
writer.setInWritingSuffix(".tmp");
writer.afterPropertiesSet();
TestUtils.writeData(writer, dataArray);
Thread.sleep(1000);
writer = new TextFileWriter(getConfiguration(), testDefaultPath, Codecs.GZIP.getCodecInfo());
fileNamingStrategy = new ChainedFileNamingStrategy();
fileNamingStrategy.register(new StaticFileNamingStrategy("data"));
fileNamingStrategy.register(new RollingFileNamingStrategy());
fileNamingStrategy.register(new CodecFileNamingStrategy());
writer.setFileNamingStrategy(fileNamingStrategy);
writer.setInWritingSuffix(".tmp");
writer.afterPropertiesSet();
TestUtils.writeData(writer, dataArray);
Thread.sleep(1000);
writer = new TextFileWriter(getConfiguration(), testDefaultPath, Codecs.GZIP.getCodecInfo());
fileNamingStrategy = new ChainedFileNamingStrategy();
fileNamingStrategy.register(new StaticFileNamingStrategy("data"));
fileNamingStrategy.register(new RollingFileNamingStrategy());
fileNamingStrategy.register(new CodecFileNamingStrategy());
writer.setFileNamingStrategy(fileNamingStrategy);
writer.setInWritingSuffix(".tmp");
writer.afterPropertiesSet();
TestUtils.writeData(writer, dataArray);
TextFileReader reader1 = new TextFileReader(getConfiguration(), new Path(testDefaultPath, "data-0.gzip"), Codecs.GZIP.getCodecInfo());
List<String> splitData1 = TestUtils.readData(reader1);