X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FBasicIntegrationTest.java;h=a718ca7e4c31ef16d6be1fb26e839f3f551450e2;hb=e6bce2425d5d3f477bed1fff0ac2b2eb70cbe131;hp=6f131f301fe8985dade813ce2b00bf994c7a1bf6;hpb=be2ae0c277e83381bff2cc71cb8244646236aa47;p=controller.git 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 6f131f301f..a718ca7e4c 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 @@ -8,19 +8,15 @@ package org.opendaylight.controller.cluster.datastore; -import akka.actor.ActorPath; import akka.actor.ActorRef; import akka.actor.ActorSelection; import akka.actor.Props; import akka.event.Logging; import akka.testkit.JavaTestKit; - import org.junit.Test; import org.opendaylight.controller.cluster.datastore.identifiers.ShardIdentifier; import org.opendaylight.controller.cluster.datastore.messages.CommitTransaction; 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.cluster.datastore.messages.PreCommitTransaction; import org.opendaylight.controller.cluster.datastore.messages.PreCommitTransactionReply; @@ -32,7 +28,6 @@ import org.opendaylight.controller.cluster.datastore.messages.WriteDataReply; import org.opendaylight.controller.md.cluster.datastore.model.TestModel; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; import org.opendaylight.yangtools.yang.model.api.SchemaContext; - import scala.concurrent.Await; import scala.concurrent.Future; import scala.concurrent.duration.FiniteDuration; @@ -64,7 +59,7 @@ public class BasicIntegrationTest extends AbstractActorTest { final SchemaContext schemaContext = TestModel.createTestContext(); DatastoreContext datastoreContext = new DatastoreContext(); - final Props props = Shard.props(identifier, Collections.EMPTY_MAP, datastoreContext); + final Props props = Shard.props(identifier, Collections.EMPTY_MAP, datastoreContext, TestModel.createTestContext()); final ActorRef shard = getSystem().actorOf(props); new Within(duration("10 seconds")) { @@ -87,31 +82,8 @@ public class BasicIntegrationTest extends AbstractActorTest { assertEquals(true, result); - // 1. Create a TransactionChain - shard.tell(new CreateTransactionChain().toSerializable(), getRef()); - - final ActorSelection transactionChain = - new ExpectMsg(duration("3 seconds"), "CreateTransactionChainReply") { - @Override - protected ActorSelection match(Object in) { - if (in.getClass().equals(CreateTransactionChainReply.SERIALIZABLE_CLASS)) { - ActorPath transactionChainPath = - CreateTransactionChainReply.fromSerializable(getSystem(),in) - .getTransactionChainPath(); - return getSystem() - .actorSelection(transactionChainPath); - } else { - throw noMatch(); - } - } - }.get(); // this extracts the received message - - assertNotNull(transactionChain); - - System.out.println("Successfully created transaction chain"); - - // 2. Create a Transaction on the TransactionChain - transactionChain.tell(new CreateTransaction("txn-1", TransactionProxy.TransactionType.WRITE_ONLY.ordinal() ).toSerializable(), getRef()); + // Create a transaction on the shard + shard.tell(new CreateTransaction("txn-1", TransactionProxy.TransactionType.WRITE_ONLY.ordinal() ).toSerializable(), getRef()); final ActorSelection transaction = new ExpectMsg(duration("3 seconds"), "CreateTransactionReply") { @@ -161,11 +133,10 @@ public class BasicIntegrationTest extends AbstractActorTest { @Override protected ActorSelection match(Object in) { if (in.getClass().equals(ReadyTransactionReply.SERIALIZABLE_CLASS)) { - ActorPath cohortPath = - ReadyTransactionReply.fromSerializable(getSystem(),in) + String cohortPath = + ReadyTransactionReply.fromSerializable(in) .getCohortPath(); - return getSystem() - .actorSelection(cohortPath); + return getSystem().actorSelection(cohortPath); } else { throw noMatch(); }