Search in sources :

Example 1 with MapStoreWithCounterPerKey

use of com.hazelcast.simulator.tests.map.helpers.MapStoreWithCounterPerKey in project hazelcast-simulator by hazelcast.

the class MapEvictAndStoreTest method verify.

@Verify(global = false)
public void verify() {
    if (isClient(targetInstance)) {
        return;
    }
    MapConfig mapConfig = targetInstance.getConfig().getMapConfig(name);
    logger.info(name + ": MapConfig: " + mapConfig);
    MapStoreConfig mapStoreConfig = mapConfig.getMapStoreConfig();
    logger.info(name + ": MapStoreConfig: " + mapStoreConfig);
    int sleepSeconds = mapConfig.getTimeToLiveSeconds() * 2 + mapStoreConfig.getWriteDelaySeconds() * 2;
    logger.info("Sleeping for " + sleepSeconds + " seconds to wait for delay and TTL values.");
    sleepSeconds(sleepSeconds);
    MapStoreWithCounterPerKey mapStore = (MapStoreWithCounterPerKey) mapStoreConfig.getImplementation();
    logger.info(name + ": map size = " + map.size());
    logger.info(name + ": map store = " + mapStore);
    logger.info(name + ": Checking if some keys where stored more than once");
    for (Object key : mapStore.keySet()) {
        assertEquals("There were multiple calls to MapStore.store", 1, mapStore.valueOf(key));
    }
}
Also used : MapStoreWithCounterPerKey(com.hazelcast.simulator.tests.map.helpers.MapStoreWithCounterPerKey) MapConfig(com.hazelcast.config.MapConfig) MapStoreConfig(com.hazelcast.config.MapStoreConfig) Verify(com.hazelcast.simulator.test.annotations.Verify)

Aggregations

MapConfig (com.hazelcast.config.MapConfig)1 MapStoreConfig (com.hazelcast.config.MapStoreConfig)1 Verify (com.hazelcast.simulator.test.annotations.Verify)1 MapStoreWithCounterPerKey (com.hazelcast.simulator.tests.map.helpers.MapStoreWithCounterPerKey)1