ExampleInstrumentedTest.java 758 B

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