View view = action.process(request, response);
// check file information available and the right view is returned
assertEquals(FileMetaData.BLOG_FILE, action.getModel().get("type"));
FileMetaData fileMetaData = (FileMetaData)action.getModel().get("directory");
assertEquals("/", fileMetaData.getAbsolutePath());
assertTrue(fileMetaData.isDirectory());
assertEquals("uploadFileToBlog.secureaction", action.getModel().get("uploadAction"));
assertTrue(view instanceof FilesView);
List files = (List)action.getModel().get("files");
assertEquals(4, files.size());
// the files should be in this order
// - a, z, b.txt, y.txt (directories followed by files, both alphabetically)
FileMetaData file = (FileMetaData)files.get(0);
assertEquals("a", file.getName());
assertEquals("/", file.getPath());
assertTrue(file.isDirectory());
file = (FileMetaData)files.get(1);
assertEquals("z", file.getName());
assertEquals("/", file.getPath());
assertTrue(file.isDirectory());
file = (FileMetaData)files.get(2);
assertEquals("b.txt", file.getName());
assertEquals("/", file.getPath());
assertFalse(file.isDirectory());
file = (FileMetaData)files.get(3);
assertEquals("y.txt", file.getName());
assertEquals("/", file.getPath());
assertFalse(file.isDirectory());
// and clean up
fileManager.deleteFile("/", "a");
fileManager.deleteFile("/", "z");
fileManager.deleteFile("/", "y.txt");