X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Futils%2FPruningDataTreeModificationTest.java;h=1f5f92c03ca0ae115b1768133adbaebe5c0c8dd2;hb=abaef4a5ae37f27542155457fe7306a4662b1eeb;hp=6ec01cfbbf0ad10909ec36038f45d8a2d59745b3;hpb=d19cf96d390ffcdba8b1f64a6dd3f3749ecc5872;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/PruningDataTreeModificationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/PruningDataTreeModificationTest.java index 6ec01cfbbf..1f5f92c03c 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/PruningDataTreeModificationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/PruningDataTreeModificationTest.java @@ -57,14 +57,14 @@ import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableCo import org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeFactory; import org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaValidationFailedException; import org.opendaylight.yangtools.yang.data.util.DataSchemaContextTree; -import org.opendaylight.yangtools.yang.model.api.SchemaContext; +import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; @RunWith(MockitoJUnitRunner.class) public class PruningDataTreeModificationTest { static final QName INVALID_TEST_QNAME = QName.create(TestModel.TEST_QNAME, "invalid"); static final YangInstanceIdentifier INVALID_TEST_PATH = YangInstanceIdentifier.of(INVALID_TEST_QNAME); - private static SchemaContext SCHEMA_CONTEXT; + private static EffectiveModelContext SCHEMA_CONTEXT; private static DataSchemaContextTree CONTEXT_TREE; @Mock @@ -123,7 +123,7 @@ public class PruningDataTreeModificationTest { @Test public void testMerge() { - NormalizedNode normalizedNode = CarsModel.create(); + NormalizedNode normalizedNode = CarsModel.create(); YangInstanceIdentifier path = CarsModel.BASE_PATH; pruningDataTreeModification.merge(path, normalizedNode); @@ -132,7 +132,7 @@ public class PruningDataTreeModificationTest { @Test public void testMergeWithInvalidNamespace() throws DataValidationFailedException { - NormalizedNode normalizedNode = PeopleModel.emptyContainer(); + NormalizedNode normalizedNode = PeopleModel.emptyContainer(); YangInstanceIdentifier path = PeopleModel.BASE_PATH; pruningDataTreeModification.merge(path, normalizedNode); @@ -149,7 +149,7 @@ public class PruningDataTreeModificationTest { new YangInstanceIdentifier.NodeIdentifier(AUG_CONTAINER)).withChild( ImmutableNodes.containerNode(AUG_INNER_CONTAINER)).build(); - DataContainerChild outerNode = outerNode(outerNodeEntry(1, innerNode("one", "two"))); + DataContainerChild outerNode = outerNode(outerNodeEntry(1, innerNode("one", "two"))); ContainerNode normalizedNode = ImmutableContainerNodeBuilder.create() .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME)).withChild(outerNode) .withChild(augContainer).withChild(ImmutableNodes.leafNode(AUG_QNAME, "aug")).build(); @@ -163,14 +163,14 @@ public class PruningDataTreeModificationTest { ContainerNode prunedNode = ImmutableContainerNodeBuilder.create().withNodeIdentifier( new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME)).withChild(outerNode).build(); - Optional> actual = dataTree.takeSnapshot().readNode(path); + Optional actual = dataTree.takeSnapshot().readNode(path); assertTrue("After pruning present", actual.isPresent()); assertEquals("After pruning", prunedNode, actual.get()); } @Test public void testMergeWithValidNamespaceAndInvalidNodeName() throws DataValidationFailedException { - NormalizedNode normalizedNode = ImmutableNodes.containerNode(INVALID_TEST_QNAME); + NormalizedNode normalizedNode = ImmutableNodes.containerNode(INVALID_TEST_QNAME); YangInstanceIdentifier path = INVALID_TEST_PATH; pruningDataTreeModification.merge(path, normalizedNode); @@ -183,7 +183,7 @@ public class PruningDataTreeModificationTest { @Test public void testWrite() { - NormalizedNode normalizedNode = CarsModel.create(); + NormalizedNode normalizedNode = CarsModel.create(); YangInstanceIdentifier path = CarsModel.BASE_PATH; pruningDataTreeModification.write(path, normalizedNode); @@ -201,11 +201,11 @@ public class PruningDataTreeModificationTest { localDataTree.validate(mod); localDataTree.commit(localDataTree.prepare(mod)); - NormalizedNode normalizedNode = dataTree.takeSnapshot().readNode(YangInstanceIdentifier.empty()).get(); + NormalizedNode normalizedNode = dataTree.takeSnapshot().readNode(YangInstanceIdentifier.empty()).get(); pruningDataTreeModification.write(YangInstanceIdentifier.empty(), normalizedNode); dataTree.commit(getCandidate()); - Optional> actual = dataTree.takeSnapshot().readNode(YangInstanceIdentifier.empty()); + Optional actual = dataTree.takeSnapshot().readNode(YangInstanceIdentifier.empty()); assertTrue("Root present", actual.isPresent()); assertEquals("Root node", normalizedNode, actual.get()); } @@ -215,15 +215,15 @@ public class PruningDataTreeModificationTest { final Shard mockShard = Mockito.mock(Shard.class); ShardDataTree shardDataTree = new ShardDataTree(mockShard, SCHEMA_CONTEXT, TreeType.CONFIGURATION); - NormalizedNode root = shardDataTree.readNode(YangInstanceIdentifier.empty()).get(); + NormalizedNode root = shardDataTree.readNode(YangInstanceIdentifier.empty()).get(); - NormalizedNode normalizedNode = ImmutableContainerNodeBuilder.create().withNodeIdentifier( - new YangInstanceIdentifier.NodeIdentifier(root.getNodeType())).withChild( + NormalizedNode normalizedNode = ImmutableContainerNodeBuilder.create().withNodeIdentifier( + new YangInstanceIdentifier.NodeIdentifier(root.getIdentifier().getNodeType())).withChild( ImmutableNodes.containerNode(AUG_CONTAINER)).build(); pruningDataTreeModification.write(YangInstanceIdentifier.empty(), normalizedNode); dataTree.commit(getCandidate()); - Optional> actual = dataTree.takeSnapshot().readNode(YangInstanceIdentifier.empty()); + Optional actual = dataTree.takeSnapshot().readNode(YangInstanceIdentifier.empty()); assertEquals("Root present", true, actual.isPresent()); assertEquals("Root node", root, actual.get()); @@ -231,7 +231,7 @@ public class PruningDataTreeModificationTest { @Test public void testWriteWithInvalidNamespace() throws DataValidationFailedException { - NormalizedNode normalizedNode = PeopleModel.emptyContainer(); + NormalizedNode normalizedNode = PeopleModel.emptyContainer(); YangInstanceIdentifier path = PeopleModel.BASE_PATH; pruningDataTreeModification.write(path, normalizedNode); @@ -248,7 +248,7 @@ public class PruningDataTreeModificationTest { new YangInstanceIdentifier.NodeIdentifier(AUG_CONTAINER)).withChild( ImmutableNodes.containerNode(AUG_INNER_CONTAINER)).build(); - DataContainerChild outerNode = outerNode(outerNodeEntry(1, innerNode("one", "two"))); + DataContainerChild outerNode = outerNode(outerNodeEntry(1, innerNode("one", "two"))); ContainerNode normalizedNode = ImmutableContainerNodeBuilder.create() .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME)).withChild(outerNode) .withChild(augContainer).withChild(ImmutableNodes.leafNode(AUG_QNAME, "aug")) @@ -264,7 +264,7 @@ public class PruningDataTreeModificationTest { .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME)).withChild(outerNode) .withChild(ImmutableNodes.leafNode(NAME_QNAME, "name")).build(); - Optional> actual = dataTree.takeSnapshot().readNode(path); + Optional actual = dataTree.takeSnapshot().readNode(path); assertTrue("After pruning present", actual.isPresent()); assertEquals("After pruning", prunedNode, actual.get()); }