Search in sources :

Example 1 with ExtensionPoint

use of org.apache.geode.internal.cache.extension.ExtensionPoint in project geode by apache.

the class LuceneIndexForPartitionedRegionTest method initializeScenario.

private Region initializeScenario(final boolean withPersistence, final String regionPath, final Cache cache, int localMaxMemory) {
    PartitionedRegion region = mock(PartitionedRegion.class);
    PartitionAttributes partitionAttributes = new PartitionAttributesFactory().setLocalMaxMemory(localMaxMemory).setTotalNumBuckets(103).create();
    RegionAttributes regionAttributes = spy(createRegionAttributes(withPersistence, partitionAttributes));
    ExtensionPoint extensionPoint = mock(ExtensionPoint.class);
    when(cache.getRegion(regionPath)).thenReturn(region);
    when(cache.getRegionAttributes(any())).thenReturn(regionAttributes);
    when(region.getAttributes()).thenReturn(regionAttributes);
    when(regionAttributes.getPartitionAttributes()).thenReturn(partitionAttributes);
    when(region.getPartitionAttributes()).thenReturn(partitionAttributes);
    when(region.getExtensionPoint()).thenReturn(extensionPoint);
    return region;
}
Also used : PartitionAttributesFactory(org.apache.geode.cache.PartitionAttributesFactory) RegionAttributes(org.apache.geode.cache.RegionAttributes) PartitionedRegion(org.apache.geode.internal.cache.PartitionedRegion) ExtensionPoint(org.apache.geode.internal.cache.extension.ExtensionPoint) PartitionAttributes(org.apache.geode.cache.PartitionAttributes)

Aggregations

PartitionAttributes (org.apache.geode.cache.PartitionAttributes)1 PartitionAttributesFactory (org.apache.geode.cache.PartitionAttributesFactory)1 RegionAttributes (org.apache.geode.cache.RegionAttributes)1 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)1 ExtensionPoint (org.apache.geode.internal.cache.extension.ExtensionPoint)1