Skip to content

Commit 1b670c1

Browse files
committed
Use existing configuration file by writing it and adding it as a default resource
1 parent 74164be commit 1b670c1

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
File renamed without changes.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package org.gluster.test;
2+
3+
import java.io.File;
4+
import java.io.FileOutputStream;
5+
import java.io.IOException;
6+
7+
import org.apache.hadoop.conf.Configuration;
8+
import org.apache.hadoop.fs.TestGetFileBlockLocations;
9+
10+
public class TestGlusterFileBlockLocations extends TestGetFileBlockLocations{
11+
12+
@Override
13+
protected void setUp() throws IOException{
14+
try{
15+
Configuration cfg = GFSUtil.createConfiguration(true);
16+
cfg.writeXml(new FileOutputStream(new File("/tmp/core-site.xml")));
17+
Configuration.addDefaultResource("/tmp/core-site.xml");
18+
cfg.writeXml(System.out);
19+
}
20+
catch(Exception e)
21+
{
22+
throw new IOException(e);
23+
}
24+
super.setUp();
25+
}
26+
}

0 commit comments

Comments
 (0)