Skip to content

Commit

Permalink
ARQ-1933 Update Droidium to use Selendroid 0.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Miklosovic committed Mar 9, 2015
1 parent 500895b commit 3c8ba65
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
Expand Up @@ -30,26 +30,18 @@
*/
public class DroidiumNativeConfiguration {

public static final String SELENDROID_VERSION = "0.14.0";
public static final String SELENDROID_VERSION = "0.15.0";

public static final String SERVER_HOME = System.getProperty("user.home") + "/.droidium/selendroid-server-" + SELENDROID_VERSION + ".apk";

public static final String DRIVER_HOME = System.getProperty("user.home") + "/.droidium/android-driver-app-" + SELENDROID_VERSION + ".apk";

private String serverApk = SERVER_HOME;

private String driverApk = DRIVER_HOME;

private Map<String, String> properties = new HashMap<String, String>();

public File getServerApk() {
return new File(getProperty("serverApk", serverApk));
}

public File getDriverApk() {
return new File(getProperty("driverApk", driverApk));
}

/**
* Sets properties as configuration.
*
Expand Down Expand Up @@ -106,7 +98,6 @@ public void validate() throws IllegalArgumentException, IllegalStateException {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(String.format("%-40s %s\n", "serverApk", getServerApk()));
sb.append(String.format("%-40s %s\n", "driverApk", getDriverApk()));
return sb.toString();
}
}
Expand Up @@ -58,14 +58,13 @@ public void onDroidiumNativeConfigured(@Observes DroidiumNativeConfigured event)

DroidiumNativeConfiguration configuration = this.configuration.get();

if (!Validate.isReadable(configuration.getServerApk()) || !Validate.isReadable(configuration.getDriverApk())) {
if (!Validate.isReadable(configuration.getServerApk())) {
configuration.setProperty("serverApk", DroidiumNativeConfiguration.SERVER_HOME);
configuration.setProperty("driverApk", DroidiumNativeConfiguration.DRIVER_HOME);

if (!Validate.isReadable(configuration.getServerApk()) || !Validate.isReadable(configuration.getDriverApk())) {
if (!Validate.isReadable(configuration.getServerApk())) {

logger.info("You must provide a valid path both to Android Server APK and Android driver APK for Arquillian Droidium"
+ " native plugin. Please be sure you have the read access to specified files. Both APKs are going to be "
logger.info("You must provide a valid path to Selendroid server APK to Arquillian Droidium"
+ " native plugin. Please be sure you have the read access to specified file. APK is going to be "
+ "downloaded for you automatically right now.");

try {
Expand All @@ -82,8 +81,6 @@ public void onDroidiumNativeConfigured(@Observes DroidiumNativeConfigured event)
DroidiumFileUtils.copyFileToDirectory(new File(unzipped, "/prebuild/selendroid-server-" + DroidiumNativeConfiguration.SELENDROID_VERSION + ".apk"),
new File(System.getProperty("user.home") + "/.droidium"));

DroidiumFileUtils.copyFileToDirectory(new File(unzipped, "/prebuild/android-driver-app-" + DroidiumNativeConfiguration.SELENDROID_VERSION + ".apk"),
new File(System.getProperty("user.home") + "/.droidium"));
} catch (TimeoutExecutionException ex) {
throw new TimeoutExecutionException(String.format("Unable to download Selendroid from "
+ "%s in %s minutes.", SELENDROID_SERVER_URL, DOWNLOAD_TIMEOUT_IN_MINUTES));
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -89,7 +89,7 @@
<version.recorder>1.0.0.Final</version.recorder>

<!-- Selendroid -->
<version.selendroid>0.14.0</version.selendroid>
<version.selendroid>0.15.0</version.selendroid>

<!-- Other versions -->
<version.maven.animal.sniffer>1.12</version.maven.animal.sniffer>
Expand Down
4 changes: 2 additions & 2 deletions tests/build.gradle
Expand Up @@ -29,8 +29,8 @@ ext {

// downloads from GitHub
selendroidOrganization = "selendroid"
selendroidVersion = "0.14.0"
selendroidCommit = "0.14.0"
selendroidVersion = "0.15.0"
selendroidCommit = "0.15.0"

// downloads from GitHub
recorderOrganization = "arquillian"
Expand Down

0 comments on commit 3c8ba65

Please sign in to comment.