BUG-5280: remove support for talking to pre-Boron clients
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / ThreePhaseCommitCohortProxyTest.java
index e5db5cbbaf50950c69063d3f43bb8ef3894e87bd..5a87be3d32837714289fc26b6967ce527621ca86 100644 (file)
@@ -48,7 +48,6 @@ import org.opendaylight.controller.cluster.datastore.utils.MockConfiguration;
 import org.opendaylight.controller.cluster.datastore.utils.PrimaryShardInfoFutureCache;
 import org.opendaylight.controller.cluster.raft.TestActorFactory;
 import org.opendaylight.controller.cluster.raft.utils.DoNothingActor;
-import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
 
 public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
 
@@ -258,23 +257,6 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
         verifyCohortActors();
     }
 
-    @Test
-    public void testBackwardsCompatibilityWithPreBoron() throws Exception {
-        List<CohortInfo> cohorts = Arrays.asList(
-                newCohortInfo(new CohortActor.Builder("txn-1").
-                        expectCanCommit(ThreePhaseCommitCohortMessages.CanCommitTransaction.class,
-                                CanCommitTransactionReply.yes(DataStoreVersions.LITHIUM_VERSION)).
-                        expectCommit(ThreePhaseCommitCohortMessages.CommitTransaction.class,
-                                CommitTransactionReply.instance(DataStoreVersions.LITHIUM_VERSION)),
-                        DataStoreVersions.LITHIUM_VERSION));
-        ThreePhaseCommitCohortProxy proxy = new ThreePhaseCommitCohortProxy(actorContext, cohorts, "txn-1");
-
-        verifyCanCommit(proxy.canCommit(), true);
-        verifySuccessfulFuture(proxy.preCommit());
-        verifySuccessfulFuture(proxy.commit());
-        verifyCohortActors();
-    }
-
     private void propagateExecutionExceptionCause(ListenableFuture<?> future) throws Throwable {
 
         try {
@@ -298,7 +280,7 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
         });
     }
 
-    private CohortInfo newCohortInfoWithFailedFuture(Exception failure) {
+    private static CohortInfo newCohortInfoWithFailedFuture(Exception failure) {
         return new CohortInfo(Futures.<ActorSelection>failed(failure), new Supplier<Short>() {
             @Override
             public Short get() {
@@ -345,17 +327,17 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
         @Override
         public void onReceive(Object message) {
             if(CanCommitTransaction.isSerializedType(message)) {
+                canCommitCount.incrementAndGet();
                 onMessage("CanCommitTransaction", message, CanCommitTransaction.fromSerializable(message),
                         builder.expCanCommitType, builder.canCommitReply);
-                canCommitCount.incrementAndGet();
             } else if(CommitTransaction.isSerializedType(message)) {
+                commitCount.incrementAndGet();
                 onMessage("CommitTransaction", message, CommitTransaction.fromSerializable(message),
                         builder.expCommitType, builder.commitReply);
-                commitCount.incrementAndGet();
             } else if(AbortTransaction.isSerializedType(message)) {
+                abortCount.incrementAndGet();
                 onMessage("AbortTransaction", message, AbortTransaction.fromSerializable(message),
                         builder.expAbortType, builder.abortReply);
-                abortCount.incrementAndGet();
             } else {
                 assertionError = new AssertionError("Unexpected message " + message);
             }