Class DefaultSdkProvider.DefaultSdk
- All Implemented Interfaces:
Comparable<Sdk>
- Enclosing class:
- DefaultSdkProvider
-
Constructor Summary
ConstructorDescriptionDefaultSdk
(int apiLevel, String androidVersion, String robolectricVersion, String codeName, int requiredJavaVersion) -
Method Summary
Modifier and TypeMethodDescriptionReturns the Android codename for this SDK.Returns the Android Version for this SDK.Returns the path to jar for this SDK.Returns a human-readable message explaining why this SDK isn't supported.boolean
Determines if this SDK is supported in the running Robolectric environment.void
verifySupportedSdk
(String testClassName) Verify that the SDK is supported.
-
Constructor Details
-
DefaultSdk
-
-
Method Details
-
getAndroidVersion
Description copied from class:Sdk
Returns the Android Version for this 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.
- Specified by:
getAndroidVersion
in classSdk
- See Also:
-
getAndroidCodeName
Description copied from class:Sdk
Returns the Android codename for this 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.
- Specified by:
getAndroidCodeName
in classSdk
-
getJarPath
Description copied from class:Sdk
Returns the path to jar for this SDK.- Specified by:
getJarPath
in classSdk
-
isSupported
public boolean isSupported()Description copied from class:Sdk
Determines if this SDK is supported in the running Robolectric environment.An SDK might be unsupported if e.g. it requires a newer version of the JVM than is currently running.
Unsupported SDKs should throw some explanatory exception when
Sdk.getJarPath()
is invoked.If this is an expensive operation, the implementation should cache the return value.
- Specified by:
isSupported
in classSdk
-
getUnsupportedMessage
Description copied from class:Sdk
Returns a human-readable message explaining why this SDK isn't supported.If this is an expensive operation, the implementation should cache the return value.
- Specified by:
getUnsupportedMessage
in classSdk
-
verifySupportedSdk
Description copied from class:Sdk
Verify that the SDK is supported.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.
- Specified by:
verifySupportedSdk
in classSdk
-