X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fbroker%2Fimpl%2FDataNormalizerTest.java;fp=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fbroker%2Fimpl%2FDataNormalizerTest.java;h=0000000000000000000000000000000000000000;hb=0e12a849d33ae3ca3d1a8e2e281e6eac2cc13373;hp=ac7b87a9f58ec55128eb8aed96b77220772fcfed;hpb=00c362a353f1a7e6145f4c50811fa8b7a6c871d2;p=controller.git diff --git a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DataNormalizerTest.java b/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DataNormalizerTest.java deleted file mode 100644 index ac7b87a9f5..0000000000 --- a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DataNormalizerTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.opendaylight.controller.md.sal.dom.broker.impl; - -import static org.junit.Assert.assertNotNull; - -import org.junit.Test; -import org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizer; -import org.opendaylight.controller.md.sal.dom.store.impl.TestModel; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates; -import org.opendaylight.yangtools.yang.data.api.Node; -import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode; -import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; -import org.opendaylight.yangtools.yang.data.impl.schema.Builders; -import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; -import org.opendaylight.yangtools.yang.model.api.SchemaContext; - -public class DataNormalizerTest { - - private static final Short OUTER_LIST_ID = (short)10; - - private static final InstanceIdentifier OUTER_LIST_PATH_LEGACY = InstanceIdentifier.builder(TestModel.TEST_QNAME) - .nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME,OUTER_LIST_ID).build(); - - private static final InstanceIdentifier LEAF_TWO_PATH_LEGACY = InstanceIdentifier.builder(OUTER_LIST_PATH_LEGACY) - .node(TestModel.TWO_QNAME).build(); - - private static final ChoiceNode OUTER_CHOICE_ITEM = Builders.choiceBuilder() - .withNodeIdentifier(new NodeIdentifier(TestModel.OUTER_CHOICE_QNAME)) - .withChild(ImmutableNodes.leafNode(TestModel.TWO_QNAME, "two")) - .withChild(ImmutableNodes.leafNode(TestModel.THREE_QNAME, "three")) - .build(); - - private static final MapEntryNode OUTER_LIST_WITHOUT_CHOICE = Builders.mapEntryBuilder() - .withNodeIdentifier(new NodeIdentifierWithPredicates(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME,OUTER_LIST_ID)) - .withChild(ImmutableNodes.leafNode(TestModel.ID_QNAME, OUTER_LIST_ID)) - .build(); - - private static final MapEntryNode OUTER_LIST_WITH_CHOICE = Builders.mapEntryBuilder() - .withNodeIdentifier(new NodeIdentifierWithPredicates(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME,OUTER_LIST_ID)) - .withChild(ImmutableNodes.leafNode(TestModel.ID_QNAME, OUTER_LIST_ID)) - .withChild(OUTER_CHOICE_ITEM) - .build(); - - @Test - public void test() { - SchemaContext testCtx = TestModel.createTestContext(); - DataNormalizer normalizer = new DataNormalizer(testCtx); - - InstanceIdentifier normalizedPath = normalizer.toNormalized(LEAF_TWO_PATH_LEGACY); - - Node outerListLegacy = DataNormalizer.toLegacy(OUTER_LIST_WITH_CHOICE); - assertNotNull(outerListLegacy); - } - -}