Update CursorAwareDataTree{Modification,Snapshot} API
[yangtools.git] / yang / yang-data-impl / src / test / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / DataTreeCandidatesTest.java
index 55c4e395a4182c5e153498a634d6225fca110e17..20361ddacff64cc772e23908b37f153153409459 100644 (file)
@@ -13,7 +13,6 @@ import static org.junit.Assert.fail;
 
 import org.junit.Before;
 import org.junit.Test;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
@@ -33,7 +32,7 @@ import org.slf4j.LoggerFactory;
 
 public class DataTreeCandidatesTest {
 
-    private static final Logger LOG = LoggerFactory.getLogger(DataTreeCandidates.class);
+    private static final Logger LOG = LoggerFactory.getLogger(DataTreeCandidatesTest.class);
 
     private static final SchemaContext SCHEMA_CONTEXT = TestModel.createTestContext();
 
@@ -41,8 +40,7 @@ public class DataTreeCandidatesTest {
 
     @Before
     public void setUp() throws Exception {
-        dataTree = InMemoryDataTreeFactory.getInstance().create(DataTreeConfiguration.DEFAULT_OPERATIONAL);
-        dataTree.setSchemaContext(SCHEMA_CONTEXT);
+        dataTree = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL, SCHEMA_CONTEXT);
 
         final ContainerNode testContainer = ImmutableContainerNodeBuilder.create()
                 .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
@@ -53,7 +51,7 @@ public class DataTreeCandidatesTest {
 
         final InMemoryDataTreeModification modification = (InMemoryDataTreeModification) dataTree.takeSnapshot()
                 .newModification();
-        final DataTreeModificationCursor cursor = modification.createCursor(YangInstanceIdentifier.EMPTY);
+        final DataTreeModificationCursor cursor = modification.openCursor();
         cursor.write(TestModel.TEST_PATH.getLastPathArgument(), testContainer);
         modification.ready();
 
@@ -64,7 +62,7 @@ public class DataTreeCandidatesTest {
 
     @Test
     public void testRootedCandidate() throws DataValidationFailedException {
-        final DataTree innerDataTree = InMemoryDataTreeFactory.getInstance().create(
+        final DataTree innerDataTree = new InMemoryDataTreeFactory().create(
             new DataTreeConfiguration.Builder(TreeType.OPERATIONAL)
             .setMandatoryNodesValidation(true)
             .setRootPath(TestModel.INNER_CONTAINER_PATH)
@@ -103,4 +101,4 @@ public class DataTreeCandidatesTest {
         final LeafNode<?> readLeaf = (LeafNode<?>) newModification.readNode(TestModel.INNER_VALUE_PATH).get();
         assertEquals(readLeaf, leaf);
     }
-}
\ No newline at end of file
+}