use of com.hazelcast.map.impl.record.AbstractRecord in project hazelcast by hazelcast.
the class LazyEntryViewFromRecordTest method createDefaultEntryView.
/**
* Returns an entry-view instance populated with default values of fields.
*/
private EntryView createDefaultEntryView() {
PartitioningStrategy mockPartitioningStrategy = mock(PartitioningStrategy.class);
MapConfig mapConfig = new MapConfig();
serializationService = new DefaultSerializationServiceBuilder().build();
DataRecordFactory dataRecordFactory = new DataRecordFactory(mapConfig, serializationService, mockPartitioningStrategy);
recordInstance = dataRecordFactory.newRecord(value);
((AbstractRecord) recordInstance).setKey(serializationService.toData(key));
return new LazyEntryViewFromRecord(recordInstance, serializationService);
}
use of com.hazelcast.map.impl.record.AbstractRecord in project hazelcast by hazelcast.
the class IndexTest method testRemoveEnumIndex.
@Test
public void testRemoveEnumIndex() {
Indexes is = new Indexes(ss, Extractors.empty());
is.addOrGetIndex("favoriteCity", false);
Data key = ss.toData(1);
Data value = ss.toData(new SerializableWithEnum(SerializableWithEnum.City.ISTANBUL));
is.saveEntryIndex(new QueryEntry(ss, key, value, Extractors.empty()), null);
assertNotNull(is.getIndex("favoriteCity"));
Record record = recordFactory.newRecord(value);
((AbstractRecord) record).setKey(key);
is.removeEntryIndex(key, Records.getValueOrCachedValue(record, ss));
assertEquals(0, is.getIndex("favoriteCity").getRecords(SerializableWithEnum.City.ISTANBUL).size());
}
Aggregations