Search in sources :

Example 1 with QuerySchedulerRepetitionTask

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();
}
Also used : QuerySchedulerRepetitionTask(com.hazelcast.map.impl.querycache.NodeQueryCacheContextTest.QuerySchedulerRepetitionTask) QuerySchedulerTask(com.hazelcast.map.impl.querycache.NodeQueryCacheContextTest.QuerySchedulerTask) QueryCacheScheduler(com.hazelcast.map.impl.querycache.QueryCacheScheduler) AssertTask(com.hazelcast.test.AssertTask) ExpectedException(org.junit.rules.ExpectedException) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

QuerySchedulerRepetitionTask (com.hazelcast.map.impl.querycache.NodeQueryCacheContextTest.QuerySchedulerRepetitionTask)1 QuerySchedulerTask (com.hazelcast.map.impl.querycache.NodeQueryCacheContextTest.QuerySchedulerTask)1 QueryCacheScheduler (com.hazelcast.map.impl.querycache.QueryCacheScheduler)1 AssertTask (com.hazelcast.test.AssertTask)1 ParallelTest (com.hazelcast.test.annotation.ParallelTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 Test (org.junit.Test)1 ExpectedException (org.junit.rules.ExpectedException)1