// 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/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();
//     }
// 
// }


import edu.nyu.cs.javagit.TestBase;
import edu.nyu.cs.javagit.api.JavaGitException;
import edu.nyu.cs.javagit.utilities.FileUtilities;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
                                                            String expectedMessage) {
        try {
            commit.commit(repoPath, message);
            fail("No IllegalArgumentException thrown when one was expected.  Error!");
        } catch (IllegalArgumentException e) {
            assertEquals(
                    "The message from the caught IllegalArgumentException is not what was expected!",
                    expectedMessage, e.getMessage());
        } catch (Throwable e) {
            e.printStackTrace();
            fail("Caught Throwable when none was expected.  Error!");
        }
    }

    private void assertCommitOnlyNPEThrown(File repoPath, String message, List<File> paths,
                                           String expectedMessage) {
        try {
            commit.commitOnly(repoPath, message, paths);
            fail("No NullPointerException thrown when one was expected.  Error!");
        } catch (NullPointerException e) {
            assertEquals("The message from the caught NPE is not what was expected!", expectedMessage, e
                    .getMessage());
        } catch (Throwable e) {
            e.printStackTrace();
            fail("Caught Throwable when none was expected.  Error!");
        }
    }

    private void assertCommitOnlyIllegalArgumentExceptionThrown(File repoPath, String message,
                                                                List<File> paths, String expectedMessage) {
// 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/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/api/commands/TestGitCommit.java
import edu.nyu.cs.javagit.TestBase;
import edu.nyu.cs.javagit.api.JavaGitException;
import edu.nyu.cs.javagit.utilities.FileUtilities;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

                                                            String expectedMessage) {
        try {
            commit.commit(repoPath, message);
            fail("No IllegalArgumentException thrown when one was expected.  Error!");
        } catch (IllegalArgumentException e) {
            assertEquals(
                    "The message from the caught IllegalArgumentException is not what was expected!",
                    expectedMessage, e.getMessage());
        } catch (Throwable e) {
            e.printStackTrace();
            fail("Caught Throwable when none was expected.  Error!");
        }
    }

    private void assertCommitOnlyNPEThrown(File repoPath, String message, List<File> paths,
                                           String expectedMessage) {
        try {
            commit.commitOnly(repoPath, message, paths);
            fail("No NullPointerException thrown when one was expected.  Error!");
        } catch (NullPointerException e) {
            assertEquals("The message from the caught NPE is not what was expected!", expectedMessage, e
                    .getMessage());
        } catch (Throwable e) {
            e.printStackTrace();
            fail("Caught Throwable when none was expected.  Error!");
        }
    }

    private void assertCommitOnlyIllegalArgumentExceptionThrown(File repoPath, String message,
                                                                List<File> paths, String expectedMessage) {
        try {