@Override public Integer apply(ShellTool ssh) { return ((SshTool)ssh).copyFromServer(props, remote, new File(local)); }}); }
@Test(groups = {"Integration"}) public void testCopyFromServer() throws Exception { String contentsWithoutLineBreak = "echo hello world!"; String contents = contentsWithoutLineBreak+"\n"; tool().copyToServer(MutableMap.<String,Object>of(), contents.getBytes(), remoteFilePath); tool().copyFromServer(MutableMap.<String,Object>of(), remoteFilePath, new File(localFilePath)); List<String> actual = Files.readLines(new File(localFilePath), Charsets.UTF_8); assertEquals(actual, ImmutableList.of(contentsWithoutLineBreak)); }