Skip to content

Commit

Permalink
update java client selenium dependency (#535)
Browse files Browse the repository at this point in the history
* replace deprecated (now removed) CommandLine #find method

* upgrade java dependency to selenium 3.1.0

* replace deprecated Throwables.propagateIfPossible with Throwables.throwIfUnchecked
* bump version to 2.1.0
* remove SuppressWarnings annotation

fixes #528
  • Loading branch information
jesg authored and detro committed Jun 6, 2017
1 parent 2bf0086 commit 72cf75f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ IRC channel: [#phantomjs-ghostdriver](http://webchat.freenode.net/?channels=%23p
## Setup

* Download latest stable PhantomJS from [here](http://phantomjs.org/download.html)
* Selenium version `">= 3.0.0`"
* Selenium version `">= 3.1.0`"

**THAT'S IT!!** Because of latest stable GhostDriver being embedded in PhantomJS,
you shouldn't need anything else to get started.
Expand Down Expand Up @@ -62,7 +62,7 @@ For versions >= 2.0.0, add the following to your `pom.xml`:
<dependency>
<groupId>com.github.detro</groupId>
<artifactId>ghostdriver</artifactId>
<version>2.0.0</version>
<version>2.1.0</version>
</dependency>
```

Expand All @@ -81,7 +81,7 @@ allprojects {
```gradle
dependencies {
...
testCompile 'com.github.detro:ghostdriver:2.0.0'
testCompile 'com.github.detro:ghostdriver:2.1.0'
...
}
```
Expand Down
4 changes: 2 additions & 2 deletions binding/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ compileJava {
options.compilerArgs.add("-Xlint:deprecation")
}

ext.seleniumVersion = "3.0.0"
ext.seleniumVersion = "3.1.0"
project.archivesBaseName = project.name
project.version = "2.0.0"
project.version = "2.1.0"

ext.projectGroupId = "com.github.detro"
ext.projectArtifactId = "phantomjsdriver"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public Response execute(Command command) throws IOException {
!service.isRunning()) {
throw new WebDriverException("The PhantomJS/GhostDriver server has unexpectedly died!", t);
}
Throwables.propagateIfPossible(t);
Throwables.throwIfUnchecked(t);
throw new WebDriverException(t);
} finally {
if (DriverCommand.QUIT.equals(command.getName())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.openqa.selenium.Proxy;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.net.PortProber;
import org.openqa.selenium.os.CommandLine;
import org.openqa.selenium.os.ExecutableFinder;
import org.openqa.selenium.remote.service.DriverService;

import java.io.File;
Expand Down Expand Up @@ -231,15 +231,14 @@ public static PhantomJSDriverService createDefaultService() {
* @return The driver executable as a {@link File} object
* @throws IllegalStateException If the executable not found or cannot be executed
*/
@SuppressWarnings("deprecation")
protected static File findPhantomJS(Capabilities desiredCapabilities, String docsLink,
String downloadLink) {
String phantomjspath;
if (desiredCapabilities != null &&
desiredCapabilities.getCapability(PHANTOMJS_EXECUTABLE_PATH_PROPERTY) != null) {
phantomjspath = (String) desiredCapabilities.getCapability(PHANTOMJS_EXECUTABLE_PATH_PROPERTY);
} else {
phantomjspath = CommandLine.find(PHANTOMJS_DEFAULT_EXECUTABLE);
phantomjspath = new ExecutableFinder().find(PHANTOMJS_DEFAULT_EXECUTABLE);
phantomjspath = System.getProperty(PHANTOMJS_EXECUTABLE_PATH_PROPERTY, phantomjspath);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ghostdriver = {
logger : require("./logger.js"),
webdriver_logger : require("./webdriver_logger.js"),
config : null, //< this will be set below
version : "2.0.0"
version : "2.1.0"
};

// create logger
Expand Down
4 changes: 2 additions & 2 deletions test/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ repositories {
}

ext.commonsFileUploadVersion = "1.3"
ext.seleniumVersion = "3.0.0"
ext.seleniumVersion = "3.1.0"
ext.jettyVersion = "6.1.21"
ext.jsr305Version = "2.0.1"
ext.browsermobProxyClientVersion = "0.1.3"
ext.phantomjsdriverVersion = "2.0.0"
ext.phantomjsdriverVersion = "2.1.0"

configurations {
// introduces a transitive dependency on selenium 2.53
Expand Down

0 comments on commit 72cf75f

Please sign in to comment.