Merge "BUG-1382: eliminate QName.getPrefix()"
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / parser / impl / YangParserSimpleTest.java
index ac6a8287522696d9b68ce91d7159bc289a3bcc5f..3c11b016089e9043cd72e906a465a96e79cb2ee5 100644 (file)
@@ -21,7 +21,6 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.Set;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -61,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());
@@ -109,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());
@@ -157,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());
 
@@ -179,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());
@@ -204,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);
     }