Skip to content

Commit

Permalink
Merge pull request #489 from timja-bot/htmlunit-2.x-to-3.x
Browse files Browse the repository at this point in the history
Upgrade HtmlUnit from 2.x to 3.x
  • Loading branch information
rsandell authored Jun 5, 2023
2 parents d9fee24 + 9a3f362 commit 475e265
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.63</version>
<version>4.66</version>
<relativePath />
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@

import static com.sonymobile.tools.gerrit.gerritevents.mock.SshdServerMock.GERRIT_STREAM_EVENTS;

import com.gargoylesoftware.htmlunit.html.HtmlElement;
import org.htmlunit.html.HtmlElement;
import org.apache.sshd.server.SshServer;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;

import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlRadioButtonInput;
import org.htmlunit.FailingHttpStatusCodeException;
import org.htmlunit.html.HtmlForm;
import org.htmlunit.html.HtmlPage;
import org.htmlunit.html.HtmlRadioButtonInput;
import com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritCause;
import com.sonyericsson.hudson.plugins.gerrit.trigger.mock.DuplicatesUtil;
import com.sonyericsson.hudson.plugins.gerrit.trigger.mock.Setup;
Expand Down Expand Up @@ -299,12 +299,12 @@ private void addNewServerWithDefaultConfigs(String serverName) throws Exception
HtmlPage page = j.createWebClient().getPage(url);
HtmlForm form = page.getFormByName(newServerFormName);

form.getInputByName(inputFormName).setValueAttribute(serverName);
form.getInputByName(inputFormName).setValue(serverName);

List<HtmlRadioButtonInput> radioButtons = form.getRadioButtonsByName(radioButtonName);
HtmlRadioButtonInput radioButtonDefaultConfig = null;
for (HtmlRadioButtonInput button : radioButtons) {
if (radioButtonDefaultConfigValue.equals(button.getValueAttribute())) {
if (radioButtonDefaultConfigValue.equals(button.getValue())) {
radioButtonDefaultConfig = button;
radioButtonDefaultConfig.setChecked(true);
}
Expand All @@ -326,19 +326,19 @@ private void addNewServerByCopyingConfig(String newServerName, String fromServer
HtmlPage page = j.createWebClient().getPage(url);
HtmlForm form = page.getFormByName(newServerFormName);

form.getInputByName(inputFormName).setValueAttribute(newServerName);
form.getInputByName(inputFormName).setValue(newServerName);

List<HtmlRadioButtonInput> radioButtons = form.getRadioButtonsByName(radioButtonName);
HtmlRadioButtonInput radioButtonCopy = null;
for (HtmlRadioButtonInput button : radioButtons) {
if (radioButtonCopyValue.equals(button.getValueAttribute())) {
if (radioButtonCopyValue.equals(button.getValue())) {
radioButtonCopy = button;
radioButtonCopy.setChecked(true);
}
}
assertTrue("Failed to choose 'Copy from Existing Server Configurations'", radioButtonCopy.isChecked());

form.getInputByName(fromInputFormName).setValueAttribute(fromServerName);
form.getInputByName(fromInputFormName).setValue(fromServerName);

j.submit(form);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
import java.io.IOException;
import java.util.concurrent.TimeUnit;

import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.HttpMethod;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebRequest;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.util.UrlUtils;
import org.htmlunit.FailingHttpStatusCodeException;
import org.htmlunit.HttpMethod;
import org.htmlunit.Page;
import org.htmlunit.WebRequest;
import org.htmlunit.html.HtmlForm;
import org.htmlunit.html.HtmlPage;
import org.htmlunit.util.UrlUtils;
import hudson.model.FreeStyleBuild;
import hudson.model.FreeStyleProject;
import hudson.model.Item;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

package com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.actions.manual;

import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlImage;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlTable;
import com.gargoylesoftware.htmlunit.html.HtmlTableCell;
import org.htmlunit.html.DomNode;
import org.htmlunit.html.HtmlForm;
import org.htmlunit.html.HtmlImage;
import org.htmlunit.html.HtmlPage;
import org.htmlunit.html.HtmlTable;
import org.htmlunit.html.HtmlTableCell;
import com.sonyericsson.hudson.plugins.gerrit.trigger.GerritServer;
import com.sonyericsson.hudson.plugins.gerrit.trigger.PluginImpl;
import com.sonyericsson.hudson.plugins.gerrit.trigger.config.Config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
*/
package com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.actions.manual;

import com.gargoylesoftware.htmlunit.ElementNotFoundException;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import org.htmlunit.ElementNotFoundException;
import org.htmlunit.FailingHttpStatusCodeException;
import org.htmlunit.Page;
import org.htmlunit.html.HtmlAnchor;
import org.htmlunit.html.HtmlForm;
import org.htmlunit.html.HtmlPage;
import com.sonyericsson.hudson.plugins.gerrit.trigger.GerritServer;
import com.sonyericsson.hudson.plugins.gerrit.trigger.PluginImpl;
import hudson.Functions;
Expand Down Expand Up @@ -182,7 +182,7 @@ public void testDoGerritSearch() throws Exception {
try {
HtmlPage page = wc.goTo(action.getUrlName());
HtmlForm form = page.getFormByName("theSearch");
form.getInputByName("queryString").setValueAttribute("2000");
form.getInputByName("queryString").setValue("2000");
Page result = j.submit(form);
j.assertGoodStatus(result);
} catch (FailingHttpStatusCodeException e) {
Expand Down Expand Up @@ -211,7 +211,7 @@ public void testDoGerritSearchNotPermitted() throws Exception {
try {
HtmlPage page = wc.goTo(action.getUrlName());
HtmlForm form = page.getFormByName("theSearch");
form.getInputByName("queryString").setValueAttribute("2000");
form.getInputByName("queryString").setValue("2000");
j.submit(form);
} catch (FailingHttpStatusCodeException e) {
assertEquals(403, e.getStatusCode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;

import com.gargoylesoftware.htmlunit.html.HtmlForm;
import org.htmlunit.html.HtmlForm;
import com.sonyericsson.hudson.plugins.gerrit.trigger.events.lifecycle.GerritEventLifecycle;
import com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent;
import hudson.model.Cause;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
*/
package com.sonyericsson.hudson.plugins.gerrit.trigger.project;

import com.gargoylesoftware.htmlunit.html.DomElement;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlSelect;
import org.htmlunit.html.DomElement;
import org.htmlunit.html.HtmlElement;
import org.htmlunit.html.HtmlPage;
import org.htmlunit.html.HtmlSelect;
import com.sonyericsson.hudson.plugins.gerrit.trigger.GerritServer;
import com.sonyericsson.hudson.plugins.gerrit.trigger.PluginImpl;
import com.sonyericsson.hudson.plugins.gerrit.trigger.VerdictCategory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

package com.sonyericsson.hudson.plugins.gerrit.trigger.spec;

import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import org.htmlunit.html.HtmlForm;
import org.htmlunit.html.HtmlPage;
import com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater;
import com.sonyericsson.hudson.plugins.gerrit.trigger.dependency.DependencyQueueTaskDispatcher;
import com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener;
Expand Down Expand Up @@ -128,7 +128,7 @@ public void testNewProjectCreationWithReName() throws Exception {
FreeStyleProject p = createGerritTriggeredJob(j, "testJob3");

HtmlForm form = j.createWebClient().getPage(p, "confirm-rename").getFormByName("config");
form.getInputByName("newName").setValueAttribute("testJob33");
form.getInputByName("newName").setValue("testJob33");
HtmlPage confirmPage = j.submit(form);
assertEquals("testJob33", p.getName());
assertAllListenersAreRegistered(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@

package com.sonyericsson.hudson.plugins.gerrit.trigger.spec;

import com.gargoylesoftware.htmlunit.HttpMethod;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebRequest;
import com.gargoylesoftware.htmlunit.util.UrlUtils;
import com.gargoylesoftware.htmlunit.xml.XmlPage;
import org.htmlunit.HttpMethod;
import org.htmlunit.Page;
import org.htmlunit.WebRequest;
import org.htmlunit.util.UrlUtils;
import org.htmlunit.xml.XmlPage;
import com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater;
import com.sonyericsson.hudson.plugins.gerrit.trigger.GerritServer;
import com.sonyericsson.hudson.plugins.gerrit.trigger.PluginImpl;
Expand Down

0 comments on commit 475e265

Please sign in to comment.