X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2Ftree%2Fdata%2FModificationMetadataTreeTest.java;h=4fb190fc8201853e094ac87ec5f1a659ab1e19bf;hp=bc27c551558b91e2b47582bdbac9db63a1eeacd7;hb=510561642a3d699673140da8879d4eb5bc88534e;hpb=829938b736ecac866cf2ba9bc80451017b9395a9 diff --git a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/ModificationMetadataTreeTest.java b/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/ModificationMetadataTreeTest.java index bc27c55155..4fb190fc82 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/ModificationMetadataTreeTest.java +++ b/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/ModificationMetadataTreeTest.java @@ -26,10 +26,11 @@ import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.ma import org.junit.Before; import org.junit.Test; -import org.opendaylight.controller.md.sal.dom.store.impl.SchemaAwareApplyOperationRoot; import org.opendaylight.controller.md.sal.dom.store.impl.TestModel; import org.opendaylight.controller.md.sal.dom.store.impl.tree.DataTree; import org.opendaylight.controller.md.sal.dom.store.impl.tree.DataTreeModification; +import org.opendaylight.controller.md.sal.dom.store.impl.tree.spi.TreeNodeFactory; +import org.opendaylight.controller.md.sal.dom.store.impl.tree.spi.Version; import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @@ -41,7 +42,6 @@ import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableCo import org.opendaylight.yangtools.yang.model.api.SchemaContext; import com.google.common.base.Optional; -import com.google.common.primitives.UnsignedLong; /** * @@ -99,14 +99,16 @@ public class ModificationMetadataTreeTest { .withChild(mapEntry(INNER_LIST_QNAME, NAME_QNAME, TWO_ONE_NAME)) // .withChild(mapEntry(INNER_LIST_QNAME, NAME_QNAME, TWO_TWO_NAME)) // .build()) // - .build(); + .build(); private SchemaContext schemaContext; + private ModificationApplyOperation applyOper; @Before public void prepare() { schemaContext = TestModel.createTestContext(); assertNotNull("Schema context must not be null.", schemaContext); + applyOper = SchemaAwareApplyOperation.from(schemaContext); } /** @@ -141,14 +143,14 @@ public class ModificationMetadataTreeTest { .withNodeIdentifier(new NodeIdentifier(TEST_QNAME)) .withChild( mapNodeBuilder(OUTER_LIST_QNAME) - .withChild(mapEntry(OUTER_LIST_QNAME, ID_QNAME, ONE_ID)) - .withChild(BAR_NODE).build()).build(); + .withChild(mapEntry(OUTER_LIST_QNAME, ID_QNAME, ONE_ID)) + .withChild(BAR_NODE).build()).build(); } @Test public void basicReadWrites() { DataTreeModification modificationTree = new InMemoryDataTreeModification(new InMemoryDataTreeSnapshot(schemaContext, - StoreMetadataNode.createRecursively(createDocumentOne(), UnsignedLong.valueOf(5))), + TreeNodeFactory.createTreeNode(createDocumentOne(), Version.initial()), applyOper), new SchemaAwareApplyOperationRoot(schemaContext)); Optional> originalBarNode = modificationTree.readNode(OUTER_LIST_2_PATH); assertTrue(originalBarNode.isPresent()); @@ -183,7 +185,7 @@ public class ModificationMetadataTreeTest { * context. * */ - return t.takeSnapshot().newModification(new SchemaAwareApplyOperationRoot(schemaContext)); + return t.takeSnapshot().newModification(); } @Test