You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2020/07/20 20:57:36 UTC
[tika] branch main updated: Improve unit test to ensure that the
CompressorParser is not called
This is an automated email from the ASF dual-hosted git repository.
tallison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/main by this push:
new 839d318 Improve unit test to ensure that the CompressorParser is not called
839d318 is described below
commit 839d3187b93822dc7b7a8c269f00ac7ebfacddbd
Author: tallison <ta...@apache.org>
AuthorDate: Mon Jul 20 16:51:44 2020 -0400
Improve unit test to ensure that the CompressorParser is not called
---
.../org/apache/tika/server/RecursiveMetadataResourceTest.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tika-server/src/test/java/org/apache/tika/server/RecursiveMetadataResourceTest.java b/tika-server/src/test/java/org/apache/tika/server/RecursiveMetadataResourceTest.java
index 5cf3169..38dcb05 100644
--- a/tika-server/src/test/java/org/apache/tika/server/RecursiveMetadataResourceTest.java
+++ b/tika-server/src/test/java/org/apache/tika/server/RecursiveMetadataResourceTest.java
@@ -101,6 +101,14 @@ public class RecursiveMetadataResourceTest extends CXFTestBase {
Reader reader = new InputStreamReader((InputStream) response.getEntity(), UTF_8);
List<Metadata> metadataList = JsonMetadataList.fromJson(reader);
+ String[] parsedBy = metadataList.get(0).getValues("X-Parsed-By");
+ //make sure the CompressorParser doesn't show up here
+ assertEquals(3, parsedBy.length);
+ assertEquals("org.apache.tika.parser.CompositeParser", parsedBy[0]);
+ assertEquals("org.apache.tika.parser.DefaultParser", parsedBy[1]);
+ assertEquals("org.apache.tika.parser.microsoft.ooxml.OOXMLParser", parsedBy[2]);
+
+ //test that the rest is as it should be
assertEquals(12, metadataList.size());
assertEquals("Microsoft Office Word", metadataList.get(0).get(OfficeOpenXMLExtended.APPLICATION));
assertContains("plundered our seas", metadataList.get(6).get("X-TIKA:content"));