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%2Fsharding%2FDistributedShardFrontendTest.java;h=6a346202fb0469b4f0ad76441978ed1e1acebcb6;hb=731e7284cf0895fdb1b89427f91762e80e67c2ff;hp=53840049b4f9b283aabb1060069b935295208e3a;hpb=20f8f30f4bbf1e982672c1f883a6a18b0e4539de;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/sharding/DistributedShardFrontendTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/sharding/DistributedShardFrontendTest.java index 53840049b4..6a346202fb 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/sharding/DistributedShardFrontendTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/sharding/DistributedShardFrontendTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. + * Copyright (c) 2016, 2017 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, @@ -116,7 +116,7 @@ public class DistributedShardFrontendTest { final DistributedShardFrontend rootShard = new DistributedShardFrontend(distributedDataStore, client, ROOT); - try (final DOMDataTreeProducer producer = shardedDOMDataTree.createProducer(Collections.singletonList(ROOT))) { + try (DOMDataTreeProducer producer = shardedDOMDataTree.createProducer(Collections.singletonList(ROOT))) { shardedDOMDataTree.registerDataTreeShard(ROOT, rootShard, producer); } @@ -142,17 +142,17 @@ public class DistributedShardFrontendTest { final DistributedShardFrontend outerListShard = new DistributedShardFrontend( distributedDataStore, outerListClient, OUTER_LIST_ID); - try (final DOMDataTreeProducer producer = + try (DOMDataTreeProducer producer = shardedDOMDataTree.createProducer(Collections.singletonList(OUTER_LIST_ID))) { shardedDOMDataTree.registerDataTreeShard(OUTER_LIST_ID, outerListShard, producer); } final DOMDataTreeProducer producer = shardedDOMDataTree.createProducer(Collections.singletonList(ROOT)); final DOMDataTreeCursorAwareTransaction tx = producer.createTransaction(false); - final DOMDataTreeWriteCursor cursor = tx.createCursor(ROOT); + final DOMDataTreeWriteCursor txCursor = tx.createCursor(ROOT); - assertNotNull(cursor); - cursor.write(TestModel.TEST_PATH.getLastPathArgument(), createCrossShardContainer()); + assertNotNull(txCursor); + txCursor.write(TestModel.TEST_PATH.getLastPathArgument(), createCrossShardContainer()); //check the lower shard got the correct modification verify(outerListCursor, times(2)).write(pathArgumentCaptor.capture(), nodeCaptor.capture()); @@ -171,13 +171,12 @@ public class DistributedShardFrontendTest { final MapNode actualInnerListNode = (MapNode) nodeCaptor.getAllValues().get(1); assertEquals(createInnerMapNode(1), actualInnerListNode); - cursor.close(); + txCursor.close(); tx.submit().checkedGet(); verify(commitCohort, times(2)).canCommit(); verify(commitCohort, times(2)).preCommit(); verify(commitCohort, times(2)).commit(); - } private static MapNode createInnerMapNode(final int id) { @@ -213,6 +212,4 @@ public class DistributedShardFrontendTest { return testContainer; } - - -} \ No newline at end of file +}