on JVM ▸ Emulates Android framework behavior in JVM, instead of device or emulator ▸ Has tons of mock implementation on framework and system services ▸ Popular choice of testing framework in Android development ▸ Frequently combined with Mockito 3
1.Load test class 2.Invoke @BeforeClass if any 3.Set up test environment based on @Config or robolectric.properties 4.Reset static states 5.Load system resources and app resources 6.Invoke @Before, @Test, @After methods 12
1.Load test class 2.Invoke @BeforeClass if any 3.Set up test environment based on @Config or robolectric.properties 4.Reset static states 5.Load system resources and app resources 6.Invoke @Before, @Test, @After methods 13
a table which maps all resources (app and system resources) ▸ Put all resources in the memory 14 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑
id in the test 15 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ context.getString(R.string.no) # R.string.no => 17049821
id in the test 16 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 context.getString(R.string.no) # R.string.no => 17049821
id in the test 17 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 context.getString(R.string.no) # R.string.no => 17049821
id in the test 18 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 context.getString(R.string.no) # R.string.no => 17049821
id in the test 19 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources context.getString(R.string.no) # R.string.no => 17049821
id in the test 20 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources context.getString(R.string.no) # R.string.no => 17049821
id in the test 21 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources ResourceIndex#getResName(resourceId) context.getString(R.string.no) # R.string.no => 17049821
id in the test 22 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources ResourceIndex#getResName(resourceId) ResName{android:string/no} context.getString(R.string.no) # R.string.no => 17049821
id in the test 23 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources ResourceIndex#getResName(resourceId) ResName{android:string/no} type == string context.getString(R.string.no) # R.string.no => 17049821
id in the test 24 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources ResourceIndex#getResName(resourceId) ResName{android:string/no} type == string context.getString(R.string.no) # R.string.no => 17049821
id in the test 25 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources ResourceIndex#getResName(resourceId) ResName{android:string/no} type == string ResName{android:string/no} context.getString(R.string.no) # R.string.no => 17049821
id in the test 26 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources ResourceIndex#getResName(resourceId) ResName{android:string/no} type == string ResName{android:string/no} ResName{android:string/ok} context.getString(R.string.no) # R.string.no => 17049821
id in the test 27 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources ResourceIndex#getResName(resourceId) ResName{android:string/no} type == string ResName{android:string/no} ResName{android:string/yes} context.getString(R.string.no) # R.string.no => 17049821
id in the test 28 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources ResourceIndex#getResName(resourceId) ResName{android:string/no} type == string ResName{android:string/no} ResName{android:string/no} context.getString(R.string.no) # R.string.no => 17049821
id in the test 29 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources ResourceIndex#getResName(resourceId) ResName{android:string/no} type == string ResName{android:string/no} ResName{android:string/no} context.getString(R.string.no) # R.string.no => 17049821
id in the test 30 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources ResourceIndex#getResName(resourceId) ResName{android:string/no} type == string ResName{android:string/no} ResName{android:string/no} context.getString(R.string.no) # R.string.no => 17049821
id in the test 31 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources ResourceIndex#getResName(resourceId) ResName{android:string/no} type == string ResName{android:string/no} ResName{android:string/no} RuntimeEnvironment.getQualifiers() context.getString(R.string.no) # R.string.no => 17049821
id in the test 32 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources ResourceIndex#getResName(resourceId) ResName{android:string/no} type == string ResName{android:string/no} ResName{android:string/no} RuntimeEnvironment.getQualifiers() en context.getString(R.string.no) # R.string.no => 17049821
id in the test 33 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources ResourceIndex#getResName(resourceId) ResName{android:string/no} type == string ResName{android:string/no} ResName{android:string/no} RuntimeEnvironment.getQualifiers() en context.getString(R.string.no) # R.string.no => 17049821
id in the test 34 System Resources App Resources AssetManager string drawable layout ok yes no en: No fr: Non ja: ͍͍͑ 1000001000000000001001100 >>> 24 0000000000000000000000001 == pointing to System Resources ResourceIndex#getResName(resourceId) ResName{android:string/no} type == string ResName{android:string/no} ResName{android:string/no} RuntimeEnvironment.getQualifiers() en context.getString(R.string.no) => “No” # R.string.no => 17049821