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%2Fcompat%2FShardTransactionHeliumBackwardsCompatibilityTest.java;h=42b6d0d961b01ff4219e4a858ca1b908af038cfc;hp=e206e69cdaaa88d04ca38ab530865ba9e7e37320;hb=196fbf9b716ea26740195fd397c1b2550f656638;hpb=a51d14246d418570ac98663d286292deefa3555a diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/compat/ShardTransactionHeliumBackwardsCompatibilityTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/compat/ShardTransactionHeliumBackwardsCompatibilityTest.java index e206e69cda..42b6d0d961 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/compat/ShardTransactionHeliumBackwardsCompatibilityTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/compat/ShardTransactionHeliumBackwardsCompatibilityTest.java @@ -13,7 +13,6 @@ import akka.actor.PoisonPill; import akka.actor.Props; import akka.dispatch.Dispatchers; import akka.testkit.TestActorRef; -import java.util.Collections; import org.junit.Assert; import org.junit.Test; import org.opendaylight.controller.cluster.datastore.AbstractActorTest; @@ -22,7 +21,7 @@ import org.opendaylight.controller.cluster.datastore.DatastoreContext; import org.opendaylight.controller.cluster.datastore.Shard; import org.opendaylight.controller.cluster.datastore.ShardTest; import org.opendaylight.controller.cluster.datastore.ShardTestKit; -import org.opendaylight.controller.cluster.datastore.TransactionProxy; +import org.opendaylight.controller.cluster.datastore.TransactionType; import org.opendaylight.controller.cluster.datastore.identifiers.ShardIdentifier; import org.opendaylight.controller.cluster.datastore.messages.AbortTransactionReply; import org.opendaylight.controller.cluster.datastore.messages.CanCommitTransactionReply; @@ -57,11 +56,10 @@ public class ShardTransactionHeliumBackwardsCompatibilityTest extends AbstractAc public void testTransactionCommit() throws Exception { new ShardTestKit(getSystem()) {{ SchemaContext schemaContext = TestModel.createTestContext(); - Props shardProps = Shard.props(ShardIdentifier.builder().memberName("member-1"). - shardName("inventory").type("config").build(), - Collections.emptyMap(), - DatastoreContext.newBuilder().shardHeartbeatIntervalInMillis(100).build(), - schemaContext).withDispatcher(Dispatchers.DefaultDispatcherId()); + Props shardProps = Shard.builder().id(ShardIdentifier.builder().memberName("member-1"). + shardName("inventory").type("config").build()).datastoreContext(DatastoreContext.newBuilder(). + shardHeartbeatIntervalInMillis(100).build()).schemaContext(schemaContext).props(). + withDispatcher(Dispatchers.DefaultDispatcherId()); final TestActorRef shard = TestActorRef.create(getSystem(), shardProps, "testTransactionCommit"); @@ -73,7 +71,7 @@ public class ShardTransactionHeliumBackwardsCompatibilityTest extends AbstractAc String transactionID = "txn-1"; shard.tell(ShardTransactionMessages.CreateTransaction.newBuilder() .setTransactionId(transactionID) - .setTransactionType(TransactionProxy.TransactionType.WRITE_ONLY.ordinal()) + .setTransactionType(TransactionType.WRITE_ONLY.ordinal()) .setTransactionChainId("").build(), getRef()); final FiniteDuration duration = duration("5 seconds"); @@ -131,11 +129,10 @@ public class ShardTransactionHeliumBackwardsCompatibilityTest extends AbstractAc public void testTransactionAbort() throws Exception { new ShardTestKit(getSystem()) {{ SchemaContext schemaContext = TestModel.createTestContext(); - Props shardProps = Shard.props(ShardIdentifier.builder().memberName("member-1"). - shardName("inventory").type("config").build(), - Collections.emptyMap(), - DatastoreContext.newBuilder().shardHeartbeatIntervalInMillis(100).build(), - schemaContext).withDispatcher(Dispatchers.DefaultDispatcherId()); + Props shardProps = Shard.builder().id(ShardIdentifier.builder().memberName("member-1"). + shardName("inventory").type("config").build()).datastoreContext(DatastoreContext.newBuilder(). + shardHeartbeatIntervalInMillis(100).build()).schemaContext(schemaContext).props(). + withDispatcher(Dispatchers.DefaultDispatcherId()); final TestActorRef shard = TestActorRef.create(getSystem(), shardProps, "testTransactionAbort"); @@ -147,7 +144,7 @@ public class ShardTransactionHeliumBackwardsCompatibilityTest extends AbstractAc String transactionID = "txn-1"; shard.tell(ShardTransactionMessages.CreateTransaction.newBuilder() .setTransactionId(transactionID) - .setTransactionType(TransactionProxy.TransactionType.WRITE_ONLY.ordinal()) + .setTransactionType(TransactionType.WRITE_ONLY.ordinal()) .setTransactionChainId("").build(), getRef()); final FiniteDuration duration = duration("5 seconds");