FileDataSource extends AbstractDataSource { @Override public String getNiceFileName(boolean shortNames, String inputPaths) { return glomName(shortNames, inputPaths, file); } FileDataSource(File file); @Override InputStream getInputStream(); @Override String getNiceFileName(boolean shortNames, String inputPaths); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testShortNamesSingleFile() { assertEquals(SOMEFILE_TXT, ds.getNiceFileName(true, someFile.getAbsolutePath())); }
@Test public void testShortNamesSingleDir() { assertEquals(SOMEFILE_TXT, ds.getNiceFileName(true, someFolder.getAbsolutePath())); }
@Test public void testShortNamesNullBase() { assertEquals(SOMEFILE_TXT, ds.getNiceFileName(true, null)); }
@Test public void testShortNamesCommaSeparatedDirs() { assertEquals(SOMEFILE_TXT, ds.getNiceFileName(true, SOMEFILE_DIR + "," + someFolder.getAbsolutePath())); }
@Test public void testShortNamesCommaSeparatedFiles() { assertEquals(SOMEFILE_TXT, ds.getNiceFileName(true, SOMEFILE_TXT_FULL_PATH + "," + someFile.getAbsolutePath())); }
@Test public void testShortNamesCommaSeparatedMixed() { assertEquals(SOMEFILE_TXT, ds.getNiceFileName(true, SOMEFILE_TXT_FULL_PATH + "," + someFolder.getAbsolutePath())); }
@Test public void testLongNamesSingleFile() throws IOException { assertEquals(someFile.getCanonicalFile().getAbsolutePath(), ds.getNiceFileName(false, someFile.getAbsolutePath())); }
@Test public void testLongNamesSingleDir() throws IOException { assertEquals(someFile.getCanonicalFile().getAbsolutePath(), ds.getNiceFileName(false, someFolder.getAbsolutePath())); }
@Test public void testLongNamesNullBase() throws IOException { assertEquals(someFile.getCanonicalFile().getAbsolutePath(), ds.getNiceFileName(false, null)); }
@Test public void testLongNamesCommaSeparatedDirs() throws IOException { assertEquals(someFile.getCanonicalFile().getAbsolutePath(), ds.getNiceFileName(false, SOMEFILE_DIR + "," + someFolder.getAbsolutePath())); }
@Test public void testLongNamesCommaSeparatedFiles() throws IOException { assertEquals(someFile.getCanonicalFile().getAbsolutePath(), ds.getNiceFileName(false, SOMEFILE_TXT_FULL_PATH + "," + someFile.getAbsolutePath())); }
@Test public void testLongNamesCommaSeparatedMixed() throws IOException { assertEquals(someFile.getCanonicalFile().getAbsolutePath(), ds.getNiceFileName(false, SOMEFILE_TXT_FULL_PATH + "," + someFolder.getAbsolutePath())); }