public class PhantomJSDriverBinaryHandler extends AbstractBinaryHandler
ExternalBinarySource
DOWNLOAD_BINARIES_PROPERTY
Constructor and Description |
---|
PhantomJSDriverBinaryHandler(org.openqa.selenium.remote.DesiredCapabilities capabilities) |
Modifier and Type | Method and Description |
---|---|
String |
checkAndSetBinary(boolean performExecutableValidations)
Checks system properties and capabilities, whether a path to binary is already set there
(see
AbstractBinaryHandler.getSystemBinaryProperty() and AbstractBinaryHandler.getBinaryProperty() ). |
File |
downloadAndPrepare()
This method consist of four steps:
|
protected String |
getArquillianCacheSubdirectory()
Name of the subdirectory that should be used for this binary handler in the Drone cache directory
($HOME/.arquillian/drone) |
protected String |
getBinaryProperty()
This method should return a capability property name which a path to an executable binary could be stored under
|
protected org.openqa.selenium.remote.DesiredCapabilities |
getCapabilities()
This method should return a desired capabilities with stored properties
|
protected String |
getDesiredVersionProperty()
This method should return a capability property name which a desired version of a binary could be stored under
|
protected ExternalBinarySource |
getExternalBinarySource()
This method should return an instance of an
ExternalBinary that should be used for retrieving available
releases of a binary |
String |
getSystemBinaryProperty()
This method should return a system property name which a path to an executable binary should be stored under
|
protected String |
getUrlToDownloadProperty()
This method should return a capability property name which a url pointing to a desired binary could be stored under
|
downloadAndPrepare, downloadAndPrepare, markAsExecutable, setBinaryAsSystemProperty
public PhantomJSDriverBinaryHandler(org.openqa.selenium.remote.DesiredCapabilities capabilities)
public String checkAndSetBinary(boolean performExecutableValidations)
AbstractBinaryHandler
AbstractBinaryHandler.getSystemBinaryProperty()
and AbstractBinaryHandler.getBinaryProperty()
).
If not and the downloading is not set off (AbstractBinaryHandler.DOWNLOAD_BINARIES_PROPERTY
), then the
binary is downloaded. Resulting binary is then set as system property that is returned by the method
AbstractBinaryHandler.getSystemBinaryProperty()
checkAndSetBinary
in interface BinaryHandler
checkAndSetBinary
in class AbstractBinaryHandler
performExecutableValidations
- If it should be checked whether the binary points to an executable file.public File downloadAndPrepare() throws Exception
AbstractBinaryHandler
AbstractBinaryHandler.getUrlToDownloadProperty()
and
AbstractBinaryHandler.getDesiredVersionProperty()
.
If there is set only the desired version, then a binary with the specified version is downloaded using an external
binary source (AbstractBinaryHandler.getExternalBinarySource()
)
If there is set neither a url nor a desired version, then a binary with the latest version is downloaded using the external binary source.
Directory where the downloaded file is stored depends on set properties. If there is set the desired version,
or if the latest version is downloaded then the file is stored in:
$HOME/.arquillian/drone/ +
AbstractBinaryHandler.getArquillianCacheSubdirectory()
+ / + version
If the version is not set, then the file is stored in: target/drone/downloaded
target/drone/md5hash(downloaded_file)/
downloadAndPrepare
in interface BinaryHandler
downloadAndPrepare
in class AbstractBinaryHandler
Exception
- If anything bad happensprotected String getBinaryProperty()
AbstractBinaryHandler
getBinaryProperty
in class AbstractBinaryHandler
public String getSystemBinaryProperty()
AbstractBinaryHandler
getSystemBinaryProperty
in interface BinaryHandler
getSystemBinaryProperty
in class AbstractBinaryHandler
protected String getArquillianCacheSubdirectory()
AbstractBinaryHandler
($HOME/.arquillian/drone)
getArquillianCacheSubdirectory
in class AbstractBinaryHandler
protected String getDesiredVersionProperty()
AbstractBinaryHandler
getDesiredVersionProperty
in class AbstractBinaryHandler
protected String getUrlToDownloadProperty()
AbstractBinaryHandler
getUrlToDownloadProperty
in class AbstractBinaryHandler
protected ExternalBinarySource getExternalBinarySource()
AbstractBinaryHandler
ExternalBinary
that should be used for retrieving available
releases of a binarygetExternalBinarySource
in class AbstractBinaryHandler
ExternalBinary
that should be used for retrieving available releases of a binaryprotected org.openqa.selenium.remote.DesiredCapabilities getCapabilities()
AbstractBinaryHandler
getCapabilities
in class AbstractBinaryHandler
Copyright © 2017 JBoss by Red Hat. All rights reserved.