Add MinMaxElementsValidationFailedException
[yangtools.git] / yang / yang-data-impl / src / test / java / org / opendaylight / yangtools / yang / data / impl / schema / BuilderTest.java
index 20a20333ae1323793b2089dd3fb045c36aec6637..889f8fc0210e3ce4afa6a423eb6bbbd19b292e2e 100644 (file)
@@ -19,7 +19,7 @@ import java.util.LinkedList;
 import java.util.Map;
 import org.junit.Before;
 import org.junit.Test;
-import org.opendaylight.yangtools.odlext.model.api.YangModeledAnyXmlSchemaNode;
+import org.opendaylight.yangtools.odlext.model.api.YangModeledAnyxmlSchemaNode;
 import org.opendaylight.yangtools.util.UnmodifiableCollection;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
@@ -95,9 +95,9 @@ public class BuilderTest {
                 .toURI());
         final SchemaContext schema = YangParserTestUtils.parseYangFiles(leafRefTestYang);
         final Module module = schema.getModules().iterator().next();
-        final DataSchemaNode root = module.getDataChildByName(ROOT_CONTAINER);
-        list = (ListSchemaNode)((ContainerSchemaNode) root).getDataChildByName(LIST_MAIN);
-        leafList = (LeafListSchemaNode)((ContainerSchemaNode) root).getDataChildByName(LEAF_LIST_MAIN);
+        final DataSchemaNode root = module.findDataChildByName(ROOT_CONTAINER).get();
+        list = (ListSchemaNode)((ContainerSchemaNode) root).findDataChildByName(LIST_MAIN).get();
+        leafList = (LeafListSchemaNode)((ContainerSchemaNode) root).findDataChildByName(LEAF_LIST_MAIN).get();
     }
 
     @Test
@@ -106,7 +106,7 @@ public class BuilderTest {
         mapEntryNodeColl.add(LIST_MAIN_CHILD_3);
         final Map<QName, Object> keys = new HashMap<>();
         keys.put(LIST_MAIN_CHILD_QNAME_1, 1);
-        final NodeIdentifierWithPredicates mapEntryPath = new NodeIdentifierWithPredicates(LIST_MAIN, keys);
+        final NodeIdentifierWithPredicates mapEntryPath = NodeIdentifierWithPredicates.of(LIST_MAIN, keys);
         final OrderedMapNode orderedMapNodeCreateNull = ImmutableOrderedMapNodeBuilder.create()
                 .withNodeIdentifier(NODE_IDENTIFIER_LIST)
                 .withChild(LIST_MAIN_CHILD_1)
@@ -131,7 +131,7 @@ public class BuilderTest {
         assertEquals(orderedMapNodeCreateNode.getSize(), orderedMapNodeCreateNull.getSize() - 1);
         assertEquals(NODE_IDENTIFIER_LIST, orderedMapNodeCreateSize.getIdentifier());
         assertEquals(LIST_MAIN_CHILD_1, orderedMapNodeCreateNull.getChild(0));
-        assertEquals(SIZE, orderedMapNodeCreateNull.getValue().size());
+        assertEquals(SIZE, orderedMapNodeCreateNull.size());
         assertEquals(orderedMapNodeSchemaAware.getChild(0), orderedMapNodeSchemaAwareMapNodeConst.getChild(0));
     }
 
@@ -270,7 +270,7 @@ public class BuilderTest {
 
     @Test(expected = NullPointerException.class)
     public void immutableYangModeledAnyXmlNodeBuilderExceptionTest() {
-        ImmutableYangModeledAnyXmlNodeBuilder.create(mock(YangModeledAnyXmlSchemaNode.class), 1);
+        ImmutableYangModeledAnyXmlNodeBuilder.create(mock(YangModeledAnyxmlSchemaNode.class), 1);
     }
 
     @Test(expected = UnsupportedOperationException.class)