Package com.hazelcast.test

Examples of com.hazelcast.test.AssertTask


        queue.drainTo(list);
        queue.addAll(list);
        queue.removeAll(list);

        final LocalQueueStats stats = queue.getLocalQueueStats();
        AssertTask task = new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(3, stats.getOtherOperationsCount());
            }
        };
View Full Code Here


        loader.preloadValues = true;
        map = getInstance().getMap("testMapLoaderLoadUpdatingIndex");
        assertFalse(map.isEmpty());

        final IMap<Integer, SampleIndexableObject> mapFinal = map;
        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                Set<Entry<Integer, SampleIndexableObject>> result = mapFinal.entrySet(predicate);
                assertEquals(1, result.size());
                assertEquals(5, (int) result.iterator().next().getValue().value);
View Full Code Here

        instance1 = Hazelcast.newHazelcastInstance();

        final EventService eventService1 = TestUtil.getNode(instance1).nodeEngine.getEventService();
        final EventService eventService2 = TestUtil.getNode(instance2).nodeEngine.getEventService();

        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                Collection<EventRegistration> regs1 = eventService1.getRegistrations(MapService.SERVICE_NAME, mapName);
                Collection<EventRegistration> regs2 = eventService2.getRegistrations(MapService.SERVICE_NAME, mapName);
View Full Code Here

    public void testShutdownNow() throws InterruptedException, ExecutionException, TimeoutException {
        final IExecutorService service = client.getExecutorService(randomString());

        service.shutdownNow();

        assertTrueEventually(new AssertTask() {
            public void run() throws Exception {
                assertTrue(service.isShutdown());
            }
        });
    }
View Full Code Here

    public void testShutdownMultipleTimes() throws InterruptedException, ExecutionException, TimeoutException {
        final IExecutorService service = client.getExecutorService(randomString());
        service.shutdownNow();
        service.shutdown();

        assertTrueEventually(new AssertTask() {
            public void run() throws Exception {
                assertTrue(service.isShutdown());
            }
        });
    }
View Full Code Here

    @Test
    public void test_initial_map_load_propagates_exception_to_client() throws Exception {
        final IMap<Integer, Integer> map = client.getMap(mapName);

        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                Exception exception = null;
                try {
                    map.get(1);
View Full Code Here

            }, 1000, TimeUnit.MILLISECONDS);

            Task task = new Task();
            runClient(task, taskCount);

            assertTrueEventually(new AssertTask() {
                @Override
                public void run() throws Exception {
                    final int taskExecutions = COUNTER.get();
                    assertTrue(taskExecutions >= taskCount);
                }
View Full Code Here

        assertEquals(0, clientService.getConnectedClients().size());

        final HazelcastInstance client3 = HazelcastClient.newHazelcastClient();

        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(1, clientService.getConnectedClients().size());
            }
        }, 4);
View Full Code Here

            }, 1000, TimeUnit.MILLISECONDS);

            Task task = new Task();
            runClient(task, taskCount);

            assertTrueEventually(new AssertTask() {
                @Override
                public void run() throws Exception {
                    final int taskExecutions = COUNTER.get();
                    assertTrue(taskExecutions >= taskCount);
                }
View Full Code Here

        final HazelcastInstance restartedInstance = Hazelcast.newHazelcastInstance();

        client.getMap(randomMapName()).size(); // do any operation

        assertOpenEventually(countDownLatch); //wait for clients to reconnect & reAuth
        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(1, restartedInstance.getClientService().getConnectedClients().size());
            }
        });
View Full Code Here

TOP

Related Classes of com.hazelcast.test.AssertTask

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.