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%2Futils%2FNormalizedNodeAggregatorTest.java;h=0844f3d4f3163f185f7be7f8a00f75632ace18dd;hp=cc9e9b288bbe3a6d7d362272ef738b6d7a781f26;hb=abaef4a5ae37f27542155457fe7306a4662b1eeb;hpb=1b2f032084fc334f1027524afe40c608706c56e3 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/NormalizedNodeAggregatorTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/NormalizedNodeAggregatorTest.java index cc9e9b288b..0844f3d4f3 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/NormalizedNodeAggregatorTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/NormalizedNodeAggregatorTest.java @@ -39,24 +39,24 @@ public class NormalizedNodeAggregatorTest { public void testAggregate() throws InterruptedException, ExecutionException, DataValidationFailedException { EffectiveModelContext schemaContext = SchemaContextHelper.full(); - NormalizedNode expectedNode1 = ImmutableNodes.containerNode(TestModel.TEST_QNAME); - NormalizedNode expectedNode2 = ImmutableNodes.containerNode(CarsModel.CARS_QNAME); + NormalizedNode expectedNode1 = ImmutableNodes.containerNode(TestModel.TEST_QNAME); + NormalizedNode expectedNode2 = ImmutableNodes.containerNode(CarsModel.CARS_QNAME); - Optional> optional = NormalizedNodeAggregator.aggregate(YangInstanceIdentifier.empty(), + Optional optional = NormalizedNodeAggregator.aggregate(YangInstanceIdentifier.empty(), ImmutableList.of( - Optional.>of(getRootNode(expectedNode1, schemaContext)), - Optional.>of(getRootNode(expectedNode2, schemaContext))), + Optional.of(getRootNode(expectedNode1, schemaContext)), + Optional.of(getRootNode(expectedNode2, schemaContext))), schemaContext, LogicalDatastoreType.CONFIGURATION); - NormalizedNode normalizedNode = optional.get(); + NormalizedNode normalizedNode = optional.get(); - assertTrue("Expect value to be a Collection", normalizedNode.getValue() instanceof Collection); + assertTrue("Expect value to be a Collection", normalizedNode.body() instanceof Collection); @SuppressWarnings("unchecked") - Collection> collection = (Collection>) normalizedNode.getValue(); + Collection collection = (Collection) normalizedNode.body(); - for (NormalizedNode node : collection) { + for (NormalizedNode node : collection) { assertTrue("Expected " + node + " to be a ContainerNode", node instanceof ContainerNode); } @@ -72,14 +72,14 @@ public class NormalizedNodeAggregatorTest { } - public static NormalizedNode getRootNode(final NormalizedNode moduleNode, + public static NormalizedNode getRootNode(final NormalizedNode moduleNode, final EffectiveModelContext schemaContext) throws ExecutionException, InterruptedException { try (InMemoryDOMDataStore store = new InMemoryDOMDataStore("test", Executors.newSingleThreadExecutor())) { store.onModelContextUpdated(schemaContext); DOMStoreWriteTransaction writeTransaction = store.newWriteOnlyTransaction(); - writeTransaction.merge(YangInstanceIdentifier.of(moduleNode.getNodeType()), moduleNode); + writeTransaction.merge(YangInstanceIdentifier.of(moduleNode.getIdentifier().getNodeType()), moduleNode); DOMStoreThreePhaseCommitCohort ready = writeTransaction.ready(); @@ -89,18 +89,18 @@ public class NormalizedNodeAggregatorTest { DOMStoreReadTransaction readTransaction = store.newReadOnlyTransaction(); - FluentFuture>> read = readTransaction.read(YangInstanceIdentifier.empty()); + FluentFuture> read = readTransaction.read(YangInstanceIdentifier.empty()); - Optional> nodeOptional = read.get(); + Optional nodeOptional = read.get(); return nodeOptional.get(); } } - public static NormalizedNode findChildWithQName(final Collection> collection, + public static NormalizedNode findChildWithQName(final Collection collection, final QName qname) { - for (NormalizedNode node : collection) { - if (node.getNodeType().equals(qname)) { + for (NormalizedNode node : collection) { + if (node.getIdentifier().getNodeType().equals(qname)) { return node; } }