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 2018/06/14 20:43:23 UTC
[tika] branch master updated: TIKA-2660 -- enable building with
Java 10
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
The following commit(s) were added to refs/heads/master by this push:
new b10c24d TIKA-2660 -- enable building with Java 10
b10c24d is described below
commit b10c24dc8283401c9ef93b3a8535880ebfb30e6f
Author: tballison <ta...@mitre.org>
AuthorDate: Thu Jun 14 16:41:06 2018 -0400
TIKA-2660 -- enable building with Java 10
---
tika-bundle/pom.xml | 11 +-
.../test/java/org/apache/tika/bundle/BundleIT.java | 5 +-
tika-core/pom.xml | 1 +
.../apache/tika/detect/TrainedModelDetector.java | 3 +-
tika-dl/pom.xml | 236 ++++++++++++++++++++-
tika-langdetect/pom.xml | 23 ++
tika-parent/pom.xml | 1 +
tika-parsers/pom.xml | 24 ++-
.../java/org/apache/tika/parser/mat/MatParser.java | 1 +
.../org/apache/tika/parser/rtf/TextExtractor.java | 19 +-
.../org/apache/tika/parser/mat/MatParserTest.java | 7 +-
.../apache/tika/parser/mbox/MboxParserTest.java | 16 +-
.../tika/parser/microsoft/JackcessParserTest.java | 3 +-
.../tika/parser/microsoft/OutlookParserTest.java | 4 +-
tika-server/pom.xml | 12 ++
15 files changed, 326 insertions(+), 40 deletions(-)
diff --git a/tika-bundle/pom.xml b/tika-bundle/pom.xml
index fa13e21..4be5c2c 100644
--- a/tika-bundle/pom.xml
+++ b/tika-bundle/pom.xml
@@ -99,7 +99,7 @@
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
- <version>5.6.4</version>
+ <version>5.6.10</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -111,7 +111,7 @@
<dependency>
<groupId>org.ops4j.pax.url</groupId>
<artifactId>pax-url-aether</artifactId>
- <version>2.5.2</version>
+ <version>2.5.4</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -249,11 +249,18 @@
javax.annotation;resolution:=optional,
javax.mail;resolution:=optional,
javax.mail.internet;resolution:=optional,
+ javax.net.ssl;resolution:=optional,
javax.servlet.annotation;resolution:=optional,
javax.servlet;resolution:=optional,
javax.servlet.http;resolution:=optional,
javax.measure.converter;resolution:=optional,
javax.ws.rs.core;resolution:=optional,
+ javax.xml.bind;resolution:=optional,
+ javax.xml.bind.annotation;resolution:=optional,
+ javax.xml.bind.annotation.adapters;resolution:=optional,
+ javax.xml.bind.attachment;resolution:=optional,
+ javax.xml.bind.helpers;resolution:=optional,
+ javax.xml.bind.util;resolution:=optional,
net.sf.ehcache;resolution:=optional,
nu.xom;resolution:=optional,
opendap.dap.http;resolution:=optional,
diff --git a/tika-bundle/src/test/java/org/apache/tika/bundle/BundleIT.java b/tika-bundle/src/test/java/org/apache/tika/bundle/BundleIT.java
index f568311..75deb34 100644
--- a/tika-bundle/src/test/java/org/apache/tika/bundle/BundleIT.java
+++ b/tika-bundle/src/test/java/org/apache/tika/bundle/BundleIT.java
@@ -33,6 +33,7 @@ import java.io.InputStream;
import java.io.StringWriter;
import java.io.Writer;
import java.net.URISyntaxException;
+import java.nio.file.Paths;
import java.util.HashSet;
import java.util.Set;
import java.util.jar.Attributes;
@@ -45,6 +46,7 @@ import org.apache.tika.Tika;
import org.apache.tika.detect.DefaultDetector;
import org.apache.tika.detect.Detector;
import org.apache.tika.fork.ForkParser;
+import org.apache.tika.io.TikaInputStream;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.metadata.TikaCoreProperties;
import org.apache.tika.mime.MediaType;
@@ -257,8 +259,7 @@ public class BundleIT {
ParseContext context = new ParseContext();
context.set(Parser.class, parser);
- try (InputStream stream =
- new FileInputStream("src/test/resources/test-documents.zip")) {
+ try (InputStream stream = TikaInputStream.get(Paths.get("src/test/resources/test-documents.zip"))) {
parser.parse(stream, handler, new Metadata(), context);
}
diff --git a/tika-core/pom.xml b/tika-core/pom.xml
index 70219d1..39b16e4 100644
--- a/tika-core/pom.xml
+++ b/tika-core/pom.xml
@@ -105,6 +105,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>clirr-maven-plugin</artifactId>
+ <version>2.8</version>
<executions>
<execution>
<phase>verify</phase>
diff --git a/tika-core/src/main/java/org/apache/tika/detect/TrainedModelDetector.java b/tika-core/src/main/java/org/apache/tika/detect/TrainedModelDetector.java
index dc8f142..ee19804 100644
--- a/tika-core/src/main/java/org/apache/tika/detect/TrainedModelDetector.java
+++ b/tika-core/src/main/java/org/apache/tika/detect/TrainedModelDetector.java
@@ -21,6 +21,7 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.Writer;
+import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
@@ -105,7 +106,7 @@ public abstract class TrainedModelDetector implements Detector {
float max = -1;
while (bytesRead != -1) {
- buf.flip(); // make buffer ready for read
+ ((Buffer)buf).flip(); // make buffer ready for read
while (buf.hasRemaining()) {
byte byt = buf.get();
diff --git a/tika-dl/pom.xml b/tika-dl/pom.xml
index 46d9a70..eea0685 100644
--- a/tika-dl/pom.xml
+++ b/tika-dl/pom.xml
@@ -36,8 +36,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <dl4j.version>0.8.0</dl4j.version>
- <dl4j.model.version>0.8.0-2</dl4j.model.version>
+ <dl4j.version>1.0.0-beta</dl4j.version>
+ <dl4j.model.version>0.9.1</dl4j.model.version>
</properties>
<dependencies>
@@ -51,9 +51,18 @@
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>2.9.9</version>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
@@ -62,7 +71,7 @@
<groupId>org.deeplearning4j</groupId>
<artifactId>deeplearning4j-keras</artifactId>
<version>${dl4j.model.version}</version>
- <!-- exclude this because of non-ASF friendly "do no evil" license.
+ <!-- exclude the first because of non-ASF friendly "do no evil" license.
Because this relies on tika-parsers, that should have ted-dunning's drop-in
-->
<exclusions>
@@ -75,10 +84,34 @@
<artifactId>guava</artifactId>
</exclusion>
<exclusion>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j-common</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>jackson</artifactId>
+ </exclusion>
+ <exclusion>
<groupId>org.deeplearning4j</groupId>
<artifactId>deeplearning4j-modelimport</artifactId>
</exclusion>
<exclusion>
+ <groupId>org.deeplearning4j</groupId>
+ <artifactId>deeplearning4j-core</artifactId>
+ </exclusion>
+ <exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</exclusion>
@@ -107,6 +140,19 @@
<artifactId>deeplearning4j-keras</artifactId>
</exclusion>
<exclusion>
+ <groupId>org.deeplearning4j</groupId>
+ <artifactId>deeplearning4j-nn</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>jackson</artifactId>
+ </exclusion>
+
+ <exclusion>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
</exclusion>
@@ -114,14 +160,71 @@
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.bytedeco.javacpp-presets</groupId>
+ <artifactId>hdf5-platform</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.deeplearning4j</groupId>
+ <artifactId>deeplearning4j-nn</artifactId>
+ <version>${dl4j.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j-common</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>jackson</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <version>1.16.20</version>
+ </dependency>
+ <dependency>
<groupId>org.datavec</groupId>
<artifactId>datavec-data-image</artifactId>
<version>${dl4j.version}</version>
<exclusions>
<exclusion>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ </exclusion>
+ <exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
@@ -130,6 +233,27 @@
<artifactId>javacpp</artifactId>
</exclusion>
<exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j-common</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>jackson</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>org.bytedeco</groupId>
+ <artifactId>javacv</artifactId>
+ </exclusion>
+ <exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
</exclusion>
@@ -141,6 +265,96 @@
<groupId>com.github.jai-imageio</groupId>
<artifactId>jai-imageio-core</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.bytedeco.javacpp-presets</groupId>
+ <artifactId>opencv-platform</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.bytedeco</groupId>
+ <artifactId>javacv</artifactId>
+ <version>1.4.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.bytedeco.javacpp-presets</groupId>
+ <artifactId>opencv</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.bytedeco</groupId>
+ <artifactId>javacpp</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.bytedeco.javacpp-presets</groupId>
+ <artifactId>opencv-platform</artifactId>
+ <version>3.4.1-1.4.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.bytedeco.javacpp-presets</groupId>
+ <artifactId>opencv</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.bytedeco.javacpp-presets</groupId>
+ <artifactId>opencv</artifactId>
+ <version>3.4.1-1.4.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.bytedeco</groupId>
+ <artifactId>javacpp</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j-common</artifactId>
+ <version>1.0.0-beta</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>jackson</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j-jackson</artifactId>
+ <version>1.0.0-beta</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j-api</artifactId>
+ <version>1.0.0-beta</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.objenesis</groupId>
+ <artifactId>objenesis</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -152,17 +366,21 @@
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j-native</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
- <groupId>org.bytedeco</groupId>
- <artifactId>javacpp</artifactId>
- <version>1.3.2</version>
+ <groupId>org.nd4j</groupId>
+ <artifactId>nd4j-native</artifactId>
+ <version>${dl4j.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-compress</artifactId>
- <version>${commons.compress.version}</version>
+ <groupId>org.bytedeco</groupId>
+ <artifactId>javacpp</artifactId>
+ <version>1.4.1</version>
</dependency>
</dependencies>
diff --git a/tika-langdetect/pom.xml b/tika-langdetect/pom.xml
index cfa2dc5..39600b3 100644
--- a/tika-langdetect/pom.xml
+++ b/tika-langdetect/pom.xml
@@ -40,6 +40,29 @@
<artifactId>tika-core</artifactId>
<version>${project.version}</version>
</dependency>
+
+ <!-- for java 10 -->
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>${jaxb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-core</artifactId>
+ <version>${jaxb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>${jaxb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+
<dependency>
<groupId>com.optimaize.languagedetector</groupId>
<artifactId>language-detector</artifactId>
diff --git a/tika-parent/pom.xml b/tika-parent/pom.xml
index ad89742..d5cd4ed 100644
--- a/tika-parent/pom.xml
+++ b/tika-parent/pom.xml
@@ -312,6 +312,7 @@
<cxf.version>3.0.16</cxf.version>
<slf4j.version>1.7.24</slf4j.version>
<jackson.version>2.9.5</jackson.version>
+ <jaxb.version>2.3.0</jaxb.version>
</properties>
<build>
diff --git a/tika-parsers/pom.xml b/tika-parsers/pom.xml
index 6031b1a..2706ba8 100644
--- a/tika-parsers/pom.xml
+++ b/tika-parsers/pom.xml
@@ -79,6 +79,28 @@
<scope>test</scope>
</dependency>
+ <!-- for java 10 -->
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>${jaxb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-core</artifactId>
+ <version>${jaxb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>${jaxb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+
<!-- Externally Maintained Parsers -->
<dependency>
<groupId>org.gagravarr</groupId>
@@ -131,7 +153,7 @@
<dependency>
<groupId>org.tallison</groupId>
<artifactId>jmatio</artifactId>
- <version>1.2</version>
+ <version>1.3</version>
</dependency>
<dependency>
<groupId>org.apache.james</groupId>
diff --git a/tika-parsers/src/main/java/org/apache/tika/parser/mat/MatParser.java b/tika-parsers/src/main/java/org/apache/tika/parser/mat/MatParser.java
index 3fbefb0..2db8bef 100644
--- a/tika-parsers/src/main/java/org/apache/tika/parser/mat/MatParser.java
+++ b/tika-parsers/src/main/java/org/apache/tika/parser/mat/MatParser.java
@@ -74,6 +74,7 @@ public class MatParser extends AbstractParser {
//Extract information from header file
MatFileReader mfr = new MatFileReader(tis.getFile()); //input .mat file
+
MatFileHeader hdr = mfr.getMatFileHeader(); //.mat header information
// Example header: "MATLAB 5.0 MAT-file, Platform: MACI64, Created on: Sun Mar 2 23:41:57 2014"
diff --git a/tika-parsers/src/main/java/org/apache/tika/parser/rtf/TextExtractor.java b/tika-parsers/src/main/java/org/apache/tika/parser/rtf/TextExtractor.java
index c2e8294..1f81fae 100644
--- a/tika-parsers/src/main/java/org/apache/tika/parser/rtf/TextExtractor.java
+++ b/tika-parsers/src/main/java/org/apache/tika/parser/rtf/TextExtractor.java
@@ -20,6 +20,7 @@ package org.apache.tika.parser.rtf;
import java.io.IOException;
import java.io.InputStream;
import java.io.PushbackInputStream;
+import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
@@ -238,7 +239,7 @@ final class TextExtractor {
// Used when we decode bytes -> chars using CharsetDecoder:
private final char[] outputArray = new char[128];
- private final CharBuffer outputBuffer = CharBuffer.wrap(outputArray);
+ private final Buffer outputCharBuffer = CharBuffer.wrap(outputArray);
// Holds the font table from this RTF doc, mapping
// the font number (from \fN control word) to the
// corresponding charset:
@@ -262,7 +263,7 @@ final class TextExtractor {
// for text output:
private byte[] pendingBytes = new byte[16];
private int pendingByteCount;
- private ByteBuffer pendingByteBuffer = ByteBuffer.wrap(pendingBytes);
+ private Buffer pendingByteBuffer = ByteBuffer.wrap(pendingBytes);
// Holds pending chars for text output
private char[] pendingChars = new char[10];
private int pendingCharCount;
@@ -663,16 +664,16 @@ final class TextExtractor {
final CharsetDecoder decoder = getDecoder();
pendingByteBuffer.limit(pendingByteCount);
assert pendingByteBuffer.position() == 0;
- assert outputBuffer.position() == 0;
+ assert outputCharBuffer.position() == 0;
while (true) {
// We pass true for endOfInput because, when
// we are called, we should have seen a
// complete sequence of characters for this
// charset:
- final CoderResult result = decoder.decode(pendingByteBuffer, outputBuffer, true);
+ final CoderResult result = decoder.decode((ByteBuffer)pendingByteBuffer, (CharBuffer) outputCharBuffer, true);
- final int pos = outputBuffer.position();
+ final int pos = outputCharBuffer.position();
if (pos > 0) {
if (inHeader || fieldState == 1) {
pendingBuffer.append(outputArray, 0, pos);
@@ -680,7 +681,7 @@ final class TextExtractor {
lazyStartParagraph();
out.characters(outputArray, 0, pos);
}
- outputBuffer.position(0);
+ outputCharBuffer.position(0);
}
if (result == CoderResult.UNDERFLOW) {
@@ -689,9 +690,9 @@ final class TextExtractor {
}
while (true) {
- final CoderResult result = decoder.flush(outputBuffer);
+ final CoderResult result = decoder.flush((CharBuffer) outputCharBuffer);
- final int pos = outputBuffer.position();
+ final int pos = outputCharBuffer.position();
if (pos > 0) {
if (inHeader || fieldState == 1) {
pendingBuffer.append(outputArray, 0, pos);
@@ -699,7 +700,7 @@ final class TextExtractor {
lazyStartParagraph();
out.characters(outputArray, 0, pos);
}
- outputBuffer.position(0);
+ outputCharBuffer.position(0);
}
if (result == CoderResult.UNDERFLOW) {
diff --git a/tika-parsers/src/test/java/org/apache/tika/parser/mat/MatParserTest.java b/tika-parsers/src/test/java/org/apache/tika/parser/mat/MatParserTest.java
index 0b31fea..b87b2b6 100644
--- a/tika-parsers/src/test/java/org/apache/tika/parser/mat/MatParserTest.java
+++ b/tika-parsers/src/test/java/org/apache/tika/parser/mat/MatParserTest.java
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertEquals;
import java.io.InputStream;
+import org.apache.tika.TikaTest;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.parser.AutoDetectParser;
import org.apache.tika.parser.ParseContext;
@@ -31,7 +32,7 @@ import org.junit.Test;
/**
* Test cases to exercise the {@link MatParser}.
*/
-public class MatParserTest {
+public class MatParserTest extends TikaTest {
@Test
public void testParser() throws Exception {
AutoDetectParser parser = new AutoDetectParser();
@@ -39,7 +40,7 @@ public class MatParserTest {
Metadata metadata = new Metadata();
String path = "/test-documents/breidamerkurjokull_radar_profiles_2009.mat";
- try (InputStream stream = MatParser.class.getResourceAsStream(path)) {
+ try (InputStream stream = getResourceAsStream(path)) {
parser.parse(stream, handler, metadata, new ParseContext());
}
@@ -69,7 +70,7 @@ public class MatParserTest {
Metadata metadata = new Metadata();
String path = "/test-documents/test_mat_text.mat";
- try (InputStream stream = MatParser.class.getResourceAsStream(path)) {
+ try (InputStream stream = getResourceAsStream(path)) {
parser.parse(stream, handler, metadata, new ParseContext());
}
diff --git a/tika-parsers/src/test/java/org/apache/tika/parser/mbox/MboxParserTest.java b/tika-parsers/src/test/java/org/apache/tika/parser/mbox/MboxParserTest.java
index f75bd59..168c64c 100644
--- a/tika-parsers/src/test/java/org/apache/tika/parser/mbox/MboxParserTest.java
+++ b/tika-parsers/src/test/java/org/apache/tika/parser/mbox/MboxParserTest.java
@@ -43,10 +43,6 @@ public class MboxParserTest extends TikaTest {
private TypeDetector typeDetector;
private MboxParser mboxParser;
- private static InputStream getStream(String name) {
- return MboxParserTest.class.getClass().getResourceAsStream(name);
- }
-
@Before
public void setUp() throws Exception {
typeDetector = new TypeDetector();
@@ -63,7 +59,7 @@ public class MboxParserTest extends TikaTest {
ContentHandler handler = new BodyContentHandler();
Metadata metadata = new Metadata();
- try (InputStream stream = getStream("/test-documents/simple.mbox")) {
+ try (InputStream stream = getResourceAsStream("/test-documents/simple.mbox")) {
mboxParser.parse(stream, handler, metadata, recursingContext);
}
@@ -89,7 +85,7 @@ public class MboxParserTest extends TikaTest {
ContentHandler handler = new BodyContentHandler();
Metadata metadata = new Metadata();
- try (InputStream stream = getStream("/test-documents/headers.mbox")) {
+ try (InputStream stream = getResourceAsStream("/test-documents/headers.mbox")) {
mboxParser.parse(stream, handler, metadata, recursingContext);
}
@@ -111,7 +107,7 @@ public class MboxParserTest extends TikaTest {
ContentHandler handler = new BodyContentHandler();
Metadata metadata = new Metadata();
- try (InputStream stream = getStream("/test-documents/multiline.mbox")) {
+ try (InputStream stream = getResourceAsStream("/test-documents/multiline.mbox")) {
mboxParser.parse(stream, handler, metadata, recursingContext);
}
@@ -126,7 +122,7 @@ public class MboxParserTest extends TikaTest {
ContentHandler handler = new BodyContentHandler();
Metadata metadata = new Metadata();
- try (InputStream stream = getStream("/test-documents/quoted.mbox")) {
+ try (InputStream stream = getResourceAsStream("/test-documents/quoted.mbox")) {
mboxParser.parse(stream, handler, metadata, recursingContext);
}
@@ -139,7 +135,7 @@ public class MboxParserTest extends TikaTest {
ContentHandler handler = new BodyContentHandler();
Metadata metadata = new Metadata();
- try (InputStream stream = getStream("/test-documents/complex.mbox")) {
+ try (InputStream stream = getResourceAsStream("/test-documents/complex.mbox")) {
mboxParser.parse(stream, handler, metadata, recursingContext);
}
@@ -161,7 +157,7 @@ public class MboxParserTest extends TikaTest {
ParseContext context = new ParseContext();
context.set(Parser.class, new AutoDetectParser());
- try (InputStream stream = getStream("/test-documents/single_mail.mbox")) {
+ try (InputStream stream = getResourceAsStream("/test-documents/single_mail.mbox")) {
mboxParser.parse(stream, handler, metadata, context);
}
diff --git a/tika-parsers/src/test/java/org/apache/tika/parser/microsoft/JackcessParserTest.java b/tika-parsers/src/test/java/org/apache/tika/parser/microsoft/JackcessParserTest.java
index e6aef53..f39b961 100644
--- a/tika-parsers/src/test/java/org/apache/tika/parser/microsoft/JackcessParserTest.java
+++ b/tika-parsers/src/test/java/org/apache/tika/parser/microsoft/JackcessParserTest.java
@@ -75,7 +75,8 @@ public class JackcessParserTest extends TikaTest {
assertContains("<th>ShortTextField</th>", mainContent);
//test date format
- assertContains("6/24/15", mainContent);
+ //java 8 is 6/24/15 ...java 10 is 2015-06-24
+ assertTrue (mainContent.contains("6/24/15") || mainContent.contains("2015-06-24"));
//test that markup is stripped
assertContains("over the bold italic dog", mainContent);
diff --git a/tika-parsers/src/test/java/org/apache/tika/parser/microsoft/OutlookParserTest.java b/tika-parsers/src/test/java/org/apache/tika/parser/microsoft/OutlookParserTest.java
index 6e2e4b2..12aeeed 100644
--- a/tika-parsers/src/test/java/org/apache/tika/parser/microsoft/OutlookParserTest.java
+++ b/tika-parsers/src/test/java/org/apache/tika/parser/microsoft/OutlookParserTest.java
@@ -268,10 +268,10 @@ public class OutlookParserTest extends TikaTest {
// As the HTML version should have been processed, ensure
// we got some of the links
- String content = sw.toString().replaceAll("<p>\\s+", "<p>");
+ String content = sw.toString().replaceAll("[\\r\\n\\t]+", " ").replaceAll(" +", " ");
assertContains("<dd>New Outlook User</dd>", content);
assertContains("designed <i>to help you", content);
- assertContains("<p><a href=\"http://r.office.microsoft.com/r/rlidOutlookWelcomeMail10?clid=1033\">Cached Exchange Mode</a>", content);
+ assertContains("<p> <a href=\"http://r.office.microsoft.com/r/rlidOutlookWelcomeMail10?clid=1033\">Cached Exchange Mode</a>", content);
// Link - check text around it, and the link itself
assertContains("sign up for a free subscription", content);
diff --git a/tika-server/pom.xml b/tika-server/pom.xml
index 4abb226..9c336c0 100644
--- a/tika-server/pom.xml
+++ b/tika-server/pom.xml
@@ -54,6 +54,12 @@
<groupId>${project.groupId}</groupId>
<artifactId>tika-langdetect</artifactId>
<version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
@@ -95,6 +101,12 @@
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.4</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
--
To stop receiving notification emails like this one, please contact
tallison@apache.org.