@Test
public void testListAllDirCommand() throws TimeoutException
{
File tempDir = OperatingSystemUtils.createTempDir();
DirectoryResource tempResource = resourceFactory.create(tempDir).reify(DirectoryResource.class);
DirectoryResource childDirectory = tempResource.getChildDirectory("child");
childDirectory.mkdir();
FileResource<?> afile = tempResource.getChild(".afile").reify(FileResource.class);
afile.createNewFile();
afile.deleteOnExit();
childDirectory.deleteOnExit();
tempDir.deleteOnExit();
Shell shell = shellTest.getShell();
shell.setCurrentResource(tempResource);
shellTest.execute("ls", 10, TimeUnit.SECONDS);
Assert.assertNotNull(shellTest.getStdOut());
Assert.assertThat(shellTest.getStdOut(), not(containsString(".afile")));
shellTest.execute("ls -a", 10, TimeUnit.SECONDS);
Assert.assertThat(shellTest.getStdOut(), containsString("child"));
Assert.assertThat(shellTest.getStdOut(), containsString(".afile"));
shellTest.execute("ls --all", 10, TimeUnit.SECONDS);
Assert.assertNotNull(shellTest.getStdOut());
Assert.assertThat(shellTest.getStdOut(), containsString("child"));
Assert.assertThat(shellTest.getStdOut(), containsString(".afile"));
afile.delete();
childDirectory.delete();
tempDir.delete();
}