NormalizedNode serialization using protocol buffer
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / BasicIntegrationTest.java
index 74c858e4a6b329ccb6536ddd7f4a1d42bec2885e..6b436ad95e5b14ec724fdc35cb5a5940f8e5fbb4 100644 (file)
@@ -21,7 +21,7 @@ import org.opendaylight.controller.cluster.datastore.messages.CommitTransactionR
 import org.opendaylight.controller.cluster.datastore.messages.CreateTransaction;
 import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionChain;
 import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionChainReply;
-import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionReply;
+import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransactionReply;
 import org.opendaylight.controller.cluster.datastore.messages.PreCommitTransaction;
 import org.opendaylight.controller.cluster.datastore.messages.PreCommitTransactionReply;
 import org.opendaylight.controller.cluster.datastore.messages.ReadyTransaction;
@@ -77,17 +77,15 @@ public class BasicIntegrationTest extends AbstractActorTest {
 
                     Assert.assertNotNull(transactionChain);
 
-                    transactionChain.tell(new CreateTransaction(), getRef());
+                    transactionChain.tell(new CreateTransaction("txn-1"), getRef());
 
                     final ActorSelection transaction =
                         new ExpectMsg<ActorSelection>("CreateTransactionReply") {
                             protected ActorSelection match(Object in) {
                                 if (in instanceof CreateTransactionReply) {
-                                    ActorPath transactionPath =
-                                        ((CreateTransactionReply) in)
-                                            .getTransactionPath();
                                     return getSystem()
-                                        .actorSelection(transactionPath);
+                                        .actorSelection((((CreateTransactionReply) in)
+                                            .getTransactionActorPath()));
                                 } else {
                                     throw noMatch();
                                 }
@@ -152,6 +150,10 @@ public class BasicIntegrationTest extends AbstractActorTest {
 
                     Assert.assertTrue(preCommitDone);
 
+                    // FIXME : When we commit on the cohort it "kills" the Transaction.
+                    // This in turn kills the child of Transaction as well.
+                    // The order in which we receive the terminated event for both
+                    // these actors is not fixed which may cause this test to fail
                     cohort.tell(new CommitTransaction(), getRef());
 
                     final Boolean terminatedCohort =