Merge "BUG-190 Simplify reconnect logic in protocol-framework."
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / ThreePhaseCommitCohortProxyTest.java
index af3da575714c57d3b39786313a089d63d6419615..992518e100a0381ab4c915128cc7975510bed2fc 100644 (file)
@@ -14,6 +14,8 @@ import org.opendaylight.controller.cluster.datastore.utils.MessageCollectorActor
 import org.opendaylight.controller.cluster.datastore.utils.MockActorContext;
 
 import java.util.Arrays;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 import static org.junit.Assert.assertNotNull;
 
@@ -23,6 +25,7 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
     private Props props;
     private ActorRef actorRef;
     private MockActorContext actorContext;
+    private ExecutorService executor = Executors.newSingleThreadExecutor();
 
     @Before
     public void setUp(){
@@ -32,13 +35,13 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
 
         proxy =
             new ThreePhaseCommitCohortProxy(actorContext,
-                Arrays.asList(actorRef.path()));
+                Arrays.asList(actorRef.path()), "txn-1", executor);
 
     }
 
     @Test
     public void testCanCommit() throws Exception {
-        actorContext.setExecuteRemoteOperationResponse(new CanCommitTransactionReply(true));
+        actorContext.setExecuteRemoteOperationResponse(new CanCommitTransactionReply(true).toSerializable());
 
         ListenableFuture<Boolean> future = proxy.canCommit();
 
@@ -48,7 +51,7 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
 
     @Test
     public void testPreCommit() throws Exception {
-        actorContext.setExecuteRemoteOperationResponse(new PreCommitTransactionReply());
+        actorContext.setExecuteRemoteOperationResponse(new PreCommitTransactionReply().toSerializable());
 
         ListenableFuture<Void> future = proxy.preCommit();
 
@@ -58,7 +61,7 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
 
     @Test
     public void testAbort() throws Exception {
-        actorContext.setExecuteRemoteOperationResponse(new AbortTransactionReply());
+        actorContext.setExecuteRemoteOperationResponse(new AbortTransactionReply().toSerializable());
 
         ListenableFuture<Void> future = proxy.abort();
 
@@ -68,7 +71,7 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
 
     @Test
     public void testCommit() throws Exception {
-        actorContext.setExecuteRemoteOperationResponse(new CommitTransactionReply());
+        actorContext.setExecuteRemoteOperationResponse(new CommitTransactionReply().toSerializable());
 
         ListenableFuture<Void> future = proxy.commit();