public void testOnResumeNotAuthenticated() { Instrumentation instrumentation = getInstrumentation(); Instrumentation.ActivityMonitor monitor = instrumentation.addMonitor(RegistrationActivity.class.getName(), null, false); // The user is not authenticated, so it should switch to RegisterActivity. Activity activity = instrumentation.waitForMonitor(monitor); assertNotNull(activity); instrumentation.removeMonitor(monitor); activity.finish(); } }
percentage of code accessed by tests. It can be used to identify which parts of your Java program are lacking test coverage. It is based on jcoverage. http://cobertura.github.io/cobertura/