Search in sources :

Example 11 with DataPolicy

use of org.apache.geode.cache.DataPolicy in project geode by apache.

the class Fakes method region.

/**
   * A fake region, which contains a fake cache and some other fake attributes
   */
public static Region region(String name, Cache cache) {
    Region region = mock(Region.class);
    RegionAttributes attributes = mock(RegionAttributes.class);
    DataPolicy policy = mock(DataPolicy.class);
    when(region.getAttributes()).thenReturn(attributes);
    when(attributes.getDataPolicy()).thenReturn(policy);
    when(region.getCache()).thenReturn(cache);
    when(region.getRegionService()).thenReturn(cache);
    return region;
}
Also used : RegionAttributes(org.apache.geode.cache.RegionAttributes) Region(org.apache.geode.cache.Region) DataPolicy(org.apache.geode.cache.DataPolicy)

Aggregations

DataPolicy (org.apache.geode.cache.DataPolicy)11 Region (org.apache.geode.cache.Region)6 RegionAttributes (org.apache.geode.cache.RegionAttributes)4 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)4 AttributesFactory (org.apache.geode.cache.AttributesFactory)3 CacheException (org.apache.geode.cache.CacheException)3 EntryNotFoundException (org.apache.geode.cache.EntryNotFoundException)3 Scope (org.apache.geode.cache.Scope)3 SubscriptionAttributes (org.apache.geode.cache.SubscriptionAttributes)3 LocalRegion (org.apache.geode.internal.cache.LocalRegion)3 Host (org.apache.geode.test.dunit.Host)3 VM (org.apache.geode.test.dunit.VM)3 HashSet (java.util.HashSet)2 LogWriter (org.apache.geode.LogWriter)2 CacheListener (org.apache.geode.cache.CacheListener)2 CacheLoader (org.apache.geode.cache.CacheLoader)2 InternalCache (org.apache.geode.internal.cache.InternalCache)2 RegionEntry (org.apache.geode.internal.cache.RegionEntry)2 StoredObject (org.apache.geode.internal.offheap.StoredObject)2 AsyncInvocation (org.apache.geode.test.dunit.AsyncInvocation)2