private PartitionAttributes initializeAttributes(final Cache cache) { PartitionAttributes partitionAttributes = mock(PartitionAttributes.class); RegionAttributes attributes = mock(RegionAttributes.class); when(attributes.getCacheListeners()).thenReturn(new CacheListener[0]); when(attributes.getRegionTimeToLive()).thenReturn(ExpirationAttributes.DEFAULT); when(attributes.getRegionIdleTimeout()).thenReturn(ExpirationAttributes.DEFAULT); when(attributes.getEntryTimeToLive()).thenReturn(ExpirationAttributes.DEFAULT); when(attributes.getEntryIdleTimeout()).thenReturn(ExpirationAttributes.DEFAULT); when(attributes.getMembershipAttributes()).thenReturn(new MembershipAttributes()); when(cache.getRegionAttributes(RegionShortcut.PARTITION.toString())).thenReturn(attributes); when(partitionAttributes.getTotalNumBuckets()).thenReturn(113); return partitionAttributes; }
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; }
"Entry value is a " + myEntry.getValue().getClass().getName()); RegionAttributesCreation myAttrs = (RegionAttributesCreation) myEntry.getValue(); RegionAttributes<Object, Object> otherAttrs = other.getRegionAttributes(myId); if (otherAttrs == null) { getLogger().fine("No attributes for " + myId);
cache.getRegionAttributes(configuration.getRegionAttributesId()); if (baseRequestedAttributes == null) { throw new IllegalArgumentException(
RegionAttributes parent = cache.getRegionAttributes(this.refid); if (parent == null) { throw new IllegalStateException(
cache.getRegionAttributes(configuration.getRegionAttributesId()); if (baseRequestedAttributes == null) { throw new IllegalArgumentException(