Author: mattmann
Date: Sun Jun 16 00:27:11 2013
New Revision: 1493435

URL: http://svn.apache.org/r1493435
Log:
Fix for TIKA-1129: Test HTML file has poorly chosen GPL text in it

Modified:
    tika/trunk/CHANGES.txt
    
tika/trunk/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java

Modified: tika/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/tika/trunk/CHANGES.txt?rev=1493435&r1=1493434&r2=1493435&view=diff
==============================================================================
--- tika/trunk/CHANGES.txt (original)
+++ tika/trunk/CHANGES.txt Sun Jun 16 00:27:11 2013
@@ -1,5 +1,7 @@
 Release 1.4 Current Development
 
+  * Removed a test HTML file with a poorly chosen GPL text in it (TIKA-1129).
+
   * Improvements to tika-server to allow it to produce text/html and
     text/xml content (TIKA-1126, TIKA-1127).
 

Modified: 
tika/trunk/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java
URL: 
http://svn.apache.org/viewvc/tika/trunk/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java?rev=1493435&r1=1493434&r2=1493435&view=diff
==============================================================================
--- 
tika/trunk/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java 
(original)
+++ 
tika/trunk/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java 
Sun Jun 16 00:27:11 2013
@@ -19,6 +19,7 @@ package org.apache.tika.mime;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.URL;
 
 import junit.framework.TestCase;
 
@@ -60,7 +61,7 @@ public class MimeDetectionTest extends T
                 "http://www.w3.org/2002/07/owl#";,
                 "test-difficult-rdf2.xml");
         // add evil test from TIKA-327
-        testFile("text/html", "evilhtml.html");
+        testUrlOnly("text/html", "http://www.nheri.org";);
         // add another evil html test from TIKA-357
         testFile("text/html", "testlargerbuffer.html");
         // test fragment of HTML with <div> (TIKA-1102)
@@ -113,6 +114,11 @@ public class MimeDetectionTest extends T
                 MediaType.APPLICATION_ZIP));
     }
 
+    private void testUrlOnly(String expected, String url) throws IOException{
+       InputStream in = new URL(url).openStream();
+        testStream(expected, url, in);
+    }
+
     private void testUrl(String expected, String url, String file) throws 
IOException{
         InputStream in = getClass().getResourceAsStream(file);
         testStream(expected, url, in);


Reply via email to