Do not include path in anydata/anyxml toString()
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / YangParserSimpleTest.java
index 5f38ca5f7c2c17fb401fbd2f00b8cef194103b05..fa51fb3e73ec3a81520561301e585f16c322981c 100644 (file)
@@ -57,8 +57,7 @@ public class YangParserSimpleTest {
             QName.create(testModule.getQNameModule(), "data"));
         assertNotNull("'anyxml data not found'", data);
         assertFalse(data.equals(null));
-        assertEquals("RegularAnyxmlEffectiveStatement{qname=(urn:opendaylight:simple-nodes?revision=2013-07-30)data, "
-                + "path=AbsoluteSchemaPath{path=[(urn:opendaylight:simple-nodes?revision=2013-07-30)data]}}",
+        assertEquals("RegularAnyxmlEffectiveStatement{qname=(urn:opendaylight:simple-nodes?revision=2013-07-30)data}",
                 data.toString());
 
         // test SchemaNode args
@@ -103,8 +102,7 @@ public class YangParserSimpleTest {
                 QName.create(testModule.getQNameModule(), "data2")).orElse(null);
 
         assertNotNull("'anydata data not found'", anydata);
-        assertEquals("RegularAnydataEffectiveStatement{qname=(urn:opendaylight:simple-nodes?revision=2013-07-30)data2, "
-                        + "path=AbsoluteSchemaPath{path=[(urn:opendaylight:simple-nodes?revision=2013-07-30)data2]}}",
+        assertEquals("RegularAnydataEffectiveStatement{qname=(urn:opendaylight:simple-nodes?revision=2013-07-30)data2}",
                 anydata.toString());
 
         // test SchemaNode args
@@ -193,7 +191,6 @@ public class YangParserSimpleTest {
         final TypeDefinition<?> nodesType = typedefs.iterator().next();
         final QName typedefQName = QName.create(SN, "nodes-type");
         assertEquals(typedefQName, nodesType.getQName());
-        assertEquals(SN_NODES_PATH.createChild(QName.create(SN, "nodes-type")), nodesType.getPath());
         assertFalse(nodesType.getDescription().isPresent());
         assertFalse(nodesType.getReference().isPresent());
         assertEquals(Status.CURRENT, nodesType.getStatus());
@@ -205,7 +202,7 @@ public class YangParserSimpleTest {
         final LeafListSchemaNode added = (LeafListSchemaNode)nodes.getDataChildByName(QName.create(
             testModule.getQNameModule(), "added"));
         assertEquals(createPath("nodes", "added"), added.getPath());
-        assertEquals(createPath("mytype"), added.getType().getPath());
+        assertEquals(createPath("mytype").getLastComponent(), added.getType().getQName());
 
         final ListSchemaNode links = (ListSchemaNode) nodes.getDataChildByName(QName.create(
             testModule.getQNameModule(), "links"));
@@ -214,10 +211,7 @@ public class YangParserSimpleTest {
         final Collection<? extends GroupingDefinition> groupings = nodes.getGroupings();
         assertEquals(1, groupings.size());
         final GroupingDefinition nodeGroup = groupings.iterator().next();
-        final QName groupQName = QName.create(SN, "node-group");
-        assertEquals(groupQName, nodeGroup.getQName());
-        final SchemaPath nodeGroupPath = SN_NODES_PATH.createChild(groupQName);
-        assertEquals(nodeGroupPath, nodeGroup.getPath());
+        assertEquals(QName.create(SN, "node-group"), nodeGroup.getQName());
 
         final Collection<? extends UsesNode> uses = nodes.getUses();
         assertEquals(1, uses.size());