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 2017/05/16 12:15:52 UTC

[tika] 01/02: TIKA-2363 skip image recognition test if network call fails

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

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

commit 464fb97ec486a63492b705f06e9c75781afeae35
Author: tballison <ta...@mitre.org>
AuthorDate: Tue May 16 08:13:56 2017 -0400

    TIKA-2363 skip image recognition test if network call fails
---
 .../org/apache/tika/dl/imagerec/DL4JInceptionV3NetTest.java   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tika-dl/src/test/java/org/apache/tika/dl/imagerec/DL4JInceptionV3NetTest.java b/tika-dl/src/test/java/org/apache/tika/dl/imagerec/DL4JInceptionV3NetTest.java
index 5bcd678..d250834 100644
--- a/tika-dl/src/test/java/org/apache/tika/dl/imagerec/DL4JInceptionV3NetTest.java
+++ b/tika-dl/src/test/java/org/apache/tika/dl/imagerec/DL4JInceptionV3NetTest.java
@@ -18,6 +18,7 @@ package org.apache.tika.dl.imagerec;
 
 import org.apache.tika.Tika;
 import org.apache.tika.config.TikaConfig;
+import org.apache.tika.exception.TikaConfigException;
 import org.apache.tika.metadata.Metadata;
 import org.junit.Test;
 
@@ -28,7 +29,15 @@ public class DL4JInceptionV3NetTest {
 
     @Test
     public void recognise() throws Exception {
-        TikaConfig config = new TikaConfig(getClass().getResourceAsStream("dl4j-inception3-config.xml"));
+        TikaConfig config;
+        try {
+             config = new TikaConfig(getClass().getResourceAsStream("dl4j-inception3-config.xml"));
+        } catch (TikaConfigException e) {
+            if (e.getMessage() != null && e.getMessage().contains("Connection refused") ) {
+                return;
+            }
+            throw e;
+        }
         Tika tika = new Tika(config);
         Metadata md = new Metadata();
         tika.parse(getClass().getResourceAsStream("cat.jpg"), md);

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