use of com.hazelcast.instance.impl.HazelcastInstanceProxy in project hazelcast by hazelcast.
the class IndexCreateTest method checkIndex.
private void checkIndex(IndexConfig... indexConfigs) {
List<HazelcastInstanceProxy> members = handler.initialize(hazelcastFactory, indexConfigs);
for (HazelcastInstanceProxy member : members) {
MapService service = member.getOriginal().node.nodeEngine.getService(MapService.SERVICE_NAME);
MapServiceContext mapServiceContext = service.getMapServiceContext();
MapContainer mapContainer = mapServiceContext.getMapContainer(MAP_NAME);
Indexes indexes = mapContainer.getIndexes();
assertEquals(indexConfigs.length, indexes.getIndexes().length);
for (IndexConfig indexConfig : indexConfigs) {
String expectedName = getExpectedName(indexConfig);
InternalIndex index = indexes.getIndex(expectedName);
assertNotNull("Index not found: " + expectedName, index);
assertEquals(type == IndexType.SORTED, index.isOrdered());
assertEquals(type, index.getConfig().getType());
assertEquals(indexConfig.getAttributes().size(), index.getComponents().length);
for (int i = 0; i < indexConfig.getAttributes().size(); i++) {
String expAttributeName = indexConfig.getAttributes().get(i);
String componentName = index.getComponents()[i];
assertEquals(IndexUtils.canonicalizeAttribute(expAttributeName), componentName);
}
}
}
}
Aggregations