use of com.tangosol.net.BackingMapContext in project micronaut-coherence by micronaut-projects.
the class ExtractorFactoriesTest method setup.
@BeforeEach
void setup() {
phoneNumber = new PhoneNumber(44, "04242424242");
person = new Person("Arthur", "Dent", LocalDate.of(1978, 3, 8), phoneNumber);
binaryKey = ExternalizableHelper.toBinary("AD", pofContext);
binaryPerson = ExternalizableHelper.toBinary(person, pofContext);
BackingMapContext ctx = mock(BackingMapContext.class);
Map<ValueExtractor, MapIndex> index = new HashMap<>();
when(ctx.getIndexMap()).thenReturn(index);
entry = new BackingMapBinaryEntry(binaryKey, binaryPerson, binaryPerson, null) {
@Override
public Object getKey() {
return "AD";
}
@Override
public Object getValue() {
return person;
}
@Override
public BackingMapContext getBackingMapContext() {
return ctx;
}
@Override
public Serializer getSerializer() {
return pofContext;
}
};
}
use of com.tangosol.net.BackingMapContext in project coherence-spring by coherence-community.
the class ExtractorConfigurationTests method setup.
@BeforeEach
void setup() {
this.phoneNumber = new PhoneNumber(44, "04242424242");
this.person = new Person("Arthur", "Dent", LocalDate.of(1978, 3, 8), this.phoneNumber);
this.binaryKey = ExternalizableHelper.toBinary("AD", this.pofContext);
this.binaryPerson = ExternalizableHelper.toBinary(this.person, this.pofContext);
BackingMapContext ctx = mock(BackingMapContext.class);
Map<ValueExtractor, MapIndex> index = new HashMap<>();
when(ctx.getIndexMap()).thenReturn(index);
this.entry = new BackingMapBinaryEntry(this.binaryKey, this.binaryPerson, this.binaryPerson, null) {
@Override
public Object getKey() {
return "AD";
}
@Override
public Object getValue() {
return ExtractorConfigurationTests.this.person;
}
@Override
public BackingMapContext getBackingMapContext() {
return ctx;
}
@Override
public Serializer getSerializer() {
return ExtractorConfigurationTests.this.pofContext;
}
};
}
use of com.tangosol.net.BackingMapContext in project coherence-spring by coherence-community.
the class NamespaceHandlerTest method getCacheStore.
Object getCacheStore(String cacheName) {
NamedCache<Object, Object> cache = this.eccf.ensureCache(cacheName, null);
BackingMapManager manager = cache.getCacheService().getBackingMapManager();
BackingMapManagerContext context = manager.getContext();
BackingMapContext backingMapContext = context.getBackingMapContext(cache.getCacheName());
ReadWriteBackingMap backingMap = (ReadWriteBackingMap) backingMapContext.getBackingMap();
ReadWriteBackingMap.StoreWrapper cacheStore = backingMap.getCacheStore();
return cacheStore.getStore();
}
Aggregations