You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ni...@apache.org on 2017/04/27 14:46:13 UTC

[tika] 02/04: TIKA-2345 Test for Tika Config Serialisation of EncodingDetector

This is an automated email from the ASF dual-hosted git repository.

nick pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tika.git

commit 86e821b6d47b32e0d00dbaf95d84cff5aa5570b5
Author: Nick Burch <ni...@gagravarr.org>
AuthorDate: Thu Apr 27 15:37:16 2017 +0100

    TIKA-2345 Test for Tika Config Serialisation of EncodingDetector
---
 .../java/org/apache/tika/config/TikaConfigSerializerTest.java    | 9 +++++++++
 .../resources/org/apache/tika/config/TIKA-1762-executors.xml     | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/tika-core/src/test/java/org/apache/tika/config/TikaConfigSerializerTest.java b/tika-core/src/test/java/org/apache/tika/config/TikaConfigSerializerTest.java
index 01a30eb..c99402e 100644
--- a/tika-core/src/test/java/org/apache/tika/config/TikaConfigSerializerTest.java
+++ b/tika-core/src/test/java/org/apache/tika/config/TikaConfigSerializerTest.java
@@ -41,6 +41,15 @@ public class TikaConfigSerializerTest extends TikaConfigTest {
     }
 
     @Test
+    public void testEncodingDetectors() throws Exception {
+        String xml = loadAndSerialize("TIKA-1762-executors.xml",
+                TikaConfigSerializer.Mode.STATIC);
+        assertContains("<encodingDetectors> " +
+                "<encodingDetector class=\"org.apache.tika.detect.NonDetectingEncodingDetector\"/> " +
+                "</encodingDetectors>", xml);
+    }
+
+    @Test
     @Ignore("TODO: executor-service info needs to be stored in TikaConfig for serialization")
     public void testExecutors() throws Exception {
         String xml = loadAndSerialize("TIKA-1762-executors.xml",
diff --git a/tika-core/src/test/resources/org/apache/tika/config/TIKA-1762-executors.xml b/tika-core/src/test/resources/org/apache/tika/config/TIKA-1762-executors.xml
index 2db72d1..77f6928 100644
--- a/tika-core/src/test/resources/org/apache/tika/config/TIKA-1762-executors.xml
+++ b/tika-core/src/test/resources/org/apache/tika/config/TIKA-1762-executors.xml
@@ -21,6 +21,9 @@
   <parsers>
     <parser class="org.apache.tika.config.DummyParser"/>
   </parsers>
+  <encodingDetectors>
+    <encodingDetector class="org.apache.tika.detect.NonDetectingEncodingDetector"/>
+  </encodingDetectors>
   <executor-service class="org.apache.tika.config.DummyExecutor">
     <core-threads>3</core-threads>
     <max-threads>10</max-threads>

-- 
To stop receiving notification emails like this one, please contact
"commits@tika.apache.org" <co...@tika.apache.org>.