Skip to content

Commit

Permalink
cleanup imports
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Nov 4, 2021
1 parent fdd38c4 commit 38c7d5a
Show file tree
Hide file tree
Showing 60 changed files with 169 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@

package org.openqa.selenium.htmlunit;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.remote.Browser;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import org.openqa.selenium.Capabilities;
import org.openqa.selenium.remote.Browser;

import com.gargoylesoftware.htmlunit.BrowserVersion;

/**
* Determine browser and its version
*/
Expand Down
38 changes: 19 additions & 19 deletions src/main/java/org/openqa/selenium/htmlunit/ElementConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@

package org.openqa.selenium.htmlunit;

import com.gargoylesoftware.htmlunit.html.DomElement;
import org.openqa.selenium.By;

import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.Objects;

import static org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByClassName;
import static org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByCssSelector;
import static org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByID;
import static org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByLinkText;
import static org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByName;
import static org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByPartialLinkText;
import static org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByTagName;
import static org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByXPath;
import static org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindByCssSelector;
import static org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindById;
import static org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindByLinkText;
import static org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindByPartialLinkText;
import static org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindByXPath;
import static org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindByName;
import static org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindByTagName;
import static org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindByClassName;
import org.openqa.selenium.By;
import org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByClassName;
import org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByCssSelector;
import org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByID;
import org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByLinkText;
import org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByName;
import org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByPartialLinkText;
import org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByTagName;
import org.openqa.selenium.htmlunit.HtmlUnitElementFinder.FindByXPath;
import org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindByClassName;
import org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindByCssSelector;
import org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindById;
import org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindByLinkText;
import org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindByName;
import org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindByPartialLinkText;
import org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindByTagName;
import org.openqa.selenium.htmlunit.HtmlUnitWebElementFinder.WebFindByXPath;

import com.gargoylesoftware.htmlunit.html.DomElement;

/**
* Used for converting By locators to custom ones
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import static org.openqa.selenium.remote.CapabilityType.ACCEPT_SSL_CERTS;
import static org.openqa.selenium.remote.CapabilityType.PAGE_LOAD_STRATEGY;
import static org.openqa.selenium.remote.CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR;

import java.io.IOException;
import java.lang.reflect.Field;
Expand Down Expand Up @@ -57,15 +56,13 @@
import org.openqa.selenium.Proxy;
import org.openqa.selenium.StaleElementReferenceException;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.UnexpectedAlertBehaviour;
import org.openqa.selenium.UnhandledAlertException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.WrapsElement;
import org.openqa.selenium.interactions.HasInputDevices;
import org.openqa.selenium.interactions.Keyboard;
import org.openqa.selenium.interactions.Mouse;
import org.openqa.selenium.WrapsElement;
import org.openqa.selenium.remote.BrowserType;
import org.openqa.selenium.remote.DesiredCapabilities;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@

package org.openqa.selenium.htmlunit;

import static org.openqa.selenium.htmlunit.HtmlUnitDriver.INVALIDSELECTIONERROR;
import static org.openqa.selenium.htmlunit.HtmlUnitDriver.INVALIDXPATHERROR;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.InvalidSelectorException;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import com.gargoylesoftware.css.parser.CSSException;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.SgmlPage;
Expand All @@ -26,19 +40,6 @@
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import org.openqa.selenium.By;
import org.openqa.selenium.InvalidSelectorException;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import static org.openqa.selenium.htmlunit.HtmlUnitDriver.INVALIDSELECTIONERROR;
import static org.openqa.selenium.htmlunit.HtmlUnitDriver.INVALIDXPATHERROR;

public class HtmlUnitElementFinder {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@

import java.io.IOException;

import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriverException;

import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlFileInput;
import com.gargoylesoftware.htmlunit.html.HtmlInput;
import com.gargoylesoftware.htmlunit.html.HtmlNumberInput;
import com.gargoylesoftware.htmlunit.html.Keyboard;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriverException;

/**
* Implements keyboard operations using the HtmlUnit WebDriver.
Expand Down
23 changes: 12 additions & 11 deletions src/main/java/org/openqa/selenium/htmlunit/HtmlUnitOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@

package org.openqa.selenium.htmlunit;

import com.gargoylesoftware.htmlunit.CookieManager;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.google.common.base.Function;
import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import java.net.URL;
import java.util.Optional;
import java.util.Set;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.openqa.selenium.Cookie;
import org.openqa.selenium.InvalidCookieDomainException;
Expand All @@ -33,9 +29,14 @@
import org.openqa.selenium.htmlunit.logging.HtmlUnitLogs;
import org.openqa.selenium.logging.Logs;

import java.net.URL;
import java.util.Optional;
import java.util.Set;
import com.gargoylesoftware.htmlunit.CookieManager;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.google.common.base.Function;
import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;

/**
* Manages driver options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,8 @@

package org.openqa.selenium.htmlunit;

import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebWindow;
import com.gargoylesoftware.htmlunit.WebWindowNotFoundException;
import com.gargoylesoftware.htmlunit.html.BaseFrameElement;
import com.gargoylesoftware.htmlunit.html.DomElement;
import com.gargoylesoftware.htmlunit.html.FrameWindow;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlHtml;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import java.util.List;

import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.NoAlertPresentException;
Expand All @@ -38,7 +31,15 @@
import org.openqa.selenium.WindowType;
import org.openqa.selenium.WrapsElement;

import java.util.List;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebWindow;
import com.gargoylesoftware.htmlunit.WebWindowNotFoundException;
import com.gargoylesoftware.htmlunit.html.BaseFrameElement;
import com.gargoylesoftware.htmlunit.html.DomElement;
import com.gargoylesoftware.htmlunit.html.FrameWindow;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlHtml;
import com.gargoylesoftware.htmlunit.html.HtmlPage;

/**
* HtmlUnit target locator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@

package org.openqa.selenium.htmlunit;

import com.gargoylesoftware.htmlunit.WebClient;
import org.openqa.selenium.WebDriver;

import java.time.Duration;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;

import com.gargoylesoftware.htmlunit.WebClient;

/**
* Class for timeouts managing
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package org.openqa.selenium.htmlunit;

import com.gargoylesoftware.htmlunit.html.DomElement;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.InvalidSelectorException;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import com.gargoylesoftware.htmlunit.html.DomElement;
import com.gargoylesoftware.htmlunit.html.HtmlElement;

public class HtmlUnitWebElementFinder {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@

package org.openqa.selenium.htmlunit;

import org.openqa.selenium.Dimension;
import org.openqa.selenium.Point;
import org.openqa.selenium.WebDriver;

import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.WebWindow;
import com.gargoylesoftware.htmlunit.WebWindowEvent;
import com.gargoylesoftware.htmlunit.WebWindowListener;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.Point;
import org.openqa.selenium.WebDriver;

public class HtmlUnitWindow implements WebDriver.Window {

Expand Down
8 changes: 3 additions & 5 deletions src/test/java/org/openqa/selenium/AlertsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

package org.openqa.selenium;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assume.assumeFalse;
import static org.openqa.selenium.WaitingConditions.newWindowIsOpened;
import static org.openqa.selenium.support.ui.ExpectedConditions.alertIsPresent;
Expand All @@ -43,20 +43,18 @@
import org.junit.Test;
import org.openqa.selenium.environment.webserver.Page;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.remote.Browser;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.NoDriverAfterTest;
import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.SwitchToTopAfterTest;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import org.openqa.selenium.testing.drivers.BrowserToCapabilities;
import org.openqa.selenium.testing.drivers.BrowserType;

import com.gargoylesoftware.htmlunit.BrowserVersion;

@Ignore(value = CHROME, reason = "https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500")
public class AlertsTest extends JUnit4TestBase {

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/openqa/selenium/ArchitectureTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

package org.openqa.selenium;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.openqa.selenium.testing.TestUtilities.catchThrowable;

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/openqa/selenium/ChildrenFindingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@

package org.openqa.selenium;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.openqa.selenium.testing.Driver.CHROME;
import static org.openqa.selenium.testing.Driver.SAFARI;
import static org.openqa.selenium.testing.TestUtilities.catchThrowable;

import java.util.List;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;

import java.util.List;
import org.openqa.selenium.testing.NotYetImplemented;

public class ChildrenFindingTest extends JUnit4TestBase {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/openqa/selenium/ClearTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
package org.openqa.selenium;

import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.openqa.selenium.testing.Driver.CHROME;
import static org.openqa.selenium.testing.Driver.FIREFOX;
import static org.openqa.selenium.testing.Driver.HTMLUNIT;
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/openqa/selenium/ClickScrollingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

package org.openqa.selenium;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;
import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated;
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/openqa/selenium/ContentEditableTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

package org.openqa.selenium;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assume.assumeFalse;
import static org.openqa.selenium.testing.Driver.CHROME;
import static org.openqa.selenium.testing.Driver.EDGE;
Expand Down
Loading

0 comments on commit 38c7d5a

Please sign in to comment.