// Path: core/src/main/java/me/gregorias/dfuntest/util/FileUtils.java
// public interface FileUtils {
//   /**
//    * {@link org.apache.commons.io.FileUtils#copyDirectoryToDirectory(java.io.File, java.io.File)}
//    *
//    * @param from Source path
//    * @param to Target directory path
//    */
//   void copyDirectoryToDirectory(File from, File to) throws IOException;
// 
//   /**
//    * {@link org.apache.commons.io.FileUtils#copyFileToDirectory(java.io.File, java.io.File)}
//    *
//    * @param from Source path
//    * @param to Target directory path
//    */
//   void copyFileToDirectory(File from, File to) throws IOException;
// 
//   /**
//    * {@link java.nio.file.Files#createDirectories(java.nio.file.Path,
//    *   java.nio.file.attribute.FileAttribute[])}
//    *
//    * @param path Path to create
//    */
//   void createDirectories(Path path) throws IOException;
// 
//   /**
//    * {@link java.nio.file.Files#createTempDirectory(
//    * String, java.nio.file.attribute.FileAttribute[])}
//    *
//    * @param dirPrefix prefix of temporary directory
//    * @return Path to created directory
//    */
//   Path createTempDirectory(String dirPrefix) throws IOException;
// 
//   /**
//    * {@link org.apache.commons.io.FileUtils#deleteQuietly(java.io.File)}
//    *
//    * @param file File to delete
//    * @return true iff directory was deleted
//    */
//   boolean deleteQuietly(File file);
// 
//   /**
//    * {@link java.nio.file.Files#exists(java.nio.file.Path, java.nio.file.LinkOption...)}
//    *
//    * @param path path to check
//    * @return true iff exists
//    */
//   boolean exists(Path path);
// 
//   /**
//    * {@link java.nio.file.Files#isDirectory(java.nio.file.Path, java.nio.file.LinkOption...)}
//    *
//    * @param path path to check
//    * @return true iff path is a directory
//    */
//   boolean isDirectory(Path path);
// 
//   /**
//    * {@link java.lang.ProcessBuilder}
//    *
//    * @param command command to run
//    * @param pwdFile working directory of the process
//    * @return process running the command
//    */
//   Process runCommand(List<String> command, File pwdFile) throws IOException;
// 
//   /**
//    * {@link java.nio.file.Files#write(java.nio.file.Path, Iterable, java.nio.charset.Charset,
//    * java.nio.file.OpenOption...)}
//    *
//    * @param path Path of file to write to.
//    * @param content String to be written to file.
//    */
//   void write(Path path, String content) throws IOException;
// }
// 
// Path: core/src/main/java/me/gregorias/dfuntest/util/SSHClientFactory.java
// public class SSHClientFactory {
//   private static SSHClientFactory SSH_CLIENT_FACTORY = null;
// 
//   public static synchronized SSHClientFactory getSSHClientFactory() {
//     if (SSH_CLIENT_FACTORY == null) {
//       SSH_CLIENT_FACTORY = new SSHClientFactory();
//     }
//     return SSH_CLIENT_FACTORY;
//   }
// 
//   public SSHClient newSSHClient() {
//     return new SSHClient();
//   }
// }


import me.gregorias.dfuntest.util.FileUtils;
import me.gregorias.dfuntest.util.SSHClientFactory;
import net.schmizz.sshj.SSHClient;
import net.schmizz.sshj.connection.ConnectionException;
import net.schmizz.sshj.connection.channel.direct.Session;
import net.schmizz.sshj.connection.channel.direct.Session.Command;
import net.schmizz.sshj.sftp.SFTPClient;
import net.schmizz.sshj.xfer.LocalDestFile;
import net.schmizz.sshj.xfer.LocalSourceFile;
import net.schmizz.sshj.xfer.scp.SCPFileTransfer;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.StringUtils;
import org.junit.Before;
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import java.io.IOException;
import java.net.InetAddress;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.contains;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
package me.gregorias.dfuntest;




@SuppressWarnings("unchecked")
public class SSHEnvironmentTest {
  private static final int ID = 0;
  private static final String USERNAME = "username";
  private static final Path PRIVATE_KEY_PATH = FileSystems.getDefault().getPath("key");
  private static final InetAddress REMOTE_ADDRESS = InetAddress.getLoopbackAddress();
  private static final String REMOTE_HOME_PATH = "home";
  private static final Executor EXECUTOR = Executors.newSingleThreadExecutor();

  private SSHClient mMockSSHClient = null;
  private SSHEnvironment mSSHEnv = null;
  private FileUtils mMockFileUtils = null;

  @Before
  public void setUp() {
// Path: core/src/main/java/me/gregorias/dfuntest/util/FileUtils.java
// public interface FileUtils {
//   /**
//    * {@link org.apache.commons.io.FileUtils#copyDirectoryToDirectory(java.io.File, java.io.File)}
//    *
//    * @param from Source path
//    * @param to Target directory path
//    */
//   void copyDirectoryToDirectory(File from, File to) throws IOException;
// 
//   /**
//    * {@link org.apache.commons.io.FileUtils#copyFileToDirectory(java.io.File, java.io.File)}
//    *
//    * @param from Source path
//    * @param to Target directory path
//    */
//   void copyFileToDirectory(File from, File to) throws IOException;
// 
//   /**
//    * {@link java.nio.file.Files#createDirectories(java.nio.file.Path,
//    *   java.nio.file.attribute.FileAttribute[])}
//    *
//    * @param path Path to create
//    */
//   void createDirectories(Path path) throws IOException;
// 
//   /**
//    * {@link java.nio.file.Files#createTempDirectory(
//    * String, java.nio.file.attribute.FileAttribute[])}
//    *
//    * @param dirPrefix prefix of temporary directory
//    * @return Path to created directory
//    */
//   Path createTempDirectory(String dirPrefix) throws IOException;
// 
//   /**
//    * {@link org.apache.commons.io.FileUtils#deleteQuietly(java.io.File)}
//    *
//    * @param file File to delete
//    * @return true iff directory was deleted
//    */
//   boolean deleteQuietly(File file);
// 
//   /**
//    * {@link java.nio.file.Files#exists(java.nio.file.Path, java.nio.file.LinkOption...)}
//    *
//    * @param path path to check
//    * @return true iff exists
//    */
//   boolean exists(Path path);
// 
//   /**
//    * {@link java.nio.file.Files#isDirectory(java.nio.file.Path, java.nio.file.LinkOption...)}
//    *
//    * @param path path to check
//    * @return true iff path is a directory
//    */
//   boolean isDirectory(Path path);
// 
//   /**
//    * {@link java.lang.ProcessBuilder}
//    *
//    * @param command command to run
//    * @param pwdFile working directory of the process
//    * @return process running the command
//    */
//   Process runCommand(List<String> command, File pwdFile) throws IOException;
// 
//   /**
//    * {@link java.nio.file.Files#write(java.nio.file.Path, Iterable, java.nio.charset.Charset,
//    * java.nio.file.OpenOption...)}
//    *
//    * @param path Path of file to write to.
//    * @param content String to be written to file.
//    */
//   void write(Path path, String content) throws IOException;
// }
// 
// Path: core/src/main/java/me/gregorias/dfuntest/util/SSHClientFactory.java
// public class SSHClientFactory {
//   private static SSHClientFactory SSH_CLIENT_FACTORY = null;
// 
//   public static synchronized SSHClientFactory getSSHClientFactory() {
//     if (SSH_CLIENT_FACTORY == null) {
//       SSH_CLIENT_FACTORY = new SSHClientFactory();
//     }
//     return SSH_CLIENT_FACTORY;
//   }
// 
//   public SSHClient newSSHClient() {
//     return new SSHClient();
//   }
// }


// Path: core/src/test/java/me/gregorias/dfuntest/SSHEnvironmentTest.java
import me.gregorias.dfuntest.util.FileUtils;
import me.gregorias.dfuntest.util.SSHClientFactory;
import net.schmizz.sshj.SSHClient;
import net.schmizz.sshj.connection.ConnectionException;
import net.schmizz.sshj.connection.channel.direct.Session;
import net.schmizz.sshj.connection.channel.direct.Session.Command;
import net.schmizz.sshj.sftp.SFTPClient;
import net.schmizz.sshj.xfer.LocalDestFile;
import net.schmizz.sshj.xfer.LocalSourceFile;
import net.schmizz.sshj.xfer.scp.SCPFileTransfer;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.StringUtils;
import org.junit.Before;
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import java.io.IOException;
import java.net.InetAddress;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.contains;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

package me.gregorias.dfuntest;




@SuppressWarnings("unchecked")
public class SSHEnvironmentTest {
  private static final int ID = 0;
  private static final String USERNAME = "username";
  private static final Path PRIVATE_KEY_PATH = FileSystems.getDefault().getPath("key");
  private static final InetAddress REMOTE_ADDRESS = InetAddress.getLoopbackAddress();
  private static final String REMOTE_HOME_PATH = "home";
  private static final Executor EXECUTOR = Executors.newSingleThreadExecutor();

  private SSHClient mMockSSHClient = null;
  private SSHEnvironment mSSHEnv = null;
  private FileUtils mMockFileUtils = null;

  @Before
  public void setUp() {
    SSHClientFactory mockSSHClientFactory = mock(SSHClientFactory.class);