Comparable<Sdk>public class DefaultSdkProvider.DefaultSdk extends Sdk
| Constructor | Description |
|---|---|
DefaultSdk(int apiLevel,
String androidVersion,
String robolectricVersion,
String codeName,
int requiredJavaVersion) |
| Modifier and Type | Method | Description |
|---|---|---|
String |
getAndroidCodeName() |
Returns the Android codename for this SDK.
|
String |
getAndroidVersion() |
Returns the Android Version for this SDK.
|
Path |
getJarPath() |
Returns the path to jar for this SDK.
|
String |
getUnsupportedMessage() |
Returns a human-readable message explaining why this SDK isn't supported.
|
boolean |
isSupported() |
Determines if this SDK is supported in the running Robolectric environment.
|
void |
verifySupportedSdk(String testClassName) |
Verify that the SDK is supported.
|
public String getAndroidVersion()
SdkIt should match the version reported by android.os.Build.VERSION.RELEASE provided
within.
If this is an expensive operation, the implementation should cache the return value.
getAndroidVersion in class Sdkpublic String getAndroidCodeName()
SdkIt should match the version reported by android.os.Build.VERSION.CODENAME provided
within.
If this is an expensive operation, the implementation should cache the return value.
getAndroidCodeName in class Sdkpublic Path getJarPath()
SdkgetJarPath in class Sdkpublic boolean isSupported()
SdkSdk.getJarPath() is invoked.
If this is an expensive operation, the implementation should cache the return value.isSupported in class Sdkpublic String getUnsupportedMessage()
SdkgetUnsupportedMessage in class Sdkpublic void verifySupportedSdk(String testClassName)
SdkImplementations should throw an exception if SDK is unsupported. They can choose to either throw org.junit.AssumptionViolatedException to just skip execution of tests on the SDK, with a warning, or throw a RuntimeException to fail the test.
verifySupportedSdk in class Sdk