throw new AssertionFailedError("Log file does not exist: "+logFile);
}
// create a directory
try {
dfsClient.mkdirs( new UTF8( "/data") );
assertMkdirs( "/data", false );
} catch ( IOException ioe ) {
ioe.printStackTrace();
}
try {
dfsClient.mkdirs( new UTF8( "data") );
assertMkdirs( "data", true );
} catch ( IOException ioe ) {
ioe.printStackTrace();
}
//
// create a file with 1 data block
try {
createFile("/data/xx", 1);
assertCreate( "/data/xx", 1, false );
} catch( IOException ioe ) {
assertCreate( "/data/xx", 1, true );
}
// create a file with 2 data blocks
try {
createFile("/data/yy",BLOCK_SIZE+1);
assertCreate( "/data/yy", BLOCK_SIZE+1, false );
} catch( IOException ioe ) {
assertCreate( "/data/yy", BLOCK_SIZE+1, true );
}
// create an existing file
try {
createFile("/data/xx", 2);
assertCreate( "/data/xx", 2, false );
} catch( IOException ioe ) {
assertCreate( "/data/xx", 2, true );
}
// delete the file
try {
dfsClient.delete( new UTF8("/data/yy") );
assertDelete("/data/yy", false);
} catch( IOException ioe ) {
ioe.printStackTrace();
}
// rename the file
try {
dfsClient.rename( new UTF8("/data/xx"), new UTF8("/data/yy") );
assertRename( "/data/xx", "/data/yy", false );
} catch( IOException ioe ) {
ioe.printStackTrace();
}
try {
dfsClient.delete(new UTF8("/data/xx"));
assertDelete("/data/xx", true);
} catch(IOException ioe) {
ioe.printStackTrace();
}
try {
dfsClient.rename( new UTF8("/data/xx"), new UTF8("/data/yy") );
assertRename( "/data/xx", "/data/yy", true );
} catch( IOException ioe) {
ioe.printStackTrace();
}