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()
Sdk
It 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 Sdk
public String getAndroidCodeName()
Sdk
It 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 Sdk
public Path getJarPath()
Sdk
getJarPath
in class Sdk
public boolean isSupported()
Sdk
Sdk.getJarPath()
is invoked.
If this is an expensive operation, the implementation should cache the return value.isSupported
in class Sdk
public String getUnsupportedMessage()
Sdk
getUnsupportedMessage
in class Sdk
public void verifySupportedSdk(String testClassName)
Sdk
Implementations 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