Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade htmlunit to 2.36.0 #171

Merged
merged 4 commits into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ THE SOFTWARE.
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jenkins-test-harness-htmlunit</artifactId>
<version>2.31-2</version>
<version>2.31-3-SNAPSHOT</version>
timja marked this conversation as resolved.
Show resolved Hide resolved
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/com/gargoylesoftware/htmlunit/WebClientUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static void waitForJSExec(WebClient webClient) {
* Wait for all async JavaScript tasks associated with the supplied {@link WebClient} instance
* to complete.
* @param webClient The {@link WebClient} instance.
* @param timeout The timeout in milliseconds.
* @param timeout The timeout in milliseconds.
*/
public static void waitForJSExec(WebClient webClient, long timeout) {
webClient.getJavaScriptEngine().processPostponedActions();
Expand Down Expand Up @@ -136,5 +136,13 @@ public void malformedScriptURL(HtmlPage htmlPage, String url, MalformedURLExcept
@Override
public void loadScriptError(HtmlPage htmlPage, URL scriptUrl, Exception exception) {
}

/**
* {@inheritDoc}
*/
@Override
public void warn(String s, String s1, int i, String s2, int i1) {
timja marked this conversation as resolved.
Show resolved Hide resolved

timja marked this conversation as resolved.
Show resolved Hide resolved
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense to use the implementation in https://github.com/jenkinsci/jenkins-test-harness/pull/179/files so the change matches better with the current coding style: no (meaningless) comment, correct parameter names, no empty line.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

take whichever, they should be pretty much the same PR now

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.WebClientUtil;
import com.gargoylesoftware.htmlunit.html.xpath.XPathUtils;
import com.gargoylesoftware.htmlunit.html.xpath.XPathHelper;

import java.util.List;

/**
* {@link DomNode} helper methods.
*
*
* @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly@gmail.com</a>
*/
public class DomNodeUtil {
Expand All @@ -40,14 +40,14 @@ public class DomNodeUtil {
* <p>
* Calls {@link WebClientUtil#waitForJSExec(com.gargoylesoftware.htmlunit.WebClient)} before
* executing the query.
*
*
* @param domNode the node to start searching from
* @param xpathExpr the XPath expression
* @return the list of objects found.
*/
public static <E> List<E> selectNodes(final DomNode domNode, final String xpathExpr) {
WebClientUtil.waitForJSExec(domNode.getPage().getWebClient());
return (List) XPathUtils.getByXPath(domNode, xpathExpr, null);
return (List) XPathHelper.getByXPath(domNode, xpathExpr, null, true);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

/**
Expand Down