@@ -0,0 +1,2175 @@
+package edu.ucdenver.ccp.util.file;%0A%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.util.List;%0Aimport java.util.UUID;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0A%0A%0Apublic class DirectoryListingTest %7B%0A%09%0A%09%0A%09String suffix=%22.junk%22;%0A%09File testDir;%0A%09File sysTempDir;%0A%09File subDir;%0A%09File file1;%0A%09File file2;%0A%09File file3;%0A%09File file4;%0A%09%0A%09@Before%0A%09public void createDirs() throws IOException %7B%0A%09%09%0A%09    sysTempDir = new File(System.getProperty(%22java.io.tmpdir%22));%0A%09    String dirName = UUID.randomUUID().toString();%0A%09    testDir = new File(sysTempDir, dirName);%0A%09    if (!testDir.mkdir()) %7B%0A%09    %09throw new IOException(%0A%09    %09%09%22failed to create directory in test of PMCCorpusParserTest%22);%0A%09    %7D%0A%09    %0A%09    subDir = new File(testDir, %22subdir%22);%0A%09    if (!subDir.mkdir()) %7B%0A%09    %09throw new IOException(%0A%09    %09%09%22failed to create subdirectory in test of PMCCorpusParserTest%22);%0A%09    %7D%0A%09    %0A%09    file1 = new File(testDir,%22file1%22 + suffix );%0A%09    file1.createNewFile();%0A%09    file2 = new File(testDir,%22file2%22 + suffix );%0A%09    file2.createNewFile();%0A%09    file3 = new File(subDir,%22file3%22 + suffix );%0A%09    file3.createNewFile();%0A%09    file4 = new File(subDir,%22file4%22 + suffix );%0A%09    file4.createNewFile();%0A%09%7D%0A%09%0A%09@After%0A%09public void deleteDirs() %7B%0A%09%09System.out.println(file1.getPath());%0A%09%09System.out.println(file2.getPath());%0A%09%09System.out.println(file3.getPath());%0A%09%09System.out.println(file4.getPath());%0A%09%09%0A%09%09file1.delete();%0A%09%09file2.delete();%0A%09%09file3.delete();%0A%09%09file4.delete();%0A%09%09subDir.delete();%0A%09%09testDir.delete();%0A%09%7D%0A%09%0A%09@Test%0A%09public void TestOneLevel() %7B%0A%09%09List%3CFile%3E list = DirectoryListing.getFiles(testDir.getPath(), suffix, false);%0A%09%09assertTrue(list.contains(file1));%0A%09%09assertTrue(list.contains(file2));%0A%09%09assertFalse(list.contains(file3));%0A%09%09assertFalse(list.contains(file4));%0A%09%09%0A%09%7D%0A%09%0A%09@Test%0A%09public void TestTwoLevels() %7B%0A%09%09List%3CFile%3E list = DirectoryListing.getFiles(testDir.getPath(), suffix, true);%0A%09%09assertTrue(list.contains(file1));%0A%09%09assertTrue(list.contains(file2));%0A%09%09assertTrue(list.contains(file3));%0A%09%09assertTrue(list.contains(file4));%0A%09%7D%0A%0A%7D%0A

test for DirectoryListing class