use of com.birbit.android.jobqueue.RunningJobSet in project android-priority-jobqueue by yigit.
the class RunningJobSetTest method testAddSameGroupTwiceWithTimeout.
@Test
public void testAddSameGroupTwiceWithTimeout() {
MockTimer timer = new MockTimer();
set = new RunningJobSet(timer);
set.addGroupUntil("g1", 10L);
set.addGroupUntil("g1", 12L);
timer.setNow(5);
assertList("g1");
timer.setNow(11);
assertList("g1");
timer.setNow(13);
assertList();
}
use of com.birbit.android.jobqueue.RunningJobSet in project android-priority-jobqueue by yigit.
the class RunningJobSetTest method testAddWithTimeout.
@Test
public void testAddWithTimeout() {
MockTimer timer = new MockTimer();
set = new RunningJobSet(timer);
set.addGroupUntil("g1", 10L);
timer.setNow(5);
assertList("g1");
timer.setNow(11);
assertList();
timer.setNow(3);
// should've pruned the list
assertList();
}
use of com.birbit.android.jobqueue.RunningJobSet in project android-priority-jobqueue by yigit.
the class RunningJobSetTest method testAddMultipleGroupTimeouts.
@Test
public void testAddMultipleGroupTimeouts() {
MockTimer timer = new MockTimer();
set = new RunningJobSet(timer);
set.addGroupUntil("g1", 10L);
set.addGroupUntil("g2", 20L);
timer.setNow(5);
assertList("g1", "g2");
timer.setNow(11);
assertList("g2");
timer.setNow(21);
assertList();
}
Aggregations