[geode] branch feature/GEODE-5624 updated: wip.

2018-08-27 Thread eshu11
This is an automated email from the ASF dual-hosted git repository.

eshu11 pushed a commit to branch feature/GEODE-5624
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-5624 by this 
push:
 new 8e85388  wip.
8e85388 is described below

commit 8e85388d62d6a1996faf2eebb43119796439803f
Author: eshu 
AuthorDate: Mon Aug 27 14:26:57 2018 -0700

wip.
---
 .../src/main/java/org/apache/geode/internal/cache/TXState.java  | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
index 9be7f39..5263e2e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
@@ -878,7 +878,7 @@ public class TXState implements TXStateInterface {
 }
   }
 
-  protected void doCleanup() {
+  void doCleanup() {
 IllegalArgumentException iae = null;
 try {
   this.closed = true;
@@ -1029,6 +1029,7 @@ public class TXState implements TXStateInterface {
*/
   @Override
   public synchronized void beforeCompletion() throws 
SynchronizationCommitConflictException {
+proxy.getTxMgr().setTXState(null);
 if (this.closed) {
   throw new TXManagerCancelledException();
 }
@@ -1051,7 +1052,6 @@ public class TXState implements TXStateInterface {
   }
 
   void doBeforeCompletion() {
-proxy.getTxMgr().setTXState(null);
 final long opStart = CachePerfStats.getStatTime();
 this.jtaLifeTime = opStart - getBeginTime();
 
@@ -1131,7 +1131,6 @@ public class TXState implements TXStateInterface {
   Assert.assertTrue(this.locks != null,
   "Gemfire Transaction afterCompletion called with illegal 
state.");
   try {
-proxy.getTxMgr().setTXState(null);
 commit();
 saveTXCommitMessageForClientFailover();
   } catch (CommitConflictException error) {
@@ -1144,7 +1143,6 @@ public class TXState implements TXStateInterface {
   break;
 case Status.STATUS_ROLLEDBACK:
   this.jtaLifeTime = opStart - getBeginTime();
-  this.proxy.getTxMgr().setTXState(null);
   rollback();
   saveTXCommitMessageForClientFailover();
   this.proxy.getTxMgr().noteRollbackSuccess(opStart, this.jtaLifeTime, 
this);



[geode] branch feature/GEODE-5624 updated: wip.

2018-08-27 Thread eshu11
This is an automated email from the ASF dual-hosted git repository.

eshu11 pushed a commit to branch feature/GEODE-5624
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-5624 by this 
push:
 new e74c940  wip.
e74c940 is described below

commit e74c940c428e2455dc0b93006e57428f3a12c924
Author: eshu 
AuthorDate: Mon Aug 27 13:59:21 2018 -0700

wip.
---
 .../src/main/java/org/apache/geode/internal/cache/TXState.java   | 4 ++--
 .../src/test/java/org/apache/geode/internal/cache/TXStateTest.java   | 5 -
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java 
b/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
index d0063a6..9be7f39 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
@@ -1042,11 +1042,11 @@ public class TXState implements TXStateInterface {
 getExecutor(), getCancelCriterion());
   }
 
-  Executor getExecutor() {
+  private Executor getExecutor() {
 return getCache().getDistributionManager().getWaitingThreadPool();
   }
 
-  CancelCriterion getCancelCriterion() {
+  private CancelCriterion getCancelCriterion() {
 return getCache().getCancelCriterion();
   }
 
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/TXStateTest.java 
b/geode-core/src/test/java/org/apache/geode/internal/cache/TXStateTest.java
index c1e9acf..21fadf0 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/TXStateTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/TXStateTest.java
@@ -27,8 +27,6 @@ import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
-import java.util.concurrent.Executor;
-
 import javax.transaction.Status;
 
 import org.junit.Before;
@@ -56,7 +54,6 @@ public class TXStateTest {
   @Test
   public void doBeforeCompletionThrowsIfReserveAndCheckFails() {
 TXState txState = spy(new TXState(txStateProxy, true));
-doReturn(mock(Executor.class)).when(txState).getExecutor();
 doThrow(exception).when(txState).reserveAndCheck();
 
 assertThatThrownBy(() -> txState.doBeforeCompletion())
@@ -66,7 +63,6 @@ public class TXStateTest {
   @Test
   public void doAfterCompletionThrowsIfCommitFails() {
 TXState txState = spy(new TXState(txStateProxy, true));
-doReturn(mock(InternalCache.class)).when(txState).getCache();
 doReturn(true).when(txState).wasBeforeCompletionCalled();
 txState.reserveAndCheck();
 doThrow(transactionDataNodeHasDepartedException).when(txState).commit();
@@ -78,7 +74,6 @@ public class TXStateTest {
   @Test
   public void doAfterCompletionCanCommitJTA() {
 TXState txState = spy(new TXState(txStateProxy, false));
-doReturn(mock(InternalCache.class)).when(txState).getCache();
 txState.reserveAndCheck();
 txState.closed = true;
 doReturn(true).when(txState).wasBeforeCompletionCalled();



[geode] branch feature/GEODE-5624 updated: wip.

2018-08-27 Thread eshu11
This is an automated email from the ASF dual-hosted git repository.

eshu11 pushed a commit to branch feature/GEODE-5624
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-5624 by this 
push:
 new c19decb  wip.
c19decb is described below

commit c19decb1e2ea05b7b40a265f01afc3e2f237b167
Author: eshu 
AuthorDate: Mon Aug 27 13:51:39 2018 -0700

wip.
---
 .../geode/internal/jta/ClientServerJTAFailoverDistributedTest.java | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/ClientServerJTAFailoverDistributedTest.java
 
b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/ClientServerJTAFailoverDistributedTest.java
index d518153..5d60b6b 100644
--- 
a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/ClientServerJTAFailoverDistributedTest.java
+++ 
b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/ClientServerJTAFailoverDistributedTest.java
@@ -192,9 +192,9 @@ public class ClientServerJTAFailoverDistributedTest 
implements Serializable {
 TXManagerImpl txManager = (TXManagerImpl) 
cache.getCacheTransactionManager();
 txManager.begin();
 region.put(key, newValue);
-if (hasReplicateRegion)
+if (hasReplicateRegion) {
   replicateRegion.put(key, newValue);
-
+}
 TXStateProxyImpl txStateProxy = (TXStateProxyImpl) txManager.getTXState();
 ClientTXStateStub clientTXStateStub = (ClientTXStateStub) 
txStateProxy.getRealDeal(null, null);
 clientTXStateStub.beforeCompletion();
@@ -223,8 +223,9 @@ public class ClientServerJTAFailoverDistributedTest 
implements Serializable {
 }
 if (isCommit) {
   assertEquals(newValue, region.get(key));
-  if (hasReplicateRegion)
+  if (hasReplicateRegion) {
 assertEquals(newValue, replicateRegion.get(key));
+  }
 } else {
   assertEquals(value, region.get(key));
 }