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 2021/06/03 20:45:02 UTC

[tika] branch branch_1x updated: fix for change in mp4parser behavior

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

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


The following commit(s) were added to refs/heads/branch_1x by this push:
     new 10c94ff  fix for change in mp4parser behavior
10c94ff is described below

commit 10c94ffa52cb4955ca178566c26857489b1c953a
Author: tballison <ta...@apache.org>
AuthorDate: Thu Jun 3 16:44:43 2021 -0400

    fix for change in mp4parser behavior
---
 .../test/java/org/apache/tika/parser/mp4/MP4ParserTest.java | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/tika-parsers/src/test/java/org/apache/tika/parser/mp4/MP4ParserTest.java b/tika-parsers/src/test/java/org/apache/tika/parser/mp4/MP4ParserTest.java
index 12eb1a9..52b192b 100644
--- a/tika-parsers/src/test/java/org/apache/tika/parser/mp4/MP4ParserTest.java
+++ b/tika-parsers/src/test/java/org/apache/tika/parser/mp4/MP4ParserTest.java
@@ -18,10 +18,12 @@ package org.apache.tika.parser.mp4;
 
 import static org.junit.Assert.assertEquals;
 
+import java.io.EOFException;
 import java.io.InputStream;
 import java.nio.file.Paths;
 
 import org.apache.tika.TikaTest;
+import org.apache.tika.exception.TikaException;
 import org.apache.tika.io.TikaInputStream;
 import org.apache.tika.metadata.Metadata;
 import org.apache.tika.metadata.TikaCoreProperties;
@@ -104,8 +106,13 @@ public class MP4ParserTest extends TikaTest {
     public void testInfiniteLoop() throws Exception {
         //test that a truncated mp4 doesn't cause an infinite loop
         //TIKA-1931 and TIKA-1924
-        XMLResult r = getXML("testMP4_truncated.m4a");
-        assertEquals("audio/mp4", r.metadata.get(Metadata.CONTENT_TYPE));
-        assertEquals("M4A", r.metadata.get(XMPDM.AUDIO_COMPRESSOR));
+        try {
+            XMLResult r = getXML("testMP4_truncated.m4a");
+            assertEquals("audio/mp4", r.metadata.get(Metadata.CONTENT_TYPE));
+            assertEquals("M4A", r.metadata.get(XMPDM.AUDIO_COMPRESSOR));
+        } catch (TikaException e) {
+            //happens with Java 8
+            //should be eof
+        }
     }
 }