|
@@ -649,8 +649,9 @@ public class TestSequenceFile {
|
|
@Test
|
|
@Test
|
|
public void testRecursiveSeqFileCreate() throws IOException {
|
|
public void testRecursiveSeqFileCreate() throws IOException {
|
|
FileSystem fs = FileSystem.getLocal(conf);
|
|
FileSystem fs = FileSystem.getLocal(conf);
|
|
- Path name = new Path(new Path(GenericTestUtils.getTempPath(
|
|
|
|
- "recursiveCreateDir")), "file");
|
|
|
|
|
|
+ Path parentDir = new Path(GenericTestUtils.getTempPath(
|
|
|
|
+ "recursiveCreateDir"));
|
|
|
|
+ Path name = new Path(parentDir, "file");
|
|
boolean createParent = false;
|
|
boolean createParent = false;
|
|
|
|
|
|
try {
|
|
try {
|
|
@@ -662,11 +663,16 @@ public class TestSequenceFile {
|
|
// Expected
|
|
// Expected
|
|
}
|
|
}
|
|
|
|
|
|
- createParent = true;
|
|
|
|
- SequenceFile.createWriter(fs, conf, name, RandomDatum.class,
|
|
|
|
- RandomDatum.class, 512, (short) 1, 4096, createParent,
|
|
|
|
- CompressionType.NONE, null, new Metadata());
|
|
|
|
- // should succeed, fails if exception thrown
|
|
|
|
|
|
+ try {
|
|
|
|
+ createParent = true;
|
|
|
|
+ SequenceFile.createWriter(fs, conf, name, RandomDatum.class,
|
|
|
|
+ RandomDatum.class, 512, (short) 1, 4096, createParent,
|
|
|
|
+ CompressionType.NONE, null, new Metadata());
|
|
|
|
+ // should succeed, fails if exception thrown
|
|
|
|
+ } finally {
|
|
|
|
+ fs.deleteOnExit(parentDir);
|
|
|
|
+ fs.close();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|