use of com.firebase.jobdispatcher.Job in project sms-backup-plus by jberkel.
the class AlarmManagerDriverTest method testScheduleJobWithExecutionWindowTriggerAndTag.
@Test
public void testScheduleJobWithExecutionWindowTriggerAndTag() throws Exception {
final Job job = jobBuilder().setTag("REGULAR").setTrigger(Trigger.executionWindow(30, 30)).build();
final int result = subject.schedule(job);
assertThat(result).isEqualTo(SCHEDULE_RESULT_SUCCESS);
assertAlarmScheduled("REGULAR");
}
use of com.firebase.jobdispatcher.Job in project sms-backup-plus by jberkel.
the class AlarmManagerDriverTest method testScheduleJobWithoutTrigger.
@Test
public void testScheduleJobWithoutTrigger() throws Exception {
final Job job = jobBuilder().build();
final int result = subject.schedule(job);
assertThat(result).isEqualTo(SCHEDULE_RESULT_SUCCESS);
assertAlarmScheduled("UNKNOWN");
}
use of com.firebase.jobdispatcher.Job in project sms-backup-plus by jberkel.
the class AlarmManagerDriverTest method testScheduleJobWithUnknownTrigger.
@Test
public void testScheduleJobWithUnknownTrigger() throws Exception {
final Job job = jobBuilder().setTrigger(Trigger.contentUriTrigger(Collections.singletonList(new ObservedUri(Uri.parse("foo://bar"), 0)))).build();
final int result = subject.schedule(job);
assertThat(result).isEqualTo(SCHEDULE_RESULT_UNSUPPORTED_TRIGGER);
}
use of com.firebase.jobdispatcher.Job in project sms-backup-plus by jberkel.
the class BackupJobsTest method shouldScheduleRegular.
@Test
public void shouldScheduleRegular() throws Exception {
when(preferences.isAutoBackupEnabled()).thenReturn(true);
when(preferences.getRegularTimeoutSecs()).thenReturn(2000);
Job job = subject.scheduleRegular();
verifyJobScheduled(job, 2000, "REGULAR");
}
use of com.firebase.jobdispatcher.Job in project sms-backup-plus by jberkel.
the class BackupJobsTest method shouldScheduleRegularJobAfterBootForOldScheduler.
@Test
public void shouldScheduleRegularJobAfterBootForOldScheduler() throws Exception {
when(preferences.isAutoBackupEnabled()).thenReturn(true);
when(preferences.isUseOldScheduler()).thenReturn(true);
Job job = subject.scheduleBootup();
verifyJobScheduled(job, 60, "REGULAR");
}
Aggregations