private void testAllImpl() { for (JobApi api : JobApi.values()) { if (api.isSupported(this)) { JobConfig.forceApi(api); testSimple(); } else { Log.w("Demo", String.format("%s is not supported", api)); } } JobConfig.reset(); }
@After public void tearDown() { JobConfig.reset(); }
@Override protected void after() { mManager.cancelAll(); mManager.destroy(); JobConfig.reset(); }
@Override protected void after() { mManager.cancelAll(); mManager.destroy(); JobConfig.reset(); WorkManager.getInstance().cancelAllWork(); }
@Test @Config(sdk = Build.VERSION_CODES.LOLLIPOP) public void verifyReset() { assertThat(JobConfig.isApiEnabled(JobApi.V_19)).isTrue(); // default JobConfig.setApiEnabled(JobApi.V_19, false); assertThat(JobConfig.isApiEnabled(JobApi.V_19)).isFalse(); // did change assertThat(JobConfig.isAllowSmallerIntervalsForMarshmallow()).isFalse(); // default JobConfig.setAllowSmallerIntervalsForMarshmallow(true); assertThat(JobConfig.isAllowSmallerIntervalsForMarshmallow()).isTrue(); // did change JobConfig.reset(); assertThat(JobConfig.isApiEnabled(JobApi.V_19)).isTrue(); // default assertThat(JobConfig.isAllowSmallerIntervalsForMarshmallow()).isFalse(); // default }
@Override protected void after() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getJobScheduler().cancelAll(); } mManager.cancelAll(); mManager.destroy(); getJobScheduler().cancelAll(); JobConfig.reset(); }