Skip to content

Commit

Permalink
Merge pull request #43 from eBay-European-Product-Development/master
Browse files Browse the repository at this point in the history
[FIXED JENKINS-26338] Also use configured executable when using named emulators.
  • Loading branch information
orrc committed Jan 21, 2015
2 parents 9bfa98a + efcafe3 commit 53fbfdf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
Expand Up @@ -46,14 +46,15 @@ class EmulatorConfig implements Serializable {
private final String avdNameSuffix;

private EmulatorConfig(String avdName, boolean wipeData, boolean showWindow,
boolean useSnapshots, String commandLineOptions, String androidSdkHome, String avdNameSuffix) {
boolean useSnapshots, String commandLineOptions, String androidSdkHome, String executable, String
avdNameSuffix) {
this.avdName = avdName;
this.wipeData = wipeData;
this.showWindow = showWindow;
this.useSnapshots = useSnapshots;
this.commandLineOptions = commandLineOptions;
this.androidSdkHome = androidSdkHome;
this.executable = null;
this.executable = executable;
this.avdNameSuffix = avdNameSuffix;
}

Expand Down Expand Up @@ -121,7 +122,7 @@ public static final EmulatorConfig create(String avdName, String osVersion, Stri
showWindow, useSnapshots, commandLineOptions, targetAbi, androidSdkHome, executable, avdNameSuffix);
}

return new EmulatorConfig(avdName, wipeData, showWindow, useSnapshots, commandLineOptions, androidSdkHome,
return new EmulatorConfig(avdName, wipeData, showWindow, useSnapshots, commandLineOptions, androidSdkHome, executable,
avdNameSuffix);
}

Expand Down
@@ -0,0 +1,21 @@
package hudson.plugins.android_emulator;

import hudson.plugins.android_emulator.sdk.Tool;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class EmulatorConfigTest {

//does not work
@Test
public void shouldSelectExecutor64WhenPassedAsExecutorAndAvdIsSelected(){
EmulatorConfig emulatorConfigWithAvdName = EmulatorConfig.create(
"hudson_en-US_160_WVGA_android-21", "5.0", "160", "WVGA", "", "", false, false, false, "", "", "", "emulator64-arm", "");
assertEquals(Tool.EMULATOR64_ARM, emulatorConfigWithAvdName.getExecutable()); }
//does work
@Test
public void shouldSelectExecutor64WhenPassedAsExecutorAndAvdIsEmpty(){
EmulatorConfig emulatorConfigWithNoAvdName = EmulatorConfig.create("", "5.0", "160", "WVGA", "", "", false, false, false, "", "", "", "emulator64-arm", "");
assertEquals(Tool.EMULATOR64_ARM, emulatorConfigWithNoAvdName.getExecutable()); }
}

0 comments on commit 53fbfdf

Please sign in to comment.