[
https://issues.apache.org/jira/browse/GEODE-8797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17275268#comment-17275268
]
ASF GitHub Bot commented on GEODE-8797:
---------------------------------------
pivotal-eshu commented on a change in pull request #5901:
URL: https://github.com/apache/geode/pull/5901#discussion_r567032550
##########
File path:
geode-core/src/test/java/org/apache/geode/internal/cache/tx/PartitionedTXRegionStubTest.java
##########
@@ -127,6 +129,36 @@ public void
destroyExistingEntryThrowsTransactionDataNodeHasDepartedExceptionIfI
verify(stub, never()).trackBucketForTx(keyInfo);
}
+ @Test
+ public void getEntryForIteratorReturnsEntryGotFromLocal() throws Exception {
+ PartitionedTXRegionStub stub = spy(new
PartitionedTXRegionStub(txStateStub, partitionedRegion));
+ EntrySnapshot entry = mock(EntrySnapshot.class);
+
+ when(event.getRegion()).thenReturn(partitionedRegion);
+ when(partitionedRegion.getBucketPrimary(1))
+ .thenReturn((InternalDistributedMember) remoteTransactionHost);
+ when(partitionedRegion.getEntryRemotely((InternalDistributedMember)
remoteTransactionHost, 1,
+ key, false, true)).thenReturn(entry);
+
+ assertThat(stub.getEntryForIterator(keyInfo, true)).isEqualTo(entry);
+ verify(stub).trackBucketForTx(keyInfo);
+ }
+
+ @Test
+ public void getEntryForIteratorReturnsEntryGotFromRemote() throws Exception {
Review comment:
Similarly getEntryForIteratorReturnsEntryGotFromAnyDataHosts is more
appropriate here.
Also the method does not throw Exception, please remove it to avoid warnings.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Increase code coverage on TXRegionStub classes
> ----------------------------------------------
>
> Key: GEODE-8797
> URL: https://issues.apache.org/jira/browse/GEODE-8797
> Project: Geode
> Issue Type: Test
> Components: transactions
> Reporter: Louis R. Jacome
> Assignee: Louis R. Jacome
> Priority: Major
> Labels: pull-request-available
>
> Need to add more tests to increase code coverage on the following classes
> that implement TXRegionStub:
> * AbstractPeerTXRegionStub
> * BucketTXRegionStub
> * ClientTXRegionStub
> * DistributedTXRegionStub
> * PartitionedTXRegionStub
--
This message was sent by Atlassian Jira
(v8.3.4#803005)