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%2FShardTransactionFailureTest.java;fp=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FShardTransactionFailureTest.java;h=869f47578711ea313181e4011444dc82ca35feaa;hp=eea73526f27d57d62b784509d3e99100c8a091f0;hb=7a569e082e6be2fd081e8df16666d44e1fe9274a;hpb=4a2db09204b6cc8b3e25948b976921891849c9ce diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionFailureTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionFailureTest.java index eea73526f2..869f475787 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionFailureTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionFailureTest.java @@ -67,12 +67,15 @@ public class ShardTransactionFailureTest extends AbstractActorTest { store.onGlobalContextUpdated(testSchemaContext); } + private ActorRef createShard(){ + return getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new DatastoreContext(), TestModel.createTestContext())); + } + @Test(expected = ReadFailedException.class) public void testNegativeReadWithReadOnlyTransactionClosed() throws Throwable { - final ActorRef shard = - getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new DatastoreContext())); + final ActorRef shard = createShard(); final Props props = ShardTransaction.props(store.newReadOnlyTransaction(), shard, testSchemaContext, datastoreContext, shardStats); @@ -101,8 +104,7 @@ public class ShardTransactionFailureTest extends AbstractActorTest { public void testNegativeReadWithReadWriteTransactionClosed() throws Throwable { - final ActorRef shard = - getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new DatastoreContext())); + final ActorRef shard = createShard(); final Props props = ShardTransaction.props(store.newReadWriteTransaction(), shard, testSchemaContext, datastoreContext, shardStats); @@ -131,8 +133,7 @@ public class ShardTransactionFailureTest extends AbstractActorTest { public void testNegativeExistsWithReadWriteTransactionClosed() throws Throwable { - final ActorRef shard = - getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new DatastoreContext())); + final ActorRef shard = createShard(); final Props props = ShardTransaction.props(store.newReadWriteTransaction(), shard, testSchemaContext, datastoreContext, shardStats); @@ -161,8 +162,7 @@ public class ShardTransactionFailureTest extends AbstractActorTest { public void testNegativeWriteWithTransactionReady() throws Exception { - final ActorRef shard = - getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new DatastoreContext())); + final ActorRef shard = createShard(); final Props props = ShardTransaction.props(store.newWriteOnlyTransaction(), shard, testSchemaContext, datastoreContext, shardStats); @@ -194,8 +194,7 @@ public class ShardTransactionFailureTest extends AbstractActorTest { public void testNegativeReadWriteWithTransactionReady() throws Exception { - final ActorRef shard = - getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new DatastoreContext())); + final ActorRef shard = createShard(); final Props props = ShardTransaction.props(store.newReadWriteTransaction(), shard, testSchemaContext, datastoreContext, shardStats); @@ -232,8 +231,7 @@ public class ShardTransactionFailureTest extends AbstractActorTest { public void testNegativeMergeTransactionReady() throws Exception { - final ActorRef shard = - getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new DatastoreContext())); + final ActorRef shard = createShard(); final Props props = ShardTransaction.props(store.newReadWriteTransaction(), shard, testSchemaContext, datastoreContext, shardStats); @@ -265,8 +263,7 @@ public class ShardTransactionFailureTest extends AbstractActorTest { public void testNegativeDeleteDataWhenTransactionReady() throws Exception { - final ActorRef shard = - getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new DatastoreContext())); + final ActorRef shard = createShard(); final Props props = ShardTransaction.props(store.newReadWriteTransaction(), shard, testSchemaContext, datastoreContext, shardStats);