@Test public void verify_bulk_file_transfer_parallel() { int fileCount = 100; List<ByteBlob> blobs = new ArrayList<ByteBlob>(); List<String> paths = new ArrayList<String>(); for(int i = 0; i != fileCount; ++i) { ByteBlob blob = new ByteBlob("test-blob-" + i, generateData(i)); blobs.add(blob); } paths.addAll(console.cacheFiles(blobs)); for(int i = 0; i != fileCount; ++i) { String path = paths.get(i); assertTrue(new File(path).isFile()); assertEquals("File size ", (30 << 10) + i, new File(path).length()); } }
@Override public List<String> cacheFiles(List<? extends FileBlob> blobs) { ensureRunning(); List<String> result = new ArrayList<String>(); for(FileBlob blob: blobs) { result.add(cacheFile(blob)); } return result; }
LocalControlConsole implements HostControlConsole { @Override public List<String> cacheFiles(List<? extends FileBlob> blobs) { ensureRunning(); List<String> result = new ArrayList<String>(); for(FileBlob blob: blobs) { result.add(cacheFile(blob)); } return result; } }
LocalControlConsole implements HostControlConsole { @Override public List<String> cacheFiles(List<? extends FileBlob> blobs) { ensureRunning(); List<String> result = new ArrayList<String>(); for(FileBlob blob: blobs) { result.add(cacheFile(blob)); } return result; } LocalControlConsole();  LocalControlConsole(String tmpDir); }
LocalControlConsole implements HostControlConsole { @Override public List<String> cacheFiles(List<? extends FileBlob> blobs) { ensureRunning(); List<String> result = new ArrayList<String>(); for(FileBlob blob: blobs) { result.add(cacheFile(blob)); } return result; } LocalControlConsole();  LocalControlConsole(String tmpDir); @Override boolean isLocalFileSystem(); @Override String cacheFile(FileBlob blob); @Override List<String> cacheFiles(List<? extends FileBlob> blobs); @Override Destroyable openSocket(SocketHandler handler); @Override Destroyable startProcess(String workingDir, String[] command, Map<String, String> env, ProcessHandler handler); @Override void terminate(); File getCacheDir(); }
LocalControlConsole implements HostControlConsole { @Override public List<String> cacheFiles(List<? extends FileBlob> blobs) { ensureRunning(); List<String> result = new ArrayList<String>(); for(FileBlob blob: blobs) { result.add(cacheFile(blob)); } return result; } LocalControlConsole();  LocalControlConsole(String tmpDir); @Override boolean isLocalFileSystem(); @Override String cacheFile(FileBlob blob); @Override List<String> cacheFiles(List<? extends FileBlob> blobs); @Override Destroyable openSocket(SocketHandler handler); @Override Destroyable startProcess(String workingDir, String[] command, Map<String, String> env, ProcessHandler handler); @Override void terminate(); File getCacheDir();  }