void setGeneratedVersionTag(boolean generateVersionTag) { // there is at-least one other persistent member, so turn on concurrencyChecks enableConcurrencyChecks(); this.generateVersionTag = generateVersionTag; }
protected DistributedRegion prepare(boolean isConcurrencyChecksEnabled) { GemFireCacheImpl cache = Fakes.cache(); // create region attributes and internal region arguments RegionAttributes ra = createRegionAttributes(isConcurrencyChecksEnabled); InternalRegionArguments ira = new InternalRegionArguments(); // create a region object DistributedRegion region = createAndDefineRegion(isConcurrencyChecksEnabled, ra, ira, cache); if (isConcurrencyChecksEnabled) { region.enableConcurrencyChecks(); } doNothing().when(region).notifyGatewaySender(any(), any()); doReturn(true).when(region).hasSeenEvent(any(EntryEventImpl.class)); return region; }
protected DistributedRegion createAndDefineRegion(boolean isConcurrencyChecksEnabled, RegionAttributes ra, InternalRegionArguments ira, GemFireCacheImpl cache) { DistributedRegion region = new DistributedRegion("testRegion", ra, null, cache, ira); if (isConcurrencyChecksEnabled) { region.enableConcurrencyChecks(); } // since it is a real region object, we need to tell mockito to monitor it region = spy(region); doNothing().when(region).distributeUpdate(any(), anyLong(), anyBoolean(), anyBoolean(), any(), anyBoolean()); doNothing().when(region).distributeDestroy(any(), any()); doNothing().when(region).distributeInvalidate(any()); doNothing().when(region).distributeUpdateEntryVersion(any()); return region; }
@Override protected DistributedRegion createAndDefineRegion(boolean isConcurrencyChecksEnabled, RegionAttributes ra, InternalRegionArguments ira, GemFireCacheImpl cache) { DistributedRegion region = new DistributedRegion("testRegion", ra, null, cache, ira); if (isConcurrencyChecksEnabled) { region.enableConcurrencyChecks(); } // since it is a real region object, we need to tell mockito to monitor it region = spy(region); doNothing().when(region).distributeUpdate(any(), anyLong(), anyBoolean(), anyBoolean(), any(), anyBoolean()); doNothing().when(region).distributeDestroy(any(), any()); doNothing().when(region).distributeInvalidate(any()); doNothing().when(region).distributeUpdateEntryVersion(any()); return region; }
protected DistributedRegion prepare(boolean isConcurrencyChecksEnabled, boolean testHasSeenEvent) { GemFireCacheImpl cache = Fakes.cache(); // create region attributes and internal region arguments RegionAttributes ra = createRegionAttributes(isConcurrencyChecksEnabled); InternalRegionArguments ira = new InternalRegionArguments(); setInternalRegionArguments(ira); // create a region object DistributedRegion region = createAndDefineRegion(isConcurrencyChecksEnabled, ra, ira, cache); if (isConcurrencyChecksEnabled) { region.enableConcurrencyChecks(); } doNothing().when(region).notifyGatewaySender(any(), any()); if (!testHasSeenEvent) { doReturn(true).when(region).hasSeenEvent(any(EntryEventImpl.class)); } return region; }