Search in sources :

Example 1 with BatchingScheduler

use of com.birbit.android.jobqueue.BatchingScheduler in project android-priority-jobqueue by yigit.

the class BatchingSchedulerTest method testCustomDuration.

@Test
public void testCustomDuration() {
    scheduler = mock(Scheduler.class);
    timer = new MockTimer();
    bs = new BatchingScheduler(scheduler, timer, 123);
    MatcherAssert.assertThat(bs.batchingDurationInMs, CoreMatchers.is(123L));
    MatcherAssert.assertThat(bs.batchingDurationInNs, CoreMatchers.is(123000000L));
}
Also used : MockTimer(com.birbit.android.jobqueue.test.timer.MockTimer) BatchingScheduler(com.birbit.android.jobqueue.BatchingScheduler) Scheduler(com.birbit.android.jobqueue.scheduling.Scheduler) BatchingScheduler(com.birbit.android.jobqueue.BatchingScheduler) Test(org.junit.Test)

Example 2 with BatchingScheduler

use of com.birbit.android.jobqueue.BatchingScheduler in project android-priority-jobqueue by yigit.

the class BatchingSchedulerTest method init.

@Before
public void init() {
    scheduler = mock(Scheduler.class);
    timer = new MockTimer();
    bs = new BatchingScheduler(scheduler, timer);
    Context context = mock(Context.class);
    when(context.getApplicationContext()).thenReturn(mock(Context.class));
    bs.init(context, mock(Scheduler.Callback.class));
}
Also used : Context(android.content.Context) MockTimer(com.birbit.android.jobqueue.test.timer.MockTimer) BatchingScheduler(com.birbit.android.jobqueue.BatchingScheduler) Scheduler(com.birbit.android.jobqueue.scheduling.Scheduler) BatchingScheduler(com.birbit.android.jobqueue.BatchingScheduler) Before(org.junit.Before)

Aggregations

BatchingScheduler (com.birbit.android.jobqueue.BatchingScheduler)2 Scheduler (com.birbit.android.jobqueue.scheduling.Scheduler)2 MockTimer (com.birbit.android.jobqueue.test.timer.MockTimer)2 Context (android.content.Context)1 Before (org.junit.Before)1 Test (org.junit.Test)1