use of com.hazelcast.client.map.helpers.AMapStore in project hazelcast by hazelcast.
the class ClientMapStoreTest method testIssue3023_testWithSubStringMapNames.
@Test
public void testIssue3023_testWithSubStringMapNames() {
String mapNameWithStore = "MapStore*";
String mapNameWithStoreAndSize = "MapStoreMaxSize*";
String xml = "<hazelcast xsi:schemaLocation=\"http://www.hazelcast.com/schema/config\n" + " http://www.hazelcast.com/schema/config/hazelcast-config-3.11.xsd\"\n" + " xmlns=\"http://www.hazelcast.com/schema/config\"\n" + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n" + "\n" + " <map name=\"" + mapNameWithStore + "\">\n" + " <map-store enabled=\"true\">\n" + " <class-name>com.will.cause.problem.if.used</class-name>\n" + " <write-delay-seconds>5</write-delay-seconds>\n" + " </map-store>\n" + " </map>\n" + "\n" + " <map name=\"" + mapNameWithStoreAndSize + "\">\n" + " <in-memory-format>BINARY</in-memory-format>\n" + " <backup-count>1</backup-count>\n" + " <async-backup-count>0</async-backup-count>\n" + " <max-idle-seconds>0</max-idle-seconds>\n" + " <eviction size=\"10\" max-size-policy=\"PER_NODE\" eviction-policy=\"LRU\" />\n" + " <merge-policy>PassThroughMergePolicy</merge-policy>\n" + " <map-store enabled=\"true\">\n" + " <class-name>com.hazelcast.client.map.helpers.AMapStore</class-name>\n" + " <write-delay-seconds>5</write-delay-seconds>\n" + " </map-store>\n" + " </map>\n" + "\n" + "</hazelcast>";
Config config = buildConfig(xml);
HazelcastInstance hz = hazelcastFactory.newHazelcastInstance(config);
HazelcastInstance client = hazelcastFactory.newHazelcastClient();
IMap<Integer, Integer> map = client.getMap(mapNameWithStoreAndSize + "1");
map.put(1, 1);
final AMapStore store = getMapStoreInstance(hz, mapNameWithStoreAndSize + "1");
assertTrueEventually(new AssertTask() {
@Override
public void run() {
assertEquals(1, store.store.get(1));
}
});
}
Aggregations