@@ -0,0 +1,2075 @@
+package jfdi.test.storage;%0A%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.junit.Assert.fail;%0A%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.Paths;%0A%0Aimport java.util.ArrayList;%0A%0Aimport jfdi.storage.Constants;%0Aimport jfdi.storage.RecordManager;%0Aimport jfdi.storage.exceptions.ExistingFilesFoundException;%0A%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0A%0Apublic class RecordManagerTest %7B%0A%0A    private static Path testDirectory = null;%0A    private static String testDirectoryString = null;%0A%0A    @BeforeClass%0A    public static void setUpBeforeClass() throws Exception %7B%0A        testDirectory = Files.createTempDirectory(Constants.TEST_DIRECTORY_NAME);%0A        testDirectoryString = testDirectory.toString();%0A    %7D%0A%0A    @Test%0A    public void testSetAndGetAllFilePaths() %7B%0A        // Test setting of all file paths%0A        RecordManager.setAllFilePaths(testDirectoryString);%0A%0A        // Test getting of all file paths%0A        ArrayList%3CPath%3E obtainedFilePaths = RecordManager.getAllFilePaths();%0A        ArrayList%3CPath%3E expectedFilePaths = new ArrayList%3CPath%3E();%0A        Path filePath;%0A        for (String filename : Constants.ARRAY_FILENAMES) %7B%0A            filePath = Paths.get(testDirectoryString, filename);%0A            expectedFilePaths.add(filePath);%0A        %7D%0A%0A        assertTrue(TestHelper.hasSameElements(expectedFilePaths, obtainedFilePaths));%0A    %7D%0A%0A    @Test%0A    public void testLoadAllRecords() %7B%0A        // Test setting of all file paths%0A        RecordManager.setAllFilePaths(testDirectoryString);%0A        TestHelper.createValidDataFiles(testDirectoryString);%0A        try %7B%0A            RecordManager.loadAllRecords();%0A        %7D catch (ExistingFilesFoundException e) %7B%0A            fail(e.getMessage());%0A        %7D%0A    %7D%0A%0A    @Test(expected = ExistingFilesFoundException.class)%0A    public void testLoadAllRecordsWithInvalidData() throws Exception %7B%0A        RecordManager.setAllFilePaths(testDirectoryString);%0A        TestHelper.createInvalidDataFiles(testDirectoryString);%0A        RecordManager.loadAllRecords();%0A    %7D%0A%0A%7D%0A

Add RecordManagerTest