Repository: tika
Updated Branches:
  refs/heads/2.x a882a3242 -> 2a69db7bb


TIKA-1928 More tests for files with # in them


Project: http://git-wip-us.apache.org/repos/asf/tika/repo
Commit: http://git-wip-us.apache.org/repos/asf/tika/commit/398e73de
Tree: http://git-wip-us.apache.org/repos/asf/tika/tree/398e73de
Diff: http://git-wip-us.apache.org/repos/asf/tika/diff/398e73de

Branch: refs/heads/2.x
Commit: 398e73dee3e6ece5a0af376abe954b75bce0cfda
Parents: a882a32
Author: Nick Burch <[email protected]>
Authored: Mon May 16 01:04:03 2016 +0100
Committer: Nick Burch <[email protected]>
Committed: Mon May 16 01:04:03 2016 +0100

----------------------------------------------------------------------
 .../test/java/org/apache/tika/mime/MimeDetectionTest.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tika/blob/398e73de/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java
----------------------------------------------------------------------
diff --git 
a/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java 
b/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java
index 31df3ec..482aae1 100644
--- a/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java
+++ b/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java
@@ -77,6 +77,9 @@ public class MimeDetectionTest extends TikaTest {
         testFile("image/cgm", "plotutils-bin-cgm-v3.cgm");
         // test HTML detection of malformed file, previously identified as 
image/cgm (TIKA-1170)
         testFile("text/html", "test-malformed-header.html.bin");
+        // file contains a # in the name (TIKA-1928)
+        testFile("application/xml", "test-utf8.xml", "test#.xml");
+        testFile("application/xml", "test-utf8.xml", "test#123.xml");
         
         //test GCMD Directory Interchange Format (.dif) TIKA-1561
         testFile("application/dif+xml", "brwNIMS_2014.dif");
@@ -142,7 +145,10 @@ public class MimeDetectionTest extends TikaTest {
     }
 
     private void testFile(String expected, String filename) throws IOException 
{
-        InputStream in = getTestDocumentAsStream(filename);
+        testFile(expected, filename, filename);
+    }
+    private void testFile(String expected, String resourcename, String 
filename) throws IOException {
+        InputStream in = getTestDocumentAsStream(resourcename);
         testStream(expected, filename, in);
     }
 

Reply via email to