Package com.hazelcast.test

Examples of com.hazelcast.test.AssertTask


            map.remove(key);

            map.put(key, value);
        }

        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(expectedStoreSizeEventually, store.getStore().size());
            }
        });
View Full Code Here


        //check map size after eviction.
        assertEquals(0, map1.size());
        assertEquals(0, map2.size());
        assertEquals(0, map3.size());
        //near cache sizes should be zero after eviction.
        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(0, countNotNullValuesInNearCache(mapName, instance1));
            }
        });
        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(0, countNotNullValuesInNearCache(mapName, instance2));
            }
        });
        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(0, countNotNullValuesInNearCache(mapName, instance3));
            }
        });
View Full Code Here

            invalidationMap.put(i, i);
        }
        map.putAll(invalidationMap); //this should invalidate the near cache

        assertTrueEventually(
                new AssertTask() {
                    @Override
                    public void run() {
                        assertEquals("Invalidation is not working on putAll()", 0, nearCache.size());
                    }
                }
View Full Code Here

    public void testNearCacheMaxSize() {
        final IMap map = client.getMap(randomMapName(NEAR_CACHE_WITH_MAX_SIZE));

        populateNearCache(map, MAX_CACHE_SIZE + 1);

        HazelcastTestSupport.assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                final NearCacheStats stats = map.getLocalMapStats().getNearCacheStats();
                assertTrue(MAX_CACHE_SIZE > stats.getOwnedEntryCount());
            }
View Full Code Here

        sleepSeconds(MAX_TTL_SECONDS + 1);
        // map.put() and map.get() triggers near cache eviction/expiration process
        map.put(0, 0);

        HazelcastTestSupport.assertTrueEventually(new AssertTask() {
            public void run() throws Exception {
                NearCacheStats stats = map.getLocalMapStats().getNearCacheStats();
                long ownedEntryCount = stats.getOwnedEntryCount();
                assertTrue(ownedEntryCount < size);
            }
View Full Code Here

            nodeMap.put(i, i);
        }

        assertEquals(size, OwnedEntryCountBeforeInvalidate);

        assertTrueEventually(new AssertTask() {
            public void run() throws Exception {
                NearCacheStats stats = clientMap.getLocalMapStats().getNearCacheStats();
                assertEquals(0, stats.getOwnedEntryCount());
            }
        });
View Full Code Here

        populateNearCache(map, size);

        h1.getMap(mapName).clear();

        //near cache should be empty
        assertTrueEventually(new AssertTask() {
            public void run() throws Exception {
                for (int i = 0; i < size; i++) {
                    assertNull(map.get(i));
                }
            }
View Full Code Here

        IMap map = client.getMap(mapNameWithStoreAndSize + "1");
        map.put(1, 1);

        final AMapStore store = (AMapStore) (hz.getConfig().getMapConfig(mapNameWithStoreAndSize + "1").getMapStoreConfig().getImplementation());

        assertTrueEventually(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(1, store.store.get(1));
            }
        });
View Full Code Here

        Runnable runnable = new MapPutPartitionAwareRunnable<String>(mapName, key);

        service.submit(runnable);
        final IMap map = client.getMap(mapName);

        assertTrueEventually(new AssertTask() {
            public void run() throws Exception {
                assertTrue(map.containsKey(member.getUuid()));
            }
        });
    }
View Full Code Here

        Future result = service.submit(runnable, expectedResult);
        final IMap map = client.getMap(mapName);

        assertEquals(expectedResult, result.get());
        assertTrueEventually(new AssertTask() {
            public void run() throws Exception {
                assertTrue(map.containsKey(member.getUuid()));
            }
        });
    }
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.