RegionMapCommitPut extends AbstractRegionMapPut { boolean isInvokeCallbacks() { return invokeCallbacks; } RegionMapCommitPut(FocusedRegionMap focusedRegionMap, InternalRegion owner,
      @Released EntryEventImpl callbackEvent, Operation putOp, boolean didDestroy,
      TransactionId txId, TXRmtEvent txEvent, List<EntryEventImpl> pendingCallbacks,
      TXEntryState txEntryState);   }
@Test public void uninitializedNonPartitionedRegionDoesNotInvokeCallbacks() { when(internalRegion.shouldDispatchListenerEvent()).thenReturn(true); when(internalRegion.shouldNotifyBridgeClients()).thenReturn(true); when(internalRegion.getConcurrencyChecksEnabled()).thenReturn(true); createInstance(Operation.CREATE, false, null, localTxEntryState); assertThat(instance.isInvokeCallbacks()).isFalse(); }
@Test public void uninitializedPartitionedRegionDoesNotInvokeCallbacks() { when(internalRegion.isUsedForPartitionedRegionBucket()).thenReturn(true); when(internalRegion.getPartitionedRegion()).thenReturn(mock(LocalRegion.class)); createInstance(Operation.CREATE, false, null, localTxEntryState); assertThat(instance.isInvokeCallbacks()).isFalse(); }
@Test public void initializedNonPartitionedRegionWithFalseAttributesDoesNotInvokeCallbacks() { when(internalRegion.isInitialized()).thenReturn(true); createInstance(Operation.CREATE, false, null, localTxEntryState); assertThat(instance.isInvokeCallbacks()).isFalse(); }
@Test public void initializedNonPartitionedRegionWithShouldDispatchListenerEventDoesInvokeCallbacks() { when(internalRegion.isInitialized()).thenReturn(true); when(internalRegion.shouldDispatchListenerEvent()).thenReturn(true); createInstance(Operation.CREATE, false, null, localTxEntryState); assertThat(instance.isInvokeCallbacks()).isTrue(); }
@Test public void initializedNonPartitionedRegionWithShouldNotifyBridgeClientsDoesInvokeCallbacks() { when(internalRegion.isInitialized()).thenReturn(true); when(internalRegion.shouldNotifyBridgeClients()).thenReturn(true); createInstance(Operation.CREATE, false, null, localTxEntryState); assertThat(instance.isInvokeCallbacks()).isTrue(); }
@Test public void initializedNonPartitionedRegionWithConcurrencyChecksEnabledDoesInvokeCallbacks() { when(internalRegion.isInitialized()).thenReturn(true); when(internalRegion.getConcurrencyChecksEnabled()).thenReturn(true); createInstance(Operation.CREATE, false, null, localTxEntryState); assertThat(instance.isInvokeCallbacks()).isTrue(); }
@Test public void uninitializedPartitionedRegionWithFalseAttributesDoesNotInvokeCallbacks() { when(internalRegion.isUsedForPartitionedRegionBucket()).thenReturn(true); when(internalRegion.getPartitionedRegion()).thenReturn(mock(LocalRegion.class)); createInstance(Operation.CREATE, false, null, localTxEntryState); assertThat(instance.isInvokeCallbacks()).isFalse(); }
@Test public void uninitializedPartitionedRegionWithShouldDispatchListenerEventDoesInvokeCallbacks() { when(internalRegion.isUsedForPartitionedRegionBucket()).thenReturn(true); LocalRegion partitionedRegion = mock(LocalRegion.class); when(internalRegion.getPartitionedRegion()).thenReturn(partitionedRegion); when(partitionedRegion.shouldDispatchListenerEvent()).thenReturn(true); createInstance(Operation.CREATE, false, null, localTxEntryState); assertThat(instance.isInvokeCallbacks()).isTrue(); }
@Test public void uninitializedPartitionedRegionWithShouldNotifyBridgeClientsDoesInvokeCallbacks() { when(internalRegion.isUsedForPartitionedRegionBucket()).thenReturn(true); LocalRegion partitionedRegion = mock(LocalRegion.class); when(internalRegion.getPartitionedRegion()).thenReturn(partitionedRegion); when(partitionedRegion.shouldNotifyBridgeClients()).thenReturn(true); createInstance(Operation.CREATE, false, null, localTxEntryState); assertThat(instance.isInvokeCallbacks()).isTrue(); }
@Test public void uninitializedPartitionedRegionWithConcurrencyChecksEnabledDoesInvokeCallbacks() { when(internalRegion.isUsedForPartitionedRegionBucket()).thenReturn(true); LocalRegion partitionedRegion = mock(LocalRegion.class); when(internalRegion.getPartitionedRegion()).thenReturn(partitionedRegion); when(partitionedRegion.getConcurrencyChecksEnabled()).thenReturn(true); createInstance(Operation.CREATE, false, null, localTxEntryState); assertThat(instance.isInvokeCallbacks()).isTrue(); }