Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapProxySupport's loadInternal method requires dataKeys #7090

Closed
hasancelik opened this issue Dec 17, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@hasancelik
Copy link
Contributor

commented Dec 17, 2015

I found this bug when i was trying to increase code coverage of NearCachedMapProxyImpl. Line that test calls map.loadAll threw ClassCastException due to NearCachedMapProxyImpl's invalidateCache.

Test is not directly related to bug it calls problematic methods.

    @Test
    public void testAfterLoadInvalidateNearCache() {
        int mapSize = 100;
        String mapName = "testLoad";

        Config config = createNearCachedMapConfig(mapName);
        MapStoreTest.SimpleMapStore store = new MapStoreTest.SimpleMapStore();
        MapStoreConfig mapStoreConfig = new MapStoreConfig();
        mapStoreConfig.setEnabled(true);
        mapStoreConfig.setImplementation(store3);
        config.getMapConfig(mapName).setMapStoreConfig(mapStoreConfig);

        HazelcastInstance instance = createHazelcastInstance(config);

        IMap<Integer, Integer> map = instance.getMap(mapName);
        HashSet<Integer> keys = new HashSet<Integer>();
        for (int i = 0; i < mapSize; i++) {
            map.put(i, i);
            keys.add(i);
        }

        for (int i = 0; i < mapSize; i++) {
            map.get(i);
        }

        map.loadAll(keys, true);

        NearCacheStats nearCacheStats = map.getLocalMapStats().getNearCacheStats();
        assertEquals(0, nearCacheStats.getOwnedEntryCount());
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.