Merge "BUG-1382: eliminate QName.getPrefix()"
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / parser / impl / YangParserSimpleTest.java
index c5e86b431b4e389a1088c69237cc9a7eeb3f3026..3c11b016089e9043cd72e906a465a96e79cb2ee5 100644 (file)
@@ -60,7 +60,6 @@ public class YangParserSimpleTest {
         // test SchemaNode args
         QName qname = data.getQName();
         assertEquals("data", qname.getLocalName());
-        assertEquals(snPref, qname.getPrefix());
         assertEquals(snNS, qname.getNamespace());
         assertEquals(snRev, qname.getRevision());
         assertEquals("anyxml desc", data.getDescription());
@@ -108,7 +107,7 @@ public class YangParserSimpleTest {
 
         ContainerSchemaNode nodes = (ContainerSchemaNode) test.getDataChildByName("nodes");
         // test SchemaNode args
-        QName expectedQName = new QName(snNS, snRev, snPref, "nodes");
+        QName expectedQName = QName.create(snNS, snRev, "nodes");
         assertEquals(expectedQName, nodes.getQName());
         SchemaPath expectedPath = TestUtils.createPath(true, snNS, snRev, snPref, "nodes");
         assertEquals(expectedPath, nodes.getPath());
@@ -156,12 +155,12 @@ public class YangParserSimpleTest {
         Set<TypeDefinition<?>> typedefs = nodes.getTypeDefinitions();
         assertEquals(1, typedefs.size());
         TypeDefinition<?> nodesType = typedefs.iterator().next();
-        QName typedefQName = new QName(snNS, snRev, snPref, "nodes-type");
+        QName typedefQName = QName.create(snNS, snRev, "nodes-type");
         assertEquals(typedefQName, nodesType.getQName());
         SchemaPath nodesTypePath = TestUtils.createPath(true, snNS, snRev, snPref, "nodes", "nodes-type");
         assertEquals(nodesTypePath, nodesType.getPath());
-        assertNull(nodesType.getDescription());
-        assertNull(nodesType.getReference());
+        assertTrue(nodesType.getDescription().isEmpty());
+        assertTrue(nodesType.getReference().isEmpty());
         assertEquals(Status.CURRENT, nodesType.getStatus());
         assertEquals(0, nodesType.getUnknownSchemaNodes().size());
 
@@ -178,7 +177,7 @@ public class YangParserSimpleTest {
         Set<GroupingDefinition> groupings = nodes.getGroupings();
         assertEquals(1, groupings.size());
         GroupingDefinition nodeGroup = groupings.iterator().next();
-        QName groupQName = new QName(snNS, snRev, snPref, "node-group");
+        QName groupQName = QName.create(snNS, snRev, "node-group");
         assertEquals(groupQName, nodeGroup.getQName());
         SchemaPath nodeGroupPath = TestUtils.createPath(true, snNS, snRev, snPref, "nodes", "node-group");
         assertEquals(nodeGroupPath, nodeGroup.getPath());
@@ -203,7 +202,7 @@ public class YangParserSimpleTest {
 
         List<QName> path = new ArrayList<>();
         for (String name : names) {
-            path.add(new QName(ns, rev, prefix, name));
+            path.add(QName.create(ns, rev, name));
         }
         return SchemaPath.create(path, true);
     }