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();
+ if (CreateTransactionReply.SERIALIZABLE_CLASS.equals(in.getClass())) {
+ CreateTransactionReply reply = CreateTransactionReply.fromSerializable(in);
return getSystem()
- .actorSelection(transactionPath);
+ .actorSelection(reply
+ .getTransactionPath());
} else {
throw noMatch();
}
final ActorRef transactionActorRef = watchActor(transaction);
transaction.tell(new WriteData(TestModel.TEST_PATH,
- ImmutableNodes.containerNode(TestModel.TEST_QNAME)),
+ ImmutableNodes.containerNode(TestModel.TEST_QNAME), TestModel.createTestContext()),
getRef());
Boolean writeDone = new ExpectMsg<Boolean>("WriteDataReply") {
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 =