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%2FBasicIntegrationTest.java;h=6b9f00e00edba76f019b1365b96fdf259507b376;hp=74c858e4a6b329ccb6536ddd7f4a1d42bec2885e;hb=5f0488294169c571a33bdb76ff19a3ca3e1e6bb6;hpb=8a31e147100aa64b6090d856b2efe7ef50021555 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/BasicIntegrationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/BasicIntegrationTest.java index 74c858e4a6..6b9f00e00e 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/BasicIntegrationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/BasicIntegrationTest.java @@ -39,6 +39,7 @@ public class BasicIntegrationTest extends AbstractActorTest { @Test public void integrationTest() throws Exception{ + // System.setProperty("shard.persistent", "true"); // This test will // - create a Shard // - initiate a transaction @@ -77,17 +78,16 @@ 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("CreateTransactionReply") { protected ActorSelection match(Object in) { - if (in instanceof CreateTransactionReply) { - ActorPath transactionPath = - ((CreateTransactionReply) in) - .getTransactionPath(); + if (CreateTransactionReply.SERIALIZABLE_CLASS.equals(in.getClass())) { + CreateTransactionReply reply = CreateTransactionReply.fromSerializable(in); return getSystem() - .actorSelection(transactionPath); + .actorSelection(reply + .getTransactionPath()); } else { throw noMatch(); } @@ -100,7 +100,7 @@ public class BasicIntegrationTest extends AbstractActorTest { final ActorRef transactionActorRef = watchActor(transaction); transaction.tell(new WriteData(TestModel.TEST_PATH, - ImmutableNodes.containerNode(TestModel.TEST_QNAME)), + ImmutableNodes.containerNode(TestModel.TEST_QNAME), TestModel.createTestContext()).toSerializable(), getRef()); Boolean writeDone = new ExpectMsg("WriteDataReply") { @@ -152,6 +152,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 =