1package com.example.simpleperf.simpleperfexamplepurejava; 2 3import android.content.Context; 4import android.support.test.InstrumentationRegistry; 5import android.support.test.runner.AndroidJUnit4; 6 7import org.junit.Test; 8import org.junit.runner.RunWith; 9 10import static org.junit.Assert.*; 11 12/** 13 * Instrumentation test, which will execute on an Android device. 14 * 15 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> 16 */ 17@RunWith(AndroidJUnit4.class) 18public class ExampleInstrumentedTest { 19 @Test 20 public void useAppContext() throws Exception { 21 // Context of the app under test. 22 Context appContext = InstrumentationRegistry.getTargetContext(); 23 24 assertEquals("com.example.simpleperf.simpleperfexamplepurejava", appContext.getPackageName()); 25 } 26} 27