use of com.hazelcast.map.impl.querycache.NodeQueryCacheContextTest.QuerySchedulerRepetitionTask in project hazelcast by hazelcast.
the class ClientQueryCacheContextTest method testGetQueryCacheScheduler.
@Test
public void testGetQueryCacheScheduler() {
QueryCacheScheduler scheduler = context.getQueryCacheScheduler();
assertNotNull(scheduler);
final QuerySchedulerTask task = new QuerySchedulerTask();
scheduler.execute(task);
final QuerySchedulerRepetitionTask repetitionTask = new QuerySchedulerRepetitionTask();
scheduler.scheduleWithRepetition(repetitionTask, 1);
assertTrueEventually(new AssertTask() {
@Override
public void run() throws Exception {
assertTrue(task.executed);
assertTrue(repetitionTask.counter.get() > 1);
}
});
scheduler.shutdown();
}
Aggregations