@Test public void doPostPutAllCallsCheckReadinessBeforeAndAfter() throws Exception { DistributedPutAllOperation distributedPutAllOperation = mock(DistributedPutAllOperation.class); InternalDataView internalDataView = mock(InternalDataView.class); when(bucketRegion.getDataView()).thenReturn(internalDataView); PutAllPRMessage putAllPRMessage = new PutAllPRMessage(); putAllPRMessage.doPostPutAll(partitionedRegion, distributedPutAllOperation, bucketRegion, true); InOrder inOrder = inOrder(partitionedRegion, internalDataView); inOrder.verify(partitionedRegion).checkReadiness(); inOrder.verify(internalDataView).postPutAll(any(), any(), any()); inOrder.verify(partitionedRegion).checkReadiness(); }
@Test public void doPostRemoveAllCallsCheckReadinessBeforeAndAfter() throws Exception { DistributedRemoveAllOperation distributedRemoveAllOperation = mock(DistributedRemoveAllOperation.class); InternalDataView internalDataView = mock(InternalDataView.class); when(bucketRegion.getDataView()).thenReturn(internalDataView); RemoveAllPRMessage removeAllPRMessage = new RemoveAllPRMessage(); removeAllPRMessage.doPostRemoveAll(partitionedRegion, distributedRemoveAllOperation, bucketRegion, true); InOrder inOrder = inOrder(partitionedRegion, internalDataView); inOrder.verify(partitionedRegion).checkReadiness(); inOrder.verify(internalDataView).postRemoveAll(any(), any(), any()); inOrder.verify(partitionedRegion).checkReadiness(); }
void doPostRemoveAll(PartitionedRegion r, DistributedRemoveAllOperation op, BucketRegion bucketRegion, boolean lockedForPrimary) { try { // Only RemoveAllPRMessage knows if the thread id is fake. Event has no idea. // So we have to manually set useFakeEventId for this op op.setUseFakeEventId(true); r.checkReadiness(); bucketRegion.getDataView().postRemoveAll(op, this.versions, bucketRegion); r.checkReadiness(); } finally { if (lockedForPrimary) { bucketRegion.doUnlockForPrimary(); } } }
void doPostPutAll(PartitionedRegion r, DistributedPutAllOperation dpao, BucketRegion bucketRegion, boolean lockedForPrimary) { try { // Only PutAllPRMessage knows if the thread id is fake. Event has no idea. // So we have to manually set useFakeEventId for this DPAO dpao.setUseFakeEventId(true); r.checkReadiness(); bucketRegion.getDataView().postPutAll(dpao, this.versions, bucketRegion); r.checkReadiness(); } finally { if (lockedForPrimary) { bucketRegion.doUnlockForPrimary(); } } }