You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2024/08/02 14:52:16 UTC
(jackrabbit-oak) branch trunk updated: OAK-10821: webapp: bump htmlunit to 4.4.0 (also get rid of Guava) (#1626)
This is an automated email from the ASF dual-hosted git repository.
reschke pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/trunk by this push:
new 136e765903 OAK-10821: webapp: bump htmlunit to 4.4.0 (also get rid of Guava) (#1626)
136e765903 is described below
commit 136e7659031b32ec26076b6b381eee4329be90a9
Author: Julian Reschke <re...@apache.org>
AuthorDate: Fri Aug 2 16:52:11 2024 +0200
OAK-10821: webapp: bump htmlunit to 4.4.0 (also get rid of Guava) (#1626)
---
oak-examples/webapp/pom.xml | 4 ++--
.../java/org/apache/jackrabbit/j2ee/TomcatIT.java | 25 +++++++++++-----------
2 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/oak-examples/webapp/pom.xml b/oak-examples/webapp/pom.xml
index 8af0f35cf8..74bc58b30d 100644
--- a/oak-examples/webapp/pom.xml
+++ b/oak-examples/webapp/pom.xml
@@ -177,9 +177,9 @@
<version>1.4.01</version>
</dependency>
<dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
+ <groupId>org.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
- <version>2.43.0</version>
+ <version>4.4.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
diff --git a/oak-examples/webapp/src/test/java/org/apache/jackrabbit/j2ee/TomcatIT.java b/oak-examples/webapp/src/test/java/org/apache/jackrabbit/j2ee/TomcatIT.java
index 9f52c34ed9..7fecd3cfa1 100644
--- a/oak-examples/webapp/src/test/java/org/apache/jackrabbit/j2ee/TomcatIT.java
+++ b/oak-examples/webapp/src/test/java/org/apache/jackrabbit/j2ee/TomcatIT.java
@@ -21,23 +21,22 @@ import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
import java.util.List;
-import junit.framework.TestCase;
-
import org.apache.catalina.startup.Tomcat;
import org.apache.commons.io.FileUtils;
import org.apache.http.conn.HttpHostConnectException;
+import org.htmlunit.WebClient;
+import org.htmlunit.html.HtmlElement;
+import org.htmlunit.html.HtmlForm;
+import org.htmlunit.html.HtmlInput;
+import org.htmlunit.html.HtmlPage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.bridge.SLF4JBridgeHandler;
-import com.gargoylesoftware.htmlunit.WebClient;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlForm;
-import com.gargoylesoftware.htmlunit.html.HtmlInput;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import org.apache.jackrabbit.guava.common.io.Files;
+import junit.framework.TestCase;
public class TomcatIT extends TestCase {
@@ -46,7 +45,7 @@ public class TomcatIT extends TestCase {
}
private static Logger LOG = LoggerFactory.getLogger(TomcatIT.class);
-
+
private URL url;
private Tomcat tomcat;
@@ -90,7 +89,7 @@ public class TomcatIT extends TestCase {
public void testTomcat() throws Exception {
HtmlPage page = null;
-
+
try {
page = client.getPage(url);
} catch (HttpHostConnectException e) {
@@ -99,7 +98,7 @@ public class TomcatIT extends TestCase {
LOG.error("Failed connecting to tomcat", e);
return;
}
-
+
assertEquals("Content Repository Setup", page.getTitleText());
page = submitNewRepositoryForm(page);
@@ -129,8 +128,8 @@ public class TomcatIT extends TestCase {
private void rewriteWebXml(File war) throws IOException {
File webXml = new File(war, new File("WEB-INF","web.xml").getPath());
assertTrue(webXml.exists());
- List<String> lines = Files.readLines(webXml, StandardCharsets.UTF_8);
- BufferedWriter writer = Files.newWriter(webXml, StandardCharsets.UTF_8);
+ List<String> lines = Files.readAllLines(webXml.toPath(), StandardCharsets.UTF_8);
+ BufferedWriter writer = Files.newBufferedWriter(webXml.toPath(), StandardCharsets.UTF_8);
try {
for (String line : lines) {
line = line.replace("<param-value>oak/bootstrap.properties</param-value>",