@Test(timeout = 120000)
  public void testMapCreation__notAffectedByUnresponsiveLoader() throws Exception {
    final UnresponsiveLoader unresponsiveLoader = new UnresponsiveLoader<Integer, Integer>();
    final IMap map =
        TestMapUsingMapStoreBuilder.create()
            .withMapStore(unresponsiveLoader)
            .withNodeCount(1)
            .withNodeFactory(createHazelcastInstanceFactory(1))
            .withPartitionCount(1)
            .build();

    final LocalMapStats stats = map.getLocalMapStats();
    final long ownedEntryCount = stats.getOwnedEntryCount();

    assertEquals(0, ownedEntryCount);
  }
Ejemplo n.º 2
0
 @Test(timeout = 120000)
 public void issue614() {
   final ConcurrentMap<Long, String> STORE = new ConcurrentHashMap<Long, String>();
   STORE.put(1l, "Event1");
   STORE.put(2l, "Event2");
   STORE.put(3l, "Event3");
   STORE.put(4l, "Event4");
   STORE.put(5l, "Event5");
   STORE.put(6l, "Event6");
   Config config = getConfig();
   config
       .getMapConfig("map")
       .setMapStoreConfig(
           new MapStoreConfig()
               .setWriteDelaySeconds(1)
               .setImplementation(new SimpleMapStore<Long, String>(STORE)));
   TestHazelcastInstanceFactory nodeFactory = createHazelcastInstanceFactory(3);
   HazelcastInstance h = nodeFactory.newHazelcastInstance(config);
   IMap map = h.getMap("map");
   Collection collection = map.values();
   LocalMapStats localMapStats = map.getLocalMapStats();
   assertEquals(0, localMapStats.getDirtyEntryCount());
 }