// Path: javagit/src/test/java/edu/nyu/cs/javagit/TestBase.java
// @Ignore
// public class TestBase extends TestCase {
// 
//     @Before
//     public void setUp() throws IOException, JavaGitException {
//         JavaGitConfiguration.setGitPath(TestProperty.GIT_PATH.asString());
//     }
// }
// 
// Path: javagit/src/test/java/edu/nyu/cs/javagit/test/utilities/TestErrorException.java
// public class TestErrorException extends Throwable {
//     public TestErrorException(Exception e) {
//         super(e);
//     }
// 
//     public TestErrorException(String s, Exception e) {
//         super(s,e);
//     }
// }
// 
// Path: javagit/src/test/java/edu/nyu/cs/javagit/utilities/FileUtilities.java
// public class FileUtilities {
// 
//     /**
//      * Create a temp directory based on the supplied directory base name. The directory will be
//      * created under the temp directory for the system running the program.
//      *
//      * @param baseDirName A base name for the directory. If this directory exists, a directory based on this
//      *                    name will be created.
//      * @return A <code>File</code> instance representing the created directory.
//      */
//     public static File createTempDirectory(String baseDirName) throws IOException {
//         // Get the system temp directory location.
//         File tmpfile = File.createTempFile("AfileName", "tmp");
//         String absPath = tmpfile.getAbsolutePath();
//         tmpfile.delete();
//         int lastSep = absPath.lastIndexOf(File.separatorChar);
//         String tmpDir = absPath.substring(0, lastSep + 1);
// 
//         // System.out.println("Temp Directory: tmpDir=["+ tmpDir + "]");
// 
//         // Create a temp directory for the caller
//         File file = new File(tmpDir + baseDirName);
//         int num = 0;
//         while (!file.mkdir()) {
//             file = new File(tmpDir + baseDirName + Integer.toString(num++));
//         }
// 
//         return file;
//     }
// 
//     /**
//      * Create a new file and write the contents to it.
//      *
//      * @param baseDir  The base directory of the repo.
//      * @param filePath The relative path to the file with respect to the base directory.
//      * @param contents Some contents to write to the file.
//      * @return A <code>File</code> object representation of the file.
//      * @throws IOException If there are problems creating the file or writing the contents to the file.
//      */
//     public static File createFile(File baseDir, String filePath, String contents) throws IOException {
//         File file = new File(baseDir.getPath() + File.separator + filePath);
//         file.createNewFile();
//         FileWriter fw = new FileWriter(file);
//         fw.write(contents);
//         fw.flush();
//         fw.close();
//         return new File(filePath);
//     }
// 
//     /**
//      * Recursively deletes the specified file/directory.
//      *
//      * @param dirOrFile The file or directory to delete recursively and forcefully.
//      * @throws JavaGitException Thrown if a file or directory was not deleted.
//      */
//     public static void removeDirectoryRecursivelyAndForcefully(File dirOrFile)
//             throws JavaGitException {
//         File[] children = dirOrFile.listFiles();
//         if (null != children) {
//             for (File f : children) {
//                 removeDirectoryRecursivelyAndForcefully(f);
//             }
//         }
//         //System.gc();
//         if (!dirOrFile.delete()) {
//             throw new JavaGitException(-1, "-1:  Unable to delete file/directory.  { path=["
//                     + dirOrFile.getAbsolutePath() + "] }");
//         }
//     }
// 
//     /**
//      * Append some text to an existing file.
//      *
//      * @param file       File that will be modified
//      * @param appendText The text that will be appended to the file
//      * @throws FileNotFoundException Exception thrown if the file does not exist.
//      * @throws IOException           thrown if the IO operation fails.
//      */
//     public static void modifyFileContents(File file, String appendText) throws FileNotFoundException,
//             IOException {
//         if (!file.exists()) {
//             throw new FileNotFoundException("File does not exist");
//         }
//         FileWriter fw = new FileWriter(file);
//         fw.append(appendText);
//         fw.close();
//     }
// 
// }
// 
// Path: javagit/src/test/java/edu/nyu/cs/javagit/utilities/TestProperty.java
// public enum TestProperty {
//     GIT_PATH("javagit.test.gitpath", "/usr/bin");
// 
//     private final String value;
//     private final String property;
// 
//     TestProperty(String property, String defaultValue) {
//         this.property = property;
//         this.value = System.getProperty(property, defaultValue);
//     }
// 
//     public String asString() {
//         return value;
//     }
// 
//     public String getName() {
//         return property;
//     }
// }


import edu.nyu.cs.javagit.TestBase;
import edu.nyu.cs.javagit.test.utilities.TestErrorException;
import edu.nyu.cs.javagit.utilities.FileUtilities;
import edu.nyu.cs.javagit.utilities.TestProperty;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
            assertEquals(e.getCode(), 100002);
            pathFile.delete();
        } catch (Exception e) {
            fail("Temp path not containing git generated wrong kind of exception: "
                    + e.getClass().getName());
        }

    /*
     * Set the path using null as the File argument. This is valid - it's saying: wipe out whatever
     * was set before (via previous calls to setGitPath) and just look on the PATH for git.
     */
        pathFile = null;
        try {
            JavaGitConfiguration.setGitPath(pathFile);
        } catch (Exception e) {
            fail("Null path (File) generated exception: " + e.getClass().getName());
        }

        // Grab the version and see if we can get it exception-free.
        String version = "";
        try {
            version = JavaGitConfiguration.getGitVersion();
        } catch (Exception e) {
            fail("Couldn't get git version string - saw \"" + version + "\" and got exception: "
                    + e.getClass().getName());
        }
    }

    public void testPathSeparator_issue2() throws TestErrorException {
        try {
// Path: javagit/src/test/java/edu/nyu/cs/javagit/TestBase.java
// @Ignore
// public class TestBase extends TestCase {
// 
//     @Before
//     public void setUp() throws IOException, JavaGitException {
//         JavaGitConfiguration.setGitPath(TestProperty.GIT_PATH.asString());
//     }
// }
// 
// Path: javagit/src/test/java/edu/nyu/cs/javagit/test/utilities/TestErrorException.java
// public class TestErrorException extends Throwable {
//     public TestErrorException(Exception e) {
//         super(e);
//     }
// 
//     public TestErrorException(String s, Exception e) {
//         super(s,e);
//     }
// }
// 
// Path: javagit/src/test/java/edu/nyu/cs/javagit/utilities/FileUtilities.java
// public class FileUtilities {
// 
//     /**
//      * Create a temp directory based on the supplied directory base name. The directory will be
//      * created under the temp directory for the system running the program.
//      *
//      * @param baseDirName A base name for the directory. If this directory exists, a directory based on this
//      *                    name will be created.
//      * @return A <code>File</code> instance representing the created directory.
//      */
//     public static File createTempDirectory(String baseDirName) throws IOException {
//         // Get the system temp directory location.
//         File tmpfile = File.createTempFile("AfileName", "tmp");
//         String absPath = tmpfile.getAbsolutePath();
//         tmpfile.delete();
//         int lastSep = absPath.lastIndexOf(File.separatorChar);
//         String tmpDir = absPath.substring(0, lastSep + 1);
// 
//         // System.out.println("Temp Directory: tmpDir=["+ tmpDir + "]");
// 
//         // Create a temp directory for the caller
//         File file = new File(tmpDir + baseDirName);
//         int num = 0;
//         while (!file.mkdir()) {
//             file = new File(tmpDir + baseDirName + Integer.toString(num++));
//         }
// 
//         return file;
//     }
// 
//     /**
//      * Create a new file and write the contents to it.
//      *
//      * @param baseDir  The base directory of the repo.
//      * @param filePath The relative path to the file with respect to the base directory.
//      * @param contents Some contents to write to the file.
//      * @return A <code>File</code> object representation of the file.
//      * @throws IOException If there are problems creating the file or writing the contents to the file.
//      */
//     public static File createFile(File baseDir, String filePath, String contents) throws IOException {
//         File file = new File(baseDir.getPath() + File.separator + filePath);
//         file.createNewFile();
//         FileWriter fw = new FileWriter(file);
//         fw.write(contents);
//         fw.flush();
//         fw.close();
//         return new File(filePath);
//     }
// 
//     /**
//      * Recursively deletes the specified file/directory.
//      *
//      * @param dirOrFile The file or directory to delete recursively and forcefully.
//      * @throws JavaGitException Thrown if a file or directory was not deleted.
//      */
//     public static void removeDirectoryRecursivelyAndForcefully(File dirOrFile)
//             throws JavaGitException {
//         File[] children = dirOrFile.listFiles();
//         if (null != children) {
//             for (File f : children) {
//                 removeDirectoryRecursivelyAndForcefully(f);
//             }
//         }
//         //System.gc();
//         if (!dirOrFile.delete()) {
//             throw new JavaGitException(-1, "-1:  Unable to delete file/directory.  { path=["
//                     + dirOrFile.getAbsolutePath() + "] }");
//         }
//     }
// 
//     /**
//      * Append some text to an existing file.
//      *
//      * @param file       File that will be modified
//      * @param appendText The text that will be appended to the file
//      * @throws FileNotFoundException Exception thrown if the file does not exist.
//      * @throws IOException           thrown if the IO operation fails.
//      */
//     public static void modifyFileContents(File file, String appendText) throws FileNotFoundException,
//             IOException {
//         if (!file.exists()) {
//             throw new FileNotFoundException("File does not exist");
//         }
//         FileWriter fw = new FileWriter(file);
//         fw.append(appendText);
//         fw.close();
//     }
// 
// }
// 
// Path: javagit/src/test/java/edu/nyu/cs/javagit/utilities/TestProperty.java
// public enum TestProperty {
//     GIT_PATH("javagit.test.gitpath", "/usr/bin");
// 
//     private final String value;
//     private final String property;
// 
//     TestProperty(String property, String defaultValue) {
//         this.property = property;
//         this.value = System.getProperty(property, defaultValue);
//     }
// 
//     public String asString() {
//         return value;
//     }
// 
//     public String getName() {
//         return property;
//     }
// }


// Path: javagit/src/test/java/edu/nyu/cs/javagit/api/TestJavaGitConfiguration.java
import edu.nyu.cs.javagit.TestBase;
import edu.nyu.cs.javagit.test.utilities.TestErrorException;
import edu.nyu.cs.javagit.utilities.FileUtilities;
import edu.nyu.cs.javagit.utilities.TestProperty;
import org.junit.Test;
import java.io.File;
import java.io.IOException;

            assertEquals(e.getCode(), 100002);
            pathFile.delete();
        } catch (Exception e) {
            fail("Temp path not containing git generated wrong kind of exception: "
                    + e.getClass().getName());
        }

    /*
     * Set the path using null as the File argument. This is valid - it's saying: wipe out whatever
     * was set before (via previous calls to setGitPath) and just look on the PATH for git.
     */
        pathFile = null;
        try {
            JavaGitConfiguration.setGitPath(pathFile);
        } catch (Exception e) {
            fail("Null path (File) generated exception: " + e.getClass().getName());
        }

        // Grab the version and see if we can get it exception-free.
        String version = "";
        try {
            version = JavaGitConfiguration.getGitVersion();
        } catch (Exception e) {
            fail("Couldn't get git version string - saw \"" + version + "\" and got exception: "
                    + e.getClass().getName());
        }
    }

    public void testPathSeparator_issue2() throws TestErrorException {
        try {
            JavaGitConfiguration.setGitPath(TestProperty.GIT_PATH.asString());