You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2015/01/02 22:07:14 UTC
svn commit: r1649124 -
/poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java
Author: centic
Date: Fri Jan 2 21:07:14 2015
New Revision: 1649124
URL: http://svn.apache.org/r1649124
Log:
Extract ROOT_DIR into constant, ignore .csv files
Modified:
poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java
Modified: poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java?rev=1649124&r1=1649123&r2=1649124&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java Fri Jan 2 21:07:14 2015
@@ -65,7 +65,9 @@ import org.junit.runners.Parameterized.P
*/
@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
@@ -136,6 +138,7 @@ public class TestAllFiles {
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());
@@ -223,7 +226,7 @@ public class TestAllFiles {
@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();
@@ -248,7 +251,7 @@ public class TestAllFiles {
@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);
@@ -263,7 +266,7 @@ public class TestAllFiles {
stream.close();
}
}
-
+
private static String getExtension(String file) {
int pos = file.lastIndexOf('.');
if(pos == -1 || pos == file.length()-1) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org