Skip to content
Permalink
Browse files

Merge pull request #43 from eBay-European-Product-Development/master

[FIXED JENKINS-26338] Also use configured executable when using named emulators.
  • Loading branch information
orrc committed Jan 21, 2015
2 parents 9bfa98a + efcafe3 commit 53fbfdf677e41dad1246a892f18a715e1abca9dd
@@ -46,14 +46,15 @@
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;
}

@@ -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);
}

@@ -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.
You can’t perform that action at this time.