Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED JENKINS-14741] Ignore configured ABI when creating emulators w…
…hich don't support ABIs.
- Loading branch information
Showing
6 changed files
with
106 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/test/java/hudson/plugins/android_emulator/AndroidPlatformTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package hudson.plugins.android_emulator; | ||
|
||
import junit.framework.TestCase; | ||
|
||
public class AndroidPlatformTest extends TestCase { | ||
|
||
public void testCreateKnownPlatform() { | ||
assertEquals(AndroidPlatform.SDK_1_6, AndroidPlatform.valueOf("1.6")); | ||
assertEquals(AndroidPlatform.SDK_1_6, AndroidPlatform.valueOf("4")); | ||
assertEquals(AndroidPlatform.SDK_1_6, AndroidPlatform.valueOf("android-4")); | ||
} | ||
|
||
public void testCreateAddonPlatform() { | ||
final String name = "Some:Addon:11"; | ||
AndroidPlatform platform = AndroidPlatform.valueOf(name); | ||
assertEquals(name, platform.getTargetName()); | ||
} | ||
|
||
public void testCreateInvalidPlatform() { | ||
assertNull(AndroidPlatform.valueOf(null)); | ||
|
||
final String name = "iOS 6.1"; | ||
AndroidPlatform platform = AndroidPlatform.valueOf(name); | ||
assertEquals(name, platform.getTargetName()); | ||
assertEquals(-1, platform.getSdkLevel()); | ||
} | ||
|
||
public void testGetSdkLevel() { | ||
assertEquals(9, AndroidPlatform.SDK_2_3.getSdkLevel()); | ||
assertEquals(10, AndroidPlatform.valueOf("2.3.3").getSdkLevel()); | ||
assertEquals(11, AndroidPlatform.valueOf("Some:Addon:11").getSdkLevel()); | ||
} | ||
|
||
public void testIsCustomPlatform() { | ||
assertFalse(AndroidPlatform.SDK_2_3.isCustomPlatform()); | ||
assertTrue(AndroidPlatform.valueOf("Some:Addon:12").isCustomPlatform()); | ||
} | ||
|
||
public void testRequiresAbi() { | ||
assertFalse(AndroidPlatform.SDK_1_1.requiresAbi()); | ||
assertFalse(AndroidPlatform.SDK_2_3_3.requiresAbi()); | ||
assertFalse(AndroidPlatform.SDK_3_2.requiresAbi()); | ||
assertTrue(AndroidPlatform.SDK_4_0.requiresAbi()); | ||
assertTrue(AndroidPlatform.SDK_4_2.requiresAbi()); | ||
assertTrue(AndroidPlatform.valueOf("android-99").requiresAbi()); | ||
assertTrue(AndroidPlatform.valueOf("Intel Atom x86 System Image").requiresAbi()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters