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 2022/04/25 16:59:09 UTC
[tika] branch main updated: TIKA-3719 -- fix tests on Windows
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 00c2614b1 TIKA-3719 -- fix tests on Windows
00c2614b1 is described below
commit 00c2614b1a1a4b236d3d697b42e82e3dcc1a9fd5
Author: tallison <ta...@apache.org>
AuthorDate: Mon Apr 25 12:58:53 2022 -0400
TIKA-3719 -- fix tests on Windows
---
.../org/apache/tika/server/core/TikaServerIntegrationTest.java | 10 +++++++---
.../configs/tika-config-server-tls-one-way-template.xml | 2 +-
.../configs/tika-config-server-tls-two-way-template.xml | 4 ++--
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/tika-server/tika-server-core/src/test/java/org/apache/tika/server/core/TikaServerIntegrationTest.java b/tika-server/tika-server-core/src/test/java/org/apache/tika/server/core/TikaServerIntegrationTest.java
index 603c5a668..7ba6756c2 100644
--- a/tika-server/tika-server-core/src/test/java/org/apache/tika/server/core/TikaServerIntegrationTest.java
+++ b/tika-server/tika-server-core/src/test/java/org/apache/tika/server/core/TikaServerIntegrationTest.java
@@ -74,7 +74,7 @@ public class TikaServerIntegrationTest extends IntegrationTestBase {
String xml = IOUtils.resourceToString(
"/configs/tika-config-server-tls-two-way-template.xml",
UTF_8);
- xml = xml.replaceAll("\\$\\{SSL_KEYS\\}", TLS_KEYS.toAbsolutePath().toString());
+ xml = xml.replace("{SSL_KEYS}", TLS_KEYS.toAbsolutePath().toString());
TIKA_TLS_TWO_WAY_CONFIG = Files.createTempFile("tika-config-tls-", ".xml");
Files.write(TIKA_TLS_TWO_WAY_CONFIG, xml.getBytes(UTF_8));
@@ -82,7 +82,7 @@ public class TikaServerIntegrationTest extends IntegrationTestBase {
xml = IOUtils.resourceToString(
"/configs/tika-config-server-tls-one-way-template.xml",
UTF_8);
- xml = xml.replaceAll("\\$\\{SSL_KEYS\\}", TLS_KEYS.toAbsolutePath().toString());
+ xml = xml.replace("{SSL_KEYS}", TLS_KEYS.toAbsolutePath().toString());
TIKA_TLS_ONE_WAY_CONFIG = Files.createTempFile("tika-config-tls-", ".xml");
Files.write(TIKA_TLS_ONE_WAY_CONFIG, xml.getBytes(UTF_8));
@@ -410,7 +410,11 @@ public class TikaServerIntegrationTest extends IntegrationTestBase {
ClassLoader.getSystemResourceAsStream(TEST_HELLO_WORLD));
fail("bad, bad, bad. this should have failed!");
} catch (Exception e) {
- assertContains("readHandshakeRecord", e.getMessage());
+ assertTrue(
+ //linux
+ e.getMessage().contains("readHandshakeRecord") ||
+ //windows
+ e.getMessage().contains("Error writing to server"));
}
}
diff --git a/tika-server/tika-server-core/src/test/resources/configs/tika-config-server-tls-one-way-template.xml b/tika-server/tika-server-core/src/test/resources/configs/tika-config-server-tls-one-way-template.xml
index f90acc859..04090f7fd 100644
--- a/tika-server/tika-server-core/src/test/resources/configs/tika-config-server-tls-one-way-template.xml
+++ b/tika-server/tika-server-core/src/test/resources/configs/tika-config-server-tls-one-way-template.xml
@@ -34,7 +34,7 @@
<active>true</active>
<keyStoreType>PKCS12</keyStoreType>
<keyStorePassword>tika-secret</keyStorePassword>
- <keyStoreFile>${SSL_KEYS}/tika-server-keystore.p12</keyStoreFile>
+ <keyStoreFile>{SSL_KEYS}/tika-server-keystore.p12</keyStoreFile>
<clientAuthenticationWanted>false</clientAuthenticationWanted>
<clientAuthenticationRequired>false</clientAuthenticationRequired>
</params>
diff --git a/tika-server/tika-server-core/src/test/resources/configs/tika-config-server-tls-two-way-template.xml b/tika-server/tika-server-core/src/test/resources/configs/tika-config-server-tls-two-way-template.xml
index 7a8b5dc94..a99579a61 100644
--- a/tika-server/tika-server-core/src/test/resources/configs/tika-config-server-tls-two-way-template.xml
+++ b/tika-server/tika-server-core/src/test/resources/configs/tika-config-server-tls-two-way-template.xml
@@ -34,10 +34,10 @@
<active>true</active>
<keyStoreType>PKCS12</keyStoreType>
<keyStorePassword>tika-secret</keyStorePassword>
- <keyStoreFile>${SSL_KEYS}/tika-server-keystore.p12</keyStoreFile>
+ <keyStoreFile>{SSL_KEYS}/tika-server-keystore.p12</keyStoreFile>
<trustStoreType>PKCS12</trustStoreType>
<trustStorePassword>tika-secret</trustStorePassword>
- <trustStoreFile>${SSL_KEYS}/tika-server-truststore.p12</trustStoreFile>
+ <trustStoreFile>{SSL_KEYS}/tika-server-truststore.p12</trustStoreFile>
<clientAuthenticationWanted>true</clientAuthenticationWanted>
<clientAuthenticationRequired>true</clientAuthenticationRequired>
</params>