X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FThreePhaseCommitCohortProxyTest.java;h=992518e100a0381ab4c915128cc7975510bed2fc;hp=af3da575714c57d3b39786313a089d63d6419615;hb=0eb621d29daaf08979c356e2148e99c48458e169;hpb=a2b92b2d72c28b9913131c0340f87d2424f44108 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxyTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxyTest.java index af3da57571..992518e100 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxyTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxyTest.java @@ -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 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 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 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 future = proxy.commit();