*/
@RunWith(Parameterized.class)
public class TestAllFiles {
- // map file extensions to the actual mappers
+ private static final File ROOT_DIR = new File("test-data");
+
+ // map file extensions to the actual mappers
private static final Map<String, FileHandler> HANDLERS = new HashMap<String, FileHandler>();
static {
// Excel
HANDLERS.put(".wav", new NullFileHandler());
HANDLERS.put(".pfx", new NullFileHandler());
HANDLERS.put(".xml", new NullFileHandler());
+ HANDLERS.put(".csv", new NullFileHandler());
// map some files without extension
HANDLERS.put("spreadsheet/BigSSTRecord", new NullFileHandler());
@Parameters(name="{index}: {0} using {1}")
public static Iterable<Object[]> files() {
DirectoryScanner scanner = new DirectoryScanner();
- scanner.setBasedir(new File("test-data"));
+ scanner.setBasedir(ROOT_DIR);
scanner.setExcludes(new String[] { "**/.svn/**" });
scanner.scan();
@Test
public void testAllFiles() throws Exception {
assertNotNull("Unknown file extension for file: " + file + ": " + getExtension(file), handler);
- InputStream stream = new BufferedInputStream(new FileInputStream(new File("test-data", file)),100);
+ InputStream stream = new BufferedInputStream(new FileInputStream(new File(ROOT_DIR, file)),100);
try {
handler.handleFile(stream);
stream.close();
}
}
-
+
private static String getExtension(String file) {
int pos = file.lastIndexOf('.');
if(pos == -1 || pos == file.length()-1) {