}
public void testExistence2() throws Exception {
AppContextForTesting.initForTest();
IMocksControl control = EasyMock.createControl();
FileSystem fileSystem = control.createMock(FileSystem.class);
CommandRunner cmd = control.createMock(CommandRunner.class);
AppContext.RUN.cmd = cmd;
AppContext.RUN.fileSystem = fileSystem;
File file1 = new File("/1/foo");
File file2 = new File("/2/foo");
expect(fileSystem.exists(file1)).andReturn(false);
expect(fileSystem.exists(file2)).andReturn(true);
expect(fileSystem.isExecutable(file1)).andReturn(false);
expect(fileSystem.isExecutable(file2)).andReturn(false);
expect(cmd.runCommand("diff", ImmutableList.of("-N", "/1/foo", "/2/foo"), "")).andThrow(
new CommandRunner.CommandException(
"diff", ImmutableList.of("-N", "/1/foo", "/2/foo"), "foo", "", 1));
control.replay();