public void testListFiles() { // see if it just works. try { ArrayList<File> testdata1 = FileUtils.getAllImageFiles(new File("testdata/ferrari/black"), true); assertEquals(19, testdata1.size()); } catch (IOException e) { e.printStackTrace(); } // see if it just fails. try { ArrayList<File> testdata2 = null; testdata2 = FileUtils.getAllImageFiles(new File("testdata/ferrari/black/nothing"), true); fail(); } catch (Exception e) { // e.printStackTrace(); } }
public void testListFilesString() { // see if it just works. try { ArrayList<String> testdata1 = FileUtils.getAllImages(new File("testdata/ferrari/black"), true); assertEquals(19, testdata1.size()); } catch (IOException e) { e.printStackTrace(); } // see if it just fails. try { ArrayList<String> testdata2 = null; testdata2 = FileUtils.getAllImages(new File("testdata/ferrari/black/nothing"), true); fail(); } catch (Exception e) { // e.printStackTrace(); } }