Add XMLNamespace
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / EffectiveBuildTest.java
index a0b208b36771f0f78364fa21f6bd9a565f7fca60..6667a4805e007a18d72723229b2e41b52c92ccc1 100644 (file)
@@ -10,16 +10,16 @@ package org.opendaylight.yangtools.yang.stmt;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+import static org.opendaylight.yangtools.yang.stmt.StmtTestUtils.assertPathEquals;
 import static org.opendaylight.yangtools.yang.stmt.StmtTestUtils.sourceForResource;
 
 import java.io.FileNotFoundException;
-import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Collection;
-import java.util.Set;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.QNameModule;
+import org.opendaylight.yangtools.yang.common.XMLNamespace;
 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
@@ -35,7 +35,7 @@ public class EffectiveBuildTest {
 
     private static final StatementStreamSource SIMPLE_MODULE = sourceForResource(
             "/stmt-test/effective-build/simple-module.yang");
-    private static final QNameModule SIMPLE_MODULE_QNAME = QNameModule.create(URI.create("simple.yang"));
+    private static final QNameModule SIMPLE_MODULE_QNAME = QNameModule.create(XMLNamespace.of("simple.yang"));
     private static final StatementStreamSource YANG_EXT = sourceForResource(
             "/stmt-test/extensions/yang-ext.yang");
 
@@ -85,9 +85,9 @@ public class EffectiveBuildTest {
         ContainerSchemaNode grpSubSubCon2 = (ContainerSchemaNode) grpSubCon2.getDataChildByName(q6);
         assertNotNull(grpSubSubCon2);
 
-        assertEquals(SchemaPath.create(true, q1, q2, q3), subSubCon.getPath());
-        assertEquals(SchemaPath.create(true, q4, q5, q6), subSubCon2.getPath());
-        assertEquals(SchemaPath.create(true, q7, q5, q6), grpSubSubCon2.getPath());
+        assertPathEquals(SchemaPath.create(true, q1, q2, q3), subSubCon);
+        assertPathEquals(SchemaPath.create(true, q4, q5, q6), subSubCon2);
+        assertPathEquals(SchemaPath.create(true, q7, q5, q6), grpSubSubCon2);
     }
 
     @Test
@@ -95,12 +95,12 @@ public class EffectiveBuildTest {
         SchemaContext result = RFC7950Reactors.defaultReactor().newBuild().addSource(YANG_EXT).buildEffective();
         assertNotNull(result);
 
-        Set<GroupingDefinition> groupings = result.getGroupings();
+        Collection<? extends GroupingDefinition> groupings = result.getGroupings();
         assertEquals(1, groupings.size());
 
         GroupingDefinition grp = groupings.iterator().next();
 
-        Collection<DataSchemaNode> childNodes = grp.getChildNodes();
+        Collection<? extends DataSchemaNode> childNodes = grp.getChildNodes();
         assertEquals(1, childNodes.size());
         DataSchemaNode child = childNodes.iterator().next();