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%2FShardTest.java;h=994c91ca89e318d36d9b032928fb5843004189ca;hb=refs%2Fchanges%2F14%2F39014%2F7;hp=5b5f8617249a6502c03b0d2e55d546ef45539890;hpb=4e3f49788c05730b29468deebc2aaa4ed0d94eef;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java index 5b5f861724..994c91ca89 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java @@ -390,8 +390,7 @@ public class ShardTest extends AbstractShardTest { @Test public void testPeerAddressResolved() throws Exception { new ShardTestKit(getSystem()) {{ - ShardIdentifier peerID = ShardIdentifier.builder().memberName(MemberName.forName("member-2")) - .shardName("inventory").type("config").build(); + ShardIdentifier peerID = ShardIdentifier.create("inventory", MemberName.forName("member-2"), "config"); final TestActorRef shard = actorFactory.createTestActor(newShardBuilder(). peerAddresses(Collections.singletonMap(peerID.toString(), null)).props(). withDispatcher(Dispatchers.DefaultDispatcherId()), "testPeerAddressResolved"); @@ -422,7 +421,7 @@ public class ShardTest extends AbstractShardTest { writeToStore(store, TestModel.TEST_PATH, container); - final YangInstanceIdentifier root = YangInstanceIdentifier.builder().build(); + final YangInstanceIdentifier root = YangInstanceIdentifier.EMPTY; final NormalizedNode expected = readStore(store, root); final Snapshot snapshot = Snapshot.create(SerializationUtils.serializeNormalizedNode(expected), @@ -1214,7 +1213,7 @@ public class ShardTest extends AbstractShardTest { final String transactionID = "tx1"; final MutableCompositeModification modification = new MutableCompositeModification(); - modification.addModification(new DeleteModification(YangInstanceIdentifier.builder().build())); + modification.addModification(new DeleteModification(YangInstanceIdentifier.EMPTY)); final ShardDataTreeCohort cohort = mock(ShardDataTreeCohort.class, "cohort1"); doReturn(Futures.immediateFuture(Boolean.TRUE)).when(cohort).canCommit(); doReturn(Futures.immediateFuture(Boolean.TRUE)).when(cohort).preCommit(); @@ -2107,7 +2106,7 @@ public class ShardTest extends AbstractShardTest { waitUntilLeader(shard); writeToStore(shard, TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME)); - final NormalizedNode expectedRoot = readStore(shard, YangInstanceIdentifier.builder().build()); + final NormalizedNode expectedRoot = readStore(shard, YangInstanceIdentifier.EMPTY); // Trigger creation of a snapshot by ensuring final RaftActorContext raftActorContext = ((TestShard) shard.underlyingActor()).getRaftActorContext(); @@ -2154,16 +2153,16 @@ public class ShardTest extends AbstractShardTest { commitTransaction(store, putTransaction); - final NormalizedNode expected = readStore(store, YangInstanceIdentifier.builder().build()); + final NormalizedNode expected = readStore(store, YangInstanceIdentifier.EMPTY); final DataTreeModification writeTransaction = store.takeSnapshot().newModification(); - writeTransaction.delete(YangInstanceIdentifier.builder().build()); - writeTransaction.write(YangInstanceIdentifier.builder().build(), expected); + writeTransaction.delete(YangInstanceIdentifier.EMPTY); + writeTransaction.write(YangInstanceIdentifier.EMPTY, expected); commitTransaction(store, writeTransaction); - final NormalizedNode actual = readStore(store, YangInstanceIdentifier.builder().build()); + final NormalizedNode actual = readStore(store, YangInstanceIdentifier.EMPTY); assertEquals(expected, actual); } @@ -2308,13 +2307,11 @@ public class ShardTest extends AbstractShardTest { public void testClusteredDataChangeListenerRegistration() throws Exception { new ShardTestKit(getSystem()) {{ String testName = "testClusteredDataChangeListenerRegistration"; - final ShardIdentifier followerShardID = ShardIdentifier.builder() - .memberName(MemberName.forName(actorFactory.generateActorId(testName + "-follower"))) - .shardName("inventory").type("config").build(); + final ShardIdentifier followerShardID = ShardIdentifier.create("inventory", + MemberName.forName(actorFactory.generateActorId(testName + "-follower")), "config"); - final ShardIdentifier leaderShardID = ShardIdentifier.builder() - .memberName(MemberName.forName(actorFactory.generateActorId(testName + "-leader"))) - .shardName("inventory").type("config").build(); + final ShardIdentifier leaderShardID = ShardIdentifier.create("inventory", + MemberName.forName(actorFactory.generateActorId(testName + "-leader")), "config"); final TestActorRef followerShard = actorFactory.createTestActor( Shard.builder().id(followerShardID). @@ -2386,13 +2383,11 @@ public class ShardTest extends AbstractShardTest { public void testClusteredDataTreeChangeListenerRegistration() throws Exception { new ShardTestKit(getSystem()) {{ String testName = "testClusteredDataTreeChangeListenerRegistration"; - final ShardIdentifier followerShardID = ShardIdentifier.builder() - .memberName(MemberName.forName(actorFactory.generateActorId(testName + "-follower"))) - .shardName("inventory").type("config").build(); + final ShardIdentifier followerShardID = ShardIdentifier.create("inventory", + MemberName.forName(actorFactory.generateActorId(testName + "-follower")), "config"); - final ShardIdentifier leaderShardID = ShardIdentifier.builder() - .memberName(MemberName.forName(actorFactory.generateActorId(testName + "-leader"))) - .shardName("inventory").type("config").build(); + final ShardIdentifier leaderShardID = ShardIdentifier.create("inventory", + MemberName.forName(actorFactory.generateActorId(testName + "-leader")), "config"); final TestActorRef followerShard = actorFactory.createTestActor( Shard.builder().id(followerShardID).