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%2Fstore%2Fimpl%2FModificationMetadataTreeTest.java;h=0445c47c6bcb29fa3825f9971bd8e50a8b7f9d45;hb=35189191ea7d4fc663da81cabacacfa4f7ace313;hp=7610a78364f4f46d7c01b003202b6da104f9f054;hpb=4f8166639477de8c1c9048baee2ba70003748756;p=controller.git diff --git a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/ModificationMetadataTreeTest.java b/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/ModificationMetadataTreeTest.java index 7610a78364..0445c47c6b 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/ModificationMetadataTreeTest.java +++ b/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/ModificationMetadataTreeTest.java @@ -135,18 +135,11 @@ public class ModificationMetadataTreeTest { .withChild(BAR_NODE).build()).build(); } - private StoreMetadataNode createDocumentOneMetadata() { - UnsignedLong version = UnsignedLong.valueOf(0); - return StoreMetadataNode.createRecursivelly(createDocumentOne(), version); - } - @Test public void basicReadWrites() { - MutableDataTree modificationTree = MutableDataTree.from( - DataAndMetadataSnapshot.builder() // - .setMetadataTree(createDocumentOneMetadata()) // - .setSchemaContext(schemaContext) // - .build(), new SchemaAwareApplyOperationRoot(schemaContext)); + MutableDataTree modificationTree = MutableDataTree.from(new DataTree.Snapshot(schemaContext, + StoreMetadataNode.createRecursively(createDocumentOne(), UnsignedLong.valueOf(5))), + new SchemaAwareApplyOperationRoot(schemaContext)); Optional> originalBarNode = modificationTree.read(OUTER_LIST_2_PATH); assertTrue(originalBarNode.isPresent()); assertSame(BAR_NODE, originalBarNode.get()); @@ -171,7 +164,7 @@ public class ModificationMetadataTreeTest { /** * Creates empty Snapshot with associated schema context. */ - DataAndMetadataSnapshot emptySnapshot = DataAndMetadataSnapshot.createEmpty(schemaContext); + DataTree t = DataTree.create(schemaContext); /** * @@ -179,7 +172,7 @@ public class ModificationMetadataTreeTest { * context. * */ - MutableDataTree modificationTree = MutableDataTree.from(emptySnapshot, new SchemaAwareApplyOperationRoot( + MutableDataTree modificationTree = MutableDataTree.from(t.takeSnapshot(), new SchemaAwareApplyOperationRoot( schemaContext)); return modificationTree; }