// 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/FileUtilsImpl.java
// public class FileUtilsImpl implements FileUtils {
//   private static FileUtilsImpl FILE_UTILS_IMPL = new FileUtilsImpl();
// 
//   @Override
//   public void copyDirectoryToDirectory(File from, File to) throws IOException {
//     org.apache.commons.io.FileUtils.copyDirectoryToDirectory(from, to);
//   }
// 
//   @Override
//   public void copyFileToDirectory(File from, File to) throws IOException {
//     org.apache.commons.io.FileUtils.copyFileToDirectory(from, to);
//   }
// 
//   @Override
//   public void createDirectories(Path path) throws IOException {
//     Files.createDirectories(path);
//   }
// 
//   @Override
//   public Path createTempDirectory(String dirPrefix) throws IOException {
//     return Files.createTempDirectory(dirPrefix);
//   }
// 
//   @Override
//   public boolean deleteQuietly(File file) {
//     return org.apache.commons.io.FileUtils.deleteQuietly(file);
//   }
// 
//   @Override
//   public boolean exists(Path path) {
//     return Files.exists(path);
//   }
// 
//   public static FileUtilsImpl getFileUtilsImpl() {
//     return FILE_UTILS_IMPL;
//   }
// 
//   @Override
//   public boolean isDirectory(Path path) {
//     return Files.isDirectory(path);
//   }
// 
//   @Override
//   public Process runCommand(List<String> command, File pwdFile) throws IOException {
//     ProcessBuilder pb = new ProcessBuilder();
//     pb.command(command).directory(pwdFile);
//     return pb.start();
//   }
// 
//   @Override
//   public void write(Path path, String content) throws IOException {
//     StandardOpenOption[] options = new StandardOpenOption[3];
// 
//     options[0] = StandardOpenOption.CREATE;
//     options[1] = StandardOpenOption.WRITE;
//     options[2] = StandardOpenOption.APPEND;
// 
//     Collection<String> lines = new ArrayList<>();
//     lines.add(content);
//     Files.write(path, lines, Charset.defaultCharset(), options);
//   }
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import me.gregorias.dfuntest.util.FileUtils;
import me.gregorias.dfuntest.util.FileUtilsImpl;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
package me.gregorias.dfuntest;




public class LocalEnvironmentTest {
  @Rule
  public TemporaryFolder mTempFolder = new TemporaryFolder();

  private static final String PREFIX = "NEBTMP";
  private Path mEnvDir;
  private Path mLocalDir;

  private Environment mLocalEnvironment;

  @Before
  public void setUp() throws IOException {
    mEnvDir = mTempFolder.newFolder().toPath();
    mLocalDir = mTempFolder.newFolder().toPath();

// 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/FileUtilsImpl.java
// public class FileUtilsImpl implements FileUtils {
//   private static FileUtilsImpl FILE_UTILS_IMPL = new FileUtilsImpl();
// 
//   @Override
//   public void copyDirectoryToDirectory(File from, File to) throws IOException {
//     org.apache.commons.io.FileUtils.copyDirectoryToDirectory(from, to);
//   }
// 
//   @Override
//   public void copyFileToDirectory(File from, File to) throws IOException {
//     org.apache.commons.io.FileUtils.copyFileToDirectory(from, to);
//   }
// 
//   @Override
//   public void createDirectories(Path path) throws IOException {
//     Files.createDirectories(path);
//   }
// 
//   @Override
//   public Path createTempDirectory(String dirPrefix) throws IOException {
//     return Files.createTempDirectory(dirPrefix);
//   }
// 
//   @Override
//   public boolean deleteQuietly(File file) {
//     return org.apache.commons.io.FileUtils.deleteQuietly(file);
//   }
// 
//   @Override
//   public boolean exists(Path path) {
//     return Files.exists(path);
//   }
// 
//   public static FileUtilsImpl getFileUtilsImpl() {
//     return FILE_UTILS_IMPL;
//   }
// 
//   @Override
//   public boolean isDirectory(Path path) {
//     return Files.isDirectory(path);
//   }
// 
//   @Override
//   public Process runCommand(List<String> command, File pwdFile) throws IOException {
//     ProcessBuilder pb = new ProcessBuilder();
//     pb.command(command).directory(pwdFile);
//     return pb.start();
//   }
// 
//   @Override
//   public void write(Path path, String content) throws IOException {
//     StandardOpenOption[] options = new StandardOpenOption[3];
// 
//     options[0] = StandardOpenOption.CREATE;
//     options[1] = StandardOpenOption.WRITE;
//     options[2] = StandardOpenOption.APPEND;
// 
//     Collection<String> lines = new ArrayList<>();
//     lines.add(content);
//     Files.write(path, lines, Charset.defaultCharset(), options);
//   }
// }


// Path: core/src/test/java/me/gregorias/dfuntest/LocalEnvironmentTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import me.gregorias.dfuntest.util.FileUtils;
import me.gregorias.dfuntest.util.FileUtilsImpl;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

package me.gregorias.dfuntest;




public class LocalEnvironmentTest {
  @Rule
  public TemporaryFolder mTempFolder = new TemporaryFolder();

  private static final String PREFIX = "NEBTMP";
  private Path mEnvDir;
  private Path mLocalDir;

  private Environment mLocalEnvironment;

  @Before
  public void setUp() throws IOException {
    mEnvDir = mTempFolder.newFolder().toPath();
    mLocalDir = mTempFolder.newFolder().toPath();

    mLocalEnvironment = new LocalEnvironment(0, mEnvDir, FileUtilsImpl.getFileUtilsImpl());