args[1] = "fs.default.name="+namenode;
execute(args, namenode);
}
private void execute( String [] args, String namenode ) {
DFSShell shell=new DFSShell();
FileSystem fs=null;
try {
shell.doMain(new Configuration(), args);
fs = new DistributedFileSystem(
DataNode.createSocketAddr(namenode),
shell.getConf());
assertTrue( "Directory does not get created",
fs.isDirectory(new Path("/data")) );
fs.delete(new Path("/data"));
} catch (Exception e) {
System.err.println(e.getMessage());